Pi

Pi

The Pi coding agent (npm @earendil-works/pi-coding-agent) reads custom providers from its models.json. Ours uses Pi's openai-completions API against https://api.abliteratedllm.dev/v1.

Placeholders: $API_BASE is https://api.abliteratedllm.dev/v1, $API_ORIGIN is https://api.abliteratedllm.dev, and $YOUR_KEY is your API key.

Signed in? The API keys page has this file ready-made for every model we currently serve, with live prices, a highlighted provider block and a download button.

1. Add the provider to models.json

The file is ~/.pi/agent/models.json on macOS and Linux, and %USERPROFILE%\.pi\agent\models.json on Windows. If you set PI_CODING_AGENT_DIR, it's models.json in that directory.

{
  "$schema": "https://pi.dev/schemas/models.schema.json",
  "providers": {
    "abliteratedllm": {
      "name": "AbliteratedLLM",
      "baseUrl": "$API_BASE",
      "api": "openai-completions",
      "apiKey": "$ABLITERATEDLLM_API_KEY",
      "compat": {
        "supportsDeveloperRole": false,
        "supportsStore": false,
        "supportsReasoningEffort": true,
        "maxTokensField": "max_tokens",
        "thinkingFormat": "openai"
      },
      "models": [
        {
          "id": "glm-5.3-flash-abliterated",
          "name": "GLM-5.3 Flash Abliterated",
          "reasoning": true,
          "thinkingLevelMap": {
            "minimal": null
          },
          "input": [
            "text"
          ],
          "contextWindow": 262144,
          "maxTokens": 65536,
          "cost": {
            "input": 0.0977,
            "output": 0.3421,
            "cacheRead": 0.0098,
            "cacheWrite": 0
          }
        }
      ]
    }
  }
}
  • New file: save it as shown. Existing file: copy only the "abliteratedllm" entry into your "providers" object, with a comma between it and the provider before it, and keep your other providers.
  • api: "openai-completions" makes Pi call /v1/chat/completions. baseUrl includes /v1.
  • compat asks for the plain chat-completions forms: the system prompt as a system message, no store field, the budget in max_tokens, and reasoning set with reasoning_effort.
  • models needs one entry per id from GET /v1/models, and id must match exactly; the file on the dashboard already lists them all. contextWindow and maxTokens are the model's context_length and max_output_tokens. On a trial account, output is capped at 4096 tokens regardless.
  • thinkingLevelMap hides Pi's minimal thinking level, which has no matching reasoning_effort value. low, medium and high are sent as they are.
  • cost is in USD per 1M tokens (input, output and cached input), so Pi's cost display matches what we bill. We don't charge for cache writes.
  • Pi rereads the file each time you open /model, so edits need no restart.

2. Connect your key

"apiKey": "$ABLITERATEDLLM_API_KEY" makes Pi read your key from that environment variable, so the key never goes in the file.

Bash or Zsh (add the line to ~/.zshrc or ~/.bashrc to keep it):

export ABLITERATEDLLM_API_KEY="$YOUR_KEY"

Windows (applies to terminals you open afterwards):

setx ABLITERATEDLLM_API_KEY "$YOUR_KEY"

For a single run, add --api-key "$YOUR_KEY" to the pi --model … command in step 3; it overrides the file. Our models appear in /model only once a key resolves.

3. Pick the model and say hi

pi --model abliteratedllm/glm-5.3-flash-abliterated

pi --provider abliteratedllm --model glm-5.3-flash-abliterated does the same. Inside Pi, /model switches models and Ctrl+S there saves your pick as the default. pi --list-models lists every model Pi can use.

Good to know

  • Text only. Image input fails with 400 unsupported_content.
  • Trial accounts allow 1 concurrent request, which is tight for agent work. See Rate limits and trial.

Verified against Pi's docs on 2026-11-03: Custom models, CLI and the models.json schema.