Aider with a local model: setup for Ollama, LM Studio or llama.cpp
Aider is an open-source (Apache-2.0) AI pair-programming tool for the terminal that edits files with text edit formats rather than native tool calls. It works with Ollama, LM Studio and any OpenAI-compatible server; development has slowed, with the last PyPI release (0.86.2) on 2026-02-12.
At a glance
- Type
- cli
- Licence
- Apache-2.0
- Latest release
- 0.86.2 (2026-02-12)
- Status
- No release since 2026-02-12
- Local backends
- ollama, openai-compatible
- Needs native tool calling
- No
- MCP support
- Not verified
- Recommended minimum context
- Not stated in its docs
- Start-up prompt
- Not measured
- GitHub stars
- 49.6k (2026-10-19)
How to set it up with a local model
Pick your backend. Each command has its own Copy button. Where a step uses an example model, swap in the one you run; the table below lists the ones that fit your machine.
Install it (macOS / Linux):
curl -LsSf https://aider.chat/install.sh | shPoint aider at your Ollama server.
export OLLAMA_API_BASE=http://127.0.0.1:11434Pull a model (replace qwen3-coder:30b with any model you prefer).
ollama pull qwen3-coder:30bStart Ollama; aider's docs use an 8k default context here because aider sizes num_ctx per request itself.
OLLAMA_CONTEXT_LENGTH=8192 ollama serveIn another terminal, run aider from your project with the ollama_chat/ prefix.
aider --model ollama_chat/qwen3-coder:30bOptional: pin a fixed context window instead of aider's per-request sizing.
.aider.model.settings.yml- name: ollama_chat/qwen3-coder:30b extra_params: num_ctx: 65536
Other ways to install
pip
python -m pip install aider-install && aider-installuv
uv tool install --force --python python3.12 --with pip aider-chat@latestCheck that it works
Start aider in a git repository and ask it to describe one file. With Ollama, `ollama ps` shows the context aider requested.
ollama psWhich local models fit, by machine
Checked by this site's engine at the context Aider needs, with 32 GB of system RAM for MoE offload. A Mac counts three quarters of unified memory as usable.
| Machine | Model | Quant | Context | Fit | Ollama |
|---|---|---|---|---|---|
| 12 GB GPU | Qwen 3.5 9B | Q4_K_M | 32,768 | Comfortable (7.4 GB of 12 GB) | qwen3.5:9b |
| Qwen 3.6 35B-A3B | Q4_K_M | 32,768 | With CPU offload (MoE) (22.7 GB of 12 GB) | qwen3.6:35b-a3b | |
| 16 GB GPU | Qwen 3.5 9B | Q4_K_M | 32,768 | Comfortable (7.4 GB of 16 GB) | qwen3.5:9b |
| Qwen 3.6 35B-A3B | Q4_K_M | 32,768 | With CPU offload (MoE) (22.7 GB of 16 GB) | qwen3.6:35b-a3b | |
| 24 GB GPU | Qwen3.8 27B | Q4_K_M | 32,768 | Comfortable (19.9 GB of 24 GB) | qwen3.8:27b |
| Qwen 3.6 27B | Q4_K_M | 32,768 | Comfortable (19.9 GB of 24 GB) | qwen3.6:27b | |
| Devstral Small 2 24B | Q4_K_M | 32,768 | Comfortable (20.7 GB of 24 GB) | devstral-small-2:24b | |
| Qwen 3.6 35B-A3B | Q4_K_M | 65,536 | Tight (23.3 GB of 24 GB) | qwen3.6:35b-a3b | |
| 32 GB GPU | Qwen3.8 27B | Q4_K_M | 32,768 | Comfortable (19.9 GB of 32 GB) | qwen3.8:27b |
| Qwen 3.6 27B | Q4_K_M | 32,768 | Comfortable (19.9 GB of 32 GB) | qwen3.6:27b | |
| Devstral Small 2 24B | Q4_K_M | 32,768 | Comfortable (20.7 GB of 32 GB) | devstral-small-2:24b | |
| Qwen 3.6 35B-A3B | Q4_K_M | 65,536 | Comfortable (23.3 GB of 32 GB) | qwen3.6:35b-a3b | |
| Qwen3-Coder 30B-A3B (MoE) | Q4_K_M | 65,536 | Comfortable (25.7 GB of 32 GB) | qwen3-coder:30b | |
| Mac, 64 GB | Qwen 3.6 35B-A3B | Q8_0 | 131,072 | Comfortable (40.7 GB of 48 GB) | — |
Your exact machine: filter the matrix or check any model in the analyzer.
Common problems with local models
- Use the ollama_chat/ prefix; aider's docs recommend it over ollama/.
- Aider's docs still say Ollama defaults to a 2k window; current Ollama defaults to 4k under 24 GiB VRAM. Aider sets num_ctx per request either way, so data isn't silently dropped.
- LM Studio needs LM_STUDIO_API_KEY set to a dummy value, or requests fail with an empty Bearer token.
- Models aider doesn't know trigger model warnings; aider's docs cover what they mean.
Other coding agents
How they rank for local models: the best agent harness for local LLMs.
- OpenCode
- Qwen Code
- Codex CLI
- Cline
- Kilo Code
- Pi coding agent
- Claude Code
- Crush
- Goose
- OpenHands
- Zed agent
- GitHub Copilot BYOK
- Continue (discontinued)
- Roo Code (discontinued)
- Void (discontinued)