AI Agents

Which model should you run in your coding agent?

Almost every article on this asks which model is smartest. That is rarely the decision you are actually making, because most agents cannot run most models. Pick Claude Code and you have picked Anthropic. Pick Codex and you have picked OpenAI. The model shortlist is decided by the agent, usually before you have an opinion.

The order to decide in

  1. What shape of agent do you need — invoked per session, or running as a service?
  2. Which models can that agent actually reach? (the table below)
  3. Only now: which of those models do you want, and at what tier?

Doing it the other way round is how people end up wanting a model their agent cannot talk to.

What each agent can actually reach

Read from each project’s own documentation. Where a project lists providers and then says “and more”, we record what is documented and treat it as a minimum rather than a complete list.

Model support by agent: Claude Code, Codex, OpenClaw, Hermes Agent, Aider, Pi, Cline, goose, OpenHands
AgentAny modelLocal modelsProviders documented
Claude CodeNoNoneAnthropic, AWS Bedrock, Google
CodexNoNoneOpenAI
OpenClawYesVia proxyAnthropic, OpenAI, Other
Hermes AgentYesVia proxyOpenAI, OpenRouter, Other
AiderYesVia proxyOpenAI, Anthropic, Google, Mistral, Cohere, Ollama, OpenRouter, Other
PiYesOpenAI, Anthropic, Google, Other
ClineYesFullAnthropic, OpenAI, Google, AWS Bedrock, Azure OpenAI, Groq, OpenRouter, Ollama, Other
gooseYesFullAnthropic, OpenAI, Google, Ollama, OpenRouter, Azure OpenAI, AWS Bedrock, Other
OpenHandsYesFullAnthropic, OpenAI, Google, Other

Blank means the project does not state it. OpenCode, Grok Build and Cursor CLI are absent because their documentation does not state a model position at all — see the full matrix.

Three tiers of model freedom

1. Locked to one vendor — Claude Code, Codex

Choosing the agent chooses the model family. Worth a precision that trips people up: Claude Code lists three providers — Anthropic, Bedrock and Google — but those are three routes to the same Claude models, not three model families. Multi-cloud is not multi-model. If your employer requires Bedrock, that matters a great deal; if you wanted to try a different model, it changes nothing.

2. Any cloud model — OpenClaw , Hermes , Aider, Pi

Model choice becomes a config change. In practice most of these reach breadth through an OpenAI-compatible endpoint or a router like OpenRouter, which is why their provider lists look shorter than their real reach — one “OpenAI- compatible” entry can stand for dozens of models. It also means a provider switch is a line of config rather than a migration.

3. Local models as a first-class option — Cline, goose, OpenHands

These document real local-model support rather than a proxy shim. That is the only configuration where your code never leaves your hardware — and the one with a cost profile nothing else on this page shares. See below.

Running models locally: the part that is glossed over

“Supports Ollama” is often read as “free models”. What it actually means is that inference moves onto hardware you pay for, and that hardware is in a completely different class from what the agent needs.

For scale: we measured the agents themselves on a 1 vCPU / 1 GB server — OpenClaw settles at 278 MB, Hermes at 120 MB, and Claude Code and Codex leave nothing resident between sessions. A useful local coding model needs orders of magnitude more memory than that, and realistically a GPU. The agent is the cheap part by a very wide margin.

So local models are the right answer when the requirement is that code must not leave your infrastructure. They are usually the wrong answer if the goal was to save money.

Where the money actually goes

People optimise the server and ignore the tokens, which is backwards. The agent runs on the cheapest tier we provision. Token spend on real work is the dominant line, and it scales with how much you use the thing.

Two levers are worth more than any server decision:

  • Tier your models. A cheaper, faster model for routine edits and a stronger one for hard problems is the single biggest saving available — and an agent from tier 2 or 3 above lets you make that switch at all.
  • Watch the context. Long sessions re-send accumulated context. Starting fresh on an unrelated task is free and frequently overlooked.

We deliberately publish no per-token price table here. Provider pricing changes faster than we could keep a page honest, and a stale price presented as current is worse than no price at all. Check the provider’s own pricing page — that one is always right.

What this page will not tell you

Which model writes the best code. We have not benchmarked that, and the honest position is that published coding benchmarks move constantly, disagree with each other, and rarely resemble your codebase. Anyone giving you a confident permanent ranking is selling something.

What we can tell you is which models each agent is able to reach, because that is a documented fact rather than an opinion — and it is the constraint that decides the question first anyway. If you want to compare quality, pick an agent from tier 2 or 3, try two models on your own work for an afternoon, and trust that over any leaderboard.

Related