Setting up Hetzner Qwen3.8-27B in the Pi agent

I added the Hetzner Inference API as a provider in my Pi agent, the same way I set up NVIDIA models in OpenCode. Hetzner runs an OpenAI-compatible REST API at inference.hetzner.com serving open-weight Qwen models. To get an API token you log in to experiments.hetzner.com and create one from the Inference app there. The service is free while it stays experimental, but you still have to add a credit card to the account before it lets you generate a token. The docs are at Hetzner's Inference API page linked above.

Custom providers in pi live in ~/.pi/agent/models.json and the model ID to use is Qwen3.8-27B, and you can always check the live model list with:

curl -s https://inference.hetzner.com/api/v1/models \
  -H "Authorization: Bearer <YOUR_TOKEN>"

Here is the full provider config:

{
  "providers": {
    "hetzner": {
      "baseUrl": "https://inference.hetzner.com/api/v1",
      "api": "openai-completions",
      "apiKey": "<YOUR_TOKEN>",
      "compat": {
        "supportsDeveloperRole": false,
        "supportsReasoningEffort": false
      },
      "models": [
        {
          "id": "Qwen3.8-27B",
          "name": "Qwen3.8 27B (Hetzner)",
          "reasoning": true,
          "input": ["text", "image"],
          "contextWindow": 262144,
          "cost": { "input": 0, "output": 0, "cacheRead": 0, "cacheWrite": 0 }
        }
      ]
    }
  }
}

The compat flags tell pi to send a plain system message instead of the developer role and to skip the reasoning_effort field, which the Qwen server does not understand. reasoning: true enables thinking mode, input allows text and image messages, and the context window is 262k tokens.

No restart needed. Open /model inside pi and the model appears as Qwen3.8 27B (Hetzner), since the file reloads whenever you open the model picker. Keep models.json readable only by your user because the key sits in plain text. Rate limits are 10 requests and 100k output tokens per minute, and going over returns HTTP 429.