The best models for Pi Coding Agent depend on the job: start with Claude Sonnet 5.5 for everyday coding or GPT-6.1 Sol for an OpenAI option. Try Claude Opus 5.5 on difficult debugging, compare MiniMax M3 and DeepSeek V4.1 Flash for routine work, and test Qwen3.8 27B when code must stay on your machine.

Pi is an extensible agent harness that runs in your terminal. The harness manages the conversation and tools; the model decides which files to read, which commands to run, and what to change. Pi lets you switch models inside that workflow, so you can compare them on the same repository rather than choosing from unrelated leaderboards.

Model IDs and availability were checked against the Haimaker catalog on October 14, 2026. The recommendations combine current provider information with a small, independent Pi evaluation. We have not run a new Haimaker benchmark of these models in Pi.

Which model should you start with in Pi?

Start with Sonnet 5.5 or GPT-6.1 Sol on a task you already know how to verify. Keep the tool access and repository state fixed, then compare a budget candidate on the same task. Move to Opus when the cheaper model repeats a failed approach or needs too much human correction.

Pi workloadModel to tryHaimaker model IDTradeoff
Everyday edits, tests, and repository workClaude Sonnet 5.5anthropic/claude-sonnet-5-5Costs more per token than budget choices
Coding and planning with an OpenAI modelGPT-6.1 Solopenai/gpt-6.1-solCompare reasoning effort and total tokens
Difficult debugging or unclear requirementsClaude Opus 5.5anthropic/claude-opus-5-5Higher token rates; may need fewer attempts
Routine coding on a budgetMiniMax M3minimax/minimax-m3Test tool arguments and failure recovery
Low-cost background tasksDeepSeek V4.1 Flashdeepseek/deepseek-v4.1-flashRetries and latency can outweigh low rates
Another budget comparisonGLM-5.3 Flashz-ai/glm-5.3-flashCheck long outputs and total task time
Research and large document inputsGemini 3.8 Flashgoogle/gemini-3.8-flashLarge input capacity still needs answer verification
Difficult research and reasoningGemini 4 Argongoogle/gemini-4-argonNew paid candidate, absent from the Pi evaluation below

Anthropic’s model overview describes the current Claude tiers. OpenAI’s Sol documentation covers its coding and agent role, and Google’s model list covers the Gemini choices. Those descriptions help form a shortlist; they do not establish a winner on your codebase.

This is the same task-based approach used in our Hermes model guide. Pi’s configuration, model cycling, and thinking controls are different, so use the Pi setup below rather than copying a Hermes configuration.

What do actual Pi coding comparisons show?

A small Pi evaluation supports testing Sonnet, Sol, and Opus before assuming a budget model will finish faster or cheaper. It also shows that more reasoning can add checking and tool calls without improving completion on an easy task. The useful comparison is the finished job, including failed attempts and review time.

Ibragim Badertdinov’s personal coding evaluation used 10 tasks with 3 runs per configuration. The September 30 results report:

Model and effortSingle-attempt task successReported time per task
Sonnet 5.5, high100%46 seconds
GPT-6.1 Sol, medium100%1 minute 7 seconds
Opus 5.5, low100%37 seconds
DeepSeek V4.1 Flash, max93.3%4 minutes 30 seconds
GLM-5.3 Flash, max96.7%7 minutes 1 second

These are the author’s results, not ours. The methodology describes clearly defined tasks from the author’s work, automated checks, and API access. The tasks remain private, and the results used Pi 0.85.1, rather than the current Pi 1.x release. Equal pass rates also do not establish equal code quality.

The comparison gives a reason to test reasoning effort as well as the model. Opus at low effort completed this small suite faster than the other configurations shown. That does not mean low effort is enough for a difficult migration. Run the task with its real constraints, then inspect whether extra reasoning changes the patch or only adds repeated checks.

For your own comparison, record successful completion, incorrect tool arguments, retries, elapsed time, and the final bill. Our coding-agent API cost guide explains why token rates alone can give the wrong answer.

How do you connect Pi to these models?

Use Haimaker Connect to connect Pi without writing the provider configuration by hand. Install Pi first, then run Connect to configure its native files and verify the connection.

For a new installation, Pi’s quickstart uses the current npm package below and requires Node.js 22.19 or newer:

npm install -g --ignore-scripts @earendil-works/pi-coding-agent
pi --version

Run the setup wizard and choose Pi:

npx -y @haimaker/connect

For Pi with the Sonnet recommendation above, select both explicitly:

npx -y @haimaker/connect --pi --model anthropic/claude-sonnet-5-5
pi --provider haimaker --model anthropic/claude-sonnet-5-5

Connect opens a browser login or uses an existing HAIMAKER_API_KEY. It writes the Haimaker provider to models.json, stores the key in Pi’s auth.json, and verifies one request. Pi then sends requests directly to Haimaker. See the Connect package documentation for options.

Without --model, Connect configures haimaker/auto. Use a named model for comparisons so routing does not change the model between requests. Connect writes a single model entry; use the manual configuration below to keep several candidates in Pi’s picker. It backs up existing files, but rewrites models.json as JSON without comments.

Use Haimaker Connect to configure Pi, then compare models on the same repository task.

CONNECT PI TO HAIMAKER

Manual configuration: keep several models in the picker

Set your key in the shell that will start Pi:

export HAIMAKER_API_KEY=your-haimaker-key

Add this provider to ~/.pi/agent/models.json. Merge it into an existing providers object if you already have one:

