---
title: "Pi coding agent with EU-hosted models · Setup guide"
description: "Add inference.eu to Pi's models.json and run the minimal Pi coding agent on open-weight models processed in EU data centres."
canonical: "https://inference.eu/integrations/pi/"
language: "en"
---

Coding agents · Pi

# Use the Pi coding agent with open-source models hosted in the EU

Pi is a small, extensible coding agent for the terminal. It reads custom providers from a single models.json file, so adding inference.eu takes one provider block, and every prompt Pi sends is then processed on open-weight models in European data centres.

[Contact sales](https://inference.eu/contact/)[Setup](#setup)

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` in your shell profile.

2.  2

    Open `~/.pi/agent/models.json`, or create it if it does not exist.

3.  3

    Add an `inference-eu` provider with the inference.eu base URL, `api` set to `openai-completions` and `apiKey` set to `$INFERENCE_EU_API_KEY`.

4.  4

    List the model ids you want under `models`, for example `qwen3-coder-480b-a35b-instruct`.

5.  5

    Start `pi`, run `/model`, pick an inference.eu model and press `Ctrl+S` to make it the default.

~/.pi/agent/models.json

```
{
  "$schema": "https://pi.dev/schemas/models.schema.json",
  "providers": {
    "inference-eu": {
      "baseUrl": "https://api.inference.eu/v1",
      "api": "openai-completions",
      "apiKey": "$INFERENCE_EU_API_KEY",
      "models": [
        { "id": "qwen3-coder-480b-a35b-instruct" },
        { "id": "glm-5.3" },
        { "id": "kimi-k3" }
      ]
    }
  }
}
```

## What Pi is

Pi is a minimal coding agent that runs in the terminal. It keeps its core small: a handful of tools for reading, writing and editing files and running shell commands, plus a plain system prompt. Everything else, from custom commands to new providers, is added through extensions, skills and configuration files.

Pi speaks several model APIs natively, including OpenAI Chat Completions and Anthropic Messages. Any endpoint that speaks one of those formats can be added in `models.json`, which is how you connect it to inference.eu.

## How the configuration works

Custom providers live in `~/.pi/agent/models.json` under `providers`. The `inference-eu` block sets `baseUrl` to the inference.eu base URL ending in `/v1` and `api` to `openai-completions`. `apiKey` accepts `$NAME` or `${NAME}` interpolation, so the key stays in your environment and out of the file.

Each entry under `models` needs an `id` that matches an inference.eu model id. Pi reloads the file whenever you open `/model`, so you can add models without restarting. If you prefer the Anthropic format, set `api` to `anthropic-messages` and use the base URL without the trailing `/v1`.

## Which models to choose

Pi relies on the model to plan edits and call its file and shell tools in sequence, so models with dependable tool calling work best. `qwen3-coder-480b-a35b-instruct` is a strong default for everyday coding: it follows Pi's short system prompt closely and edits files precisely.

For larger refactors or tasks that need more reasoning across a codebase, `glm-5.3` and `kimi-k3` are good choices. `gpt-oss-120b` responds quickly and suits small questions and scripted runs. Add several to `models.json` and cycle between them with `Ctrl+P` to compare them on your own repository.

## Troubleshooting

If an inference.eu model does not appear in `/model`, Pi has no usable key for the provider. Check that `INFERENCE_EU_API_KEY` is exported in the shell that starts Pi and that `apiKey` reads `$INFERENCE_EU_API_KEY` exactly.

A 401 error means the key is wrong or inactive. A 404 usually comes from a base URL with an extra path or, with `anthropic-messages`, from leaving `/v1` on the URL. "Model not found" means an `id` differs from the inference.eu model id. If a run ends without token counts, update Pi, since streaming usage is read from the final chunk.

## Keeping code and data in the EU

Pi sends the files it reads, your prompts and tool output to the model provider. With inference.eu as the provider, those requests 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.

Pi itself runs locally and does not proxy your prompts through its own servers. It may fetch an updated model catalogue from pi.dev, which contains model metadata, not your code. Use only inference.eu providers in `/scoped-models` so that no session falls back to a provider outside the EU.

## Pi

Category

Coding agents

Maker

Earendil Works

API format

OpenAI and Anthropic

Processing

EU data centres

Website

[pi.dev](https://pi.dev/)

Documentation

[github.com](https://github.com/earendil-works/pi/blob/main/packages/coding-agent/docs/models.md)

## Pi: common questions

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

Yes. Pi reads custom providers from \`~/.pi/agent/models.json\`. Add a provider with \`baseUrl\`, \`api\` set to \`openai-completions\`, an \`apiKey\` and a list of models, then pick one of them with \`/model\`.

Yes. Set \`api\` to \`anthropic-messages\` in the provider block and use the inference.eu base URL without the trailing \`/v1\`. The OpenAI format is the simpler default, but both reach the same models.

Write \`"apiKey": "$INFERENCE\_EU\_API\_KEY"\` and export the variable in your shell profile. Pi resolves \`$NAME\` and \`${NAME}\` at request time. A leading \`!\` runs a command instead, which works with password managers.

Qwen3 Coder 480B is a strong default for code edits and tool calls. GLM-5.3 and Kimi K3 suit larger refactors that need more reasoning, and gpt-oss-120b is a quick option for short questions and scripted runs.

The picker only lists models whose provider has a usable key. Make sure \`INFERENCE\_EU\_API\_KEY\` is set in the shell that launches Pi, check the JSON is valid, and reopen \`/model\` to reload the file.

Open \`/model\`, highlight the inference.eu model and press \`Ctrl+S\`. New sessions then start with that model. Resumed sessions keep the model they were recorded with, so switch those manually if needed.

No. Pi reloads \`models.json\` each time you open \`/model\`, so new models and changed settings appear straight away. A restart is only needed when you change an environment variable in a new shell.

The key Pi sent is missing, mistyped or inactive. Note that a key passed with \`--api-key\` or stored in \`auth.json\` takes precedence over \`models.json\`, so remove stale credentials if Pi keeps sending an old key.

No. Pi runs locally and sends model requests straight to the provider you configure. It may download an updated model catalogue from pi.dev, but that is metadata about models, not your prompts or files.

Yes. Store the key as a CI secret exposed as \`INFERENCE\_EU\_API\_KEY\`, ship \`models.json\` with the job, and start Pi in non-interactive mode with the inference.eu model selected. Pi does not need to write credentials to disk.

[Ask a question](https://inference.eu/contact/)

## Related

[All integrations](https://inference.eu/integrations/)

-   [OpenCodeRun the OpenCode terminal agent on open-weight models processed in EU data centres. Add one provider block to opencode.json and keep your code in Europe.Coding agents](https://inference.eu/integrations/opencode/)
-   [OpenClawRun the OpenClaw personal assistant on open-weight models processed in EU data centres by adding inference.eu as a custom provider in openclaw.json.Agents](https://inference.eu/integrations/openclaw/)
-   [Claude CodePoint Claude Code at inference.eu with ANTHROPIC\_BASE\_URL and run it on open-weight models processed in EU data centres. No Anthropic account needed.Coding agents](https://inference.eu/integrations/claude-code/)

## 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
