Aider is a terminal pair programmer: you add files to the chat, describe a change, and it edits the files and commits the result to git. It is model-agnostic, which is its strength and its first question. Which model should you plug in?
There is no single right answer, but there is a right way to decide. This post covers what Aider actually asks of a model, how to compare candidates, and how to connect any OpenAI-compatible API in two environment variables.
What does Aider need from a model?
Aider does not use API tool calling to edit files. It tells the model to reply in an edit format, then parses the reply and applies it. Its documentation lists several:
| Edit format | What the model returns | Good for |
|---|---|---|
whole |
The full new contents of each changed file | Small files, weaker models |
diff |
Search-and-replace blocks for the changed parts | Most models, most repos |
diff-fenced |
The same, with the file path inside the fence | Models that misplace paths |
udiff |
A simplified unified diff | Models that drift in diff |
So a good Aider model needs four things:
- Format discipline. If the search block does not match the file exactly, the edit fails and Aider asks again. Every retry is another full request.
- Context room. Aider sends a repository map (a compact summary of symbols across the repo), the files you added and the chat so far. On a large codebase that is tens of thousands of tokens per turn.
- Reasoning that fits the budget. Reasoning models think before answering, and that thinking counts toward
max_tokens. Too small a limit gives an empty reply. - A price you can leave running. Aider is chatty by design. Cost per hour of real work matters more than cost per token on a pricing page.
Aider’s own leaderboards measure how often models complete coding exercises in its edit formats. They are a useful first filter, but your repository, language and habits will move the result. Treat any benchmark as a shortlist, not a verdict.
How do you compare models on your own code?
A practical test takes about an hour:
- Pick five real tasks from your backlog: a bug fix, a small feature, a refactor across two files, a test to write and a doc update.
- Run each candidate model on the same tasks from the same git commit, with one branch per model.
- Record three things per task: did it finish, how many turns did it take, and how many edits failed to apply.
- Read the diffs. A model that “finishes” with a sprawling change is worse than one that needs one more turn but stays small.
Failed edits and extra turns are where cost hides. A model with a low per-token price that needs three attempts per edit can cost more than a pricier one that gets it right first time.
How do you connect Aider to an OpenAI-compatible API?
Aider’s OpenAI-compatible setup needs a base URL, a key, and a model name prefixed with openai/:
export OPENAI_API_BASE=https://inference.broadnet.ai/v1
export OPENAI_API_KEY="$BROADNET_API_KEY"
cd /path/to/your/repo
aider --model openai/broadnet/deepseek-v4.1-flash
The openai/ prefix tells Aider (through LiteLLM) to use the OpenAI wire format against your base URL. Everything after the prefix is the provider’s model ID, slash included. The step-by-step version, including Windows, is in the Aider guide.
To make it permanent, put the same settings in .aider.conf.yml in your home directory or repo root:
openai-api-base: https://inference.broadnet.ai/v1
model: openai/broadnet/deepseek-v4.1-flash
Keep the key in the environment rather than in a file you might commit.
Silencing the unknown-model warning
Aider knows context sizes and prices for popular models only. For others it prints a warning. Its docs say you can usually ignore it, because Aider “never enforces token limits”; it only reports the provider’s errors. To give it accurate numbers, add .aider.model.metadata.json in your home directory, repo root or launch directory:
{
"openai/broadnet/deepseek-v4.1-flash": {
"max_input_tokens": 1048576,
"max_output_tokens": 32000,
"litellm_provider": "openai",
"mode": "chat"
}
}
The output figure there is a setting you choose, not a published limit. Leave room for reasoning.
Which BroadNet models fit Aider?
BroadNet Inference serves three chat models that suit coding work. Prices are per 1M tokens, from the published price file:
| Model | Context | Input | Cached input | Output |
|---|---|---|---|---|
| DeepSeek V4.1 Flash | 1,048,576 | $0.175 | $0.0055 | $0.52 |
| GLM 5.3 | 1,048,576 | $0.78 | $0.173 | $3.46 |
| Qwen3.8 27B | 262,144 | $0.175 | $0.0435 | $2.17 |
All three reason before they answer. BroadNet Gemma 4 VL 26B has a 32,768-token context, which is tight for Aider’s repo map plus several files, so it is better kept for lighter jobs.
DeepSeek V4.1 Flash is the default choice here for a plain reason: it is the only model on BroadNet’s unlimited plans. A Full Moon session costs $60 a month with no token meter, and Aider’s habit of resending context every turn stops being a cost problem. Its 1M-token window also means you can add more files than usual without trimming.
GLM 5.3 costs more per output token. It is worth trying on pay-as-you-go as an architect model for hard design steps, where quality per turn matters more than volume.
Qwen3.8 27B has the same input price as Flash and a 262K context. It is a reasonable second model if you want to compare behaviour on your codebase.
Should you use architect mode with two models?
Aider’s architect mode splits a turn in two: an architect model plans the change, and an editor model turns the plan into file edits. That lets you pair a stronger reasoning model with a cheaper, format-reliable editor:
aider --architect \
--model openai/broadnet/glm-5.3 \
--editor-model openai/broadnet/deepseek-v4.1-flash
Aider’s docs note that each turn now uses two LLM requests. On a plan session that matters for concurrency, not cost: the two requests run one after another, so one session is enough for one Aider window.
Is Aider cheaper per token or on a flat plan?
Aider’s input-heavy traffic is where flat pricing pays off. A coding agent typically sends far more input than it receives, and much of that input repeats. With prompt caching, repeated input is billed at the cached rate ($0.0055 per 1M on Flash), so the first lever on a per-token key is a stable prompt prefix. How cached input is billed.
The second lever is the plan. BroadNet’s worked example of a full-time coding agent comes to about $65.40 a month on pay-as-you-go, against $60 for a Full Moon session, so Full Moon is cheaper for that profile. Light, occasional use is the opposite case. Plug your own numbers into the flat-rate vs per-token calculator, or read flat rate vs pay per token. For more cost levers that apply to any coding agent, see 10 ways to cut coding agent LLM costs.
Which Aider settings save turns?
- Leave room for reasoning. If Aider gets an empty reply, the model spent its output budget thinking. Why answers come back empty.
- Add only the files that change. Aider’s repo map already tells the model where things are. Extra files cost context and attention.
- Use
/clearbetween unrelated tasks. Old chat history is input on every turn. - Keep auto-commits on. Each Aider edit becomes a git commit, so
/undois one command away when a model goes wrong. - One window per session. Two Aider windows on one plan session take turns. Buy a second session if you work in two repos at once; see running parallel coding agents.
How do you test a model before you commit?
The cheapest test is a Meteor hour at $1: unlimited DeepSeek V4.1 Flash for one hour, enough to run the five-task comparison above. New accounts also get $5 of starting credit, but among the chat models it covers only BroadNet Gemma 4 VL 26B; DeepSeek V4.1 Flash, GLM 5.3 and Qwen3.8 27B need a top-up or a plan. All models are listed on the models page. If you are still choosing between agents rather than models, read Cline vs Roo Code vs Aider.