{
  "$schema": "https://pi.dev/schemas/models.schema.json",
  "providers": {
    "haimaker": {
      "baseUrl": "https://api.haimaker.ai/v1",
      "api": "openai-completions",
      "apiKey": "${HAIMAKER_API_KEY}",
      "models": [
        {
          "id": "anthropic/claude-sonnet-5-5",
          "name": "Claude Sonnet 5.5",
          "reasoning": true,
          "input": ["text", "image"],
          "contextWindow": 1000000,
          "maxTokens": 128000
        },
        {
          "id": "openai/gpt-6.1-sol",
          "name": "GPT-6.1 Sol",
          "reasoning": true,
          "input": ["text", "image"],
          "contextWindow": 922000,
          "maxTokens": 128000
        },
        {
          "id": "minimax/minimax-m3",
          "name": "MiniMax M3",
          "reasoning": true,
          "input": ["text", "image"],
          "contextWindow": 1000000,
          "maxTokens": 128000
        }
      ]
    }
  }
}

The limits above describe the checked Haimaker catalog, which can differ from a provider’s direct API. Pi accepts environment interpolation in provider credentials; see its model configuration guide. Start with a bounded task before sending a large repository context.

Select the model with both identifiers:

pi --provider haimaker --model anthropic/claude-sonnet-5-5

Inside Pi, open /model to select another configured model. The picker reloads models.json. Custom pricing metadata is omitted from this example because rates change; check the provider bill rather than treating an unconfigured session cost display as a measured zero-cost run.

A provider account you already have

For a built-in provider, run /login and follow Pi’s authentication flow, then choose a model with /model. Pi’s provider reference lists API-key variables and provider-specific options. A subscription and a metered API key can have different access and billing, so use the connection method your account actually supports.

How should you set thinking levels and switch models?

Keep model choice and thinking effort as separate variables. Use a moderate effort where supported for the first comparison, then increase it on a task that needs more reasoning. Pi restricts levels to the selected model’s capabilities. Compare token use and completion when choosing effort; providers interpret the same level differently.

Pi’s CLI reference supports an explicit model and effort:

pi --provider haimaker --model openai/gpt-6.1-sol --thinking medium

In an interactive session, /thinking changes effort and /scoped-models chooses the models you cycle through with Ctrl+P. Start with 2 models in that cycle: a routine-work candidate and a stronger alternative. Add another only when it solves a recurring failure. Save a startup default from the model picker with Ctrl+S.

Switching models manually keeps the choice visible. Haimaker’s haimaker/auto routes on the API side. For routing within Pi, use virtual model routing through extensions. Configure and test that extension separately. Several entries in models.json give you selectable models; the list does not choose between them.

Pi also separates coding models from classifier and image models. Its current documentation lists GPT-6 Luna through the Decisions API as a classifier used by Codemode, rather than the main conversation picker. Check the model’s API and role when following a community recommendation, especially one made on an older Pi version.

Which local models are worth trying with Pi?

Compare Qwen3.8 27B, Muse Glimmer 30B, and Qwen3 Coder 30B when you have workstation memory and want local inference. Use Gemma 4 E4B or Qwen3 8B on smaller machines. Check whether the local model uses Pi’s tools correctly and recovers after a command fails.

Pi has a documented llama.cpp router integration for GGUF models. If you already use Ollama, configure its separate OpenAI-compatible endpoint. Pull a model that fits the machine, then add its exact tag to models.json:

ollama pull qwen3.8:27b
{
  "providers": {
    "ollama": {
      "baseUrl": "http://localhost:11434/v1",
      "api": "openai-completions",
      "apiKey": "ollama",
      "models": [
        {
          "id": "qwen3.8:27b",
          "name": "Qwen3.8 27B local",
          "reasoning": true,
          "input": ["text", "image"],
          "contextWindow": 32768,
          "maxTokens": 8192
        }
      ]
    }
  }
}

The placeholder key lets Pi resolve authentication for the local provider; Ollama ignores it. Merge this provider alongside any cloud configuration, then select it:

pi --provider ollama --model qwen3.8:27b

Qwen3.8’s Ollama listing shows an approximately 18GB download, before context state and runtime buffers. A 24GB GPU or 32GB+ unified-memory machine is a starting point for a bounded session. The 32K context in this example is a conservative starting setting, not a guarantee of fit. For smaller machines and other candidates, see our Ollama coding-model guide.

Local inference keeps the model’s prompts on your machine. External tools can still send data elsewhere, and a model with a cloud tag uses hosted inference. Check both the endpoint and the enabled tools when keeping code private.

Frequently asked questions

Can I change models without losing my Pi session?

Yes. Use /model to change the model in an existing Pi session. Pi records model and thinking-level changes, and resuming restores them. Use /scoped-models to choose the models available for cycling with Ctrl+P.

Why does my custom model not appear in Pi?

Check that Pi can resolve the provider credentials and that the model ID is in models.json. An environment variable must be present in the process that starts Pi. Classifier and image models use separate tools and do not appear in the main /model picker.

Does Pi support Haimaker and local Ollama models?

Yes. Use npx -y @haimaker/connect —pi to configure Haimaker through Pi’s native files, or add the provider manually in ~/.pi/agent/models.json. Ollama uses a separate local provider at http://localhost:11434/v1 with the exact local model tag.

Start with one verified repository task, keep Pi’s tools and context fixed, and compare two models. Keep the model that completes it correctly with less waiting and review work. Repeat that comparison when a new release addresses a failure you actually encounter.