inference.eu

Coding agents · Grok CLI (Grok Build)

Use the Grok CLI with open-source models hosted in the EU

Grok Build, the coding agent you start with the `grok` command, supports custom models from any OpenAI-compatible or Anthropic-compatible endpoint. Add inference.eu as a custom model in config.toml and the agent works on open-weight models processed in European data centres.

  1. 01API format: OpenAI and Anthropic
  2. 02EU data centres
  3. 03Covered by one DPA

Set it up in a few minutes

  1. 1

    Create an API key in your inference.eu account and export it as INFERENCE_EU_API_KEY.

  2. 2

    Open ~/.grok/config.toml and add a [model.inference-eu] table with the model id, the inference.eu base URL, env_key and api_backend = "chat_completions".

  3. 3

    Set default under [models] to inference-eu, and point session_summary at an inference.eu model as well.

  4. 4

    Run grok inspect to check that Grok picked up the configuration.

  5. 5

    Start grok in your project, or test headlessly with grok -p "Hello" -m inference-eu.

~/.grok/config.toml
[model.inference-eu]
model = "qwen3-coder-480b-a35b-instruct"
base_url = "https://api.inference.eu/v1"
name = "Qwen3 Coder 480B (inference.eu)"
env_key = "INFERENCE_EU_API_KEY"
api_backend = "chat_completions"
supports_backend_search = false

[model.inference-eu-glm]
model = "glm-5.3"
base_url = "https://api.inference.eu/v1"
name = "GLM-5.3 (inference.eu)"
env_key = "INFERENCE_EU_API_KEY"
api_backend = "chat_completions"
supports_backend_search = false

[models]
default = "inference-eu"
session_summary = "inference-eu-glm"

What the Grok CLI is

Grok Build is xAI's coding agent for the terminal. You start it with grok for a full-screen interactive session, run it headlessly with grok -p in scripts, or embed it in other apps through the Agent Client Protocol. It reads and edits files, runs commands, uses MCP servers, skills and hooks, and can split work across subagents.

Grok Build ships with xAI's own models, but its settings reference documents custom models as a first-class option: any endpoint that speaks OpenAI Chat Completions, the Responses API or Anthropic Messages. That is how you connect it to inference.eu.

How the configuration works

Custom models live in your user config, ~/.grok/config.toml. Each [model.<id>] table defines one model: model is the id sent to the API, base_url is the inference.eu base URL ending in /v1, env_key names the variable holding your key, and api_backend = "chat_completions" selects the OpenAI format. name is the label shown in the model picker.

Under [models], default picks the model for new sessions. Grok also uses separate models for session summaries, image descriptions and web search; set session_summary to an inference.eu model so those background calls go to inference.eu too. Project-level config files cannot define models, which keeps keys out of repositories.

Which models to choose

The agent loop relies on reliable tool calls and on following instructions across many steps. qwen3-coder-480b-a35b-instruct is a strong default for everyday coding, with precise edits and dependable tool use. glm-5.3 and kimi-k3 suit planning, larger refactors and debugging that need more reasoning, and work well for session summaries.

gpt-oss-120b responds quickly and fits subagents, headless scripts and short questions. Set context_window on each model entry to match the model so that Grok compacts the conversation at the right time. You can restrict the picker to inference.eu models with allowed_models under [models].

Troubleshooting

A 401 error means the key did not reach the endpoint. Check that INFERENCE_EU_API_KEY is exported in the shell that starts grok and that env_key names exactly that variable. A 404 usually comes from a base_url with an extra path, or from api_backend set to a protocol that does not match the URL.

If tool calls fail or arrive malformed, set stream_tool_calls = false on the model; some custom endpoints need it. If web search errors, supports_backend_search must stay false, since Grok-hosted search tools do not run on other endpoints. grok inspect shows which config files and models Grok actually loaded.

Keeping code and data in the EU

With inference.eu as the model, the files, diffs and command output Grok sends to the model are processed in EU data centres and never used for training. We sign a data processing agreement under Article 28 GDPR, publish our subprocessor list and bill in euros.

Grok Build is an xAI product, and some traffic can still go to xAI: the first-launch sign-in, Grok-hosted web search, and any background task still assigned to a Grok model. Point session_summary and image_description at inference.eu models, keep supports_backend_search = false, and restrict allowed_models so that sessions do not fall back to models outside the EU.

Grok CLI (Grok Build): common questions

The questions buyers, developers and legal teams ask us most. Something missing? Ask us directly.

Ask a question

Move your AI workloads to EU infrastructure

Tell us which models you use and roughly how much traffic you have. We reply within one working day with pricing and next steps.

  • Reply within one working day
  • Pricing for your volume
  • DPA ready to sign