Setup guide - Documented by Aider
Use Ollama in Aider
Aider connects to Ollama natively: set OLLAMA_API_BASE to the local server and run aider --model ollama_chat/<model>.
Last verified 6 steps3 official sources
Steps
- Step 1.
Configure your Ollama API endpoint (Mac/Linux).
Terminalexport OLLAMA_API_BASE=http://127.0.0.1:11434 # Mac/Linux - Step 2.
Windows (restart shell after setx).
Terminalsetx OLLAMA_API_BASE http://127.0.0.1:11434 # Windows, restart shell after setx - Step 3.
Pull the model, start the Ollama server with a larger context window, and run aider from your project.
Terminal# Pull the model ollama pull <model> # Start your ollama server, increasing the context window to 8k tokens OLLAMA_CONTEXT_LENGTH=8192 ollama serve # In another terminal window, change directory into your codebase cd /to/your/project aider --model ollama_chat/<model> - Step 4.
Example with a current Ollama model id.
Terminalaider --model ollama_chat/qwen3.5 - Step 5.
If your Ollama requires an API key.
Terminalexport OLLAMA_API_KEY=<api-key> # Mac/Linux - Step 6.
Optional fixed context window via .aider.model.settings.yml.
YAML- name: ollama/qwen2.5-coder:32b-instruct-fp16 extra_params: num_ctx: 65536
Caveats
- Ollama's docs have no Aider page; steps come from Aider's docs, which use a <model> placeholder. The qwen3.5 example id comes from Ollama's integration docs and is combined here.
- Aider recommends the ollama_chat/ prefix over ollama/.
- Aider's page says Ollama uses a 2k context window by default, but Ollama's current docs say the default depends on VRAM (4k under 24 GiB, 32k at 24-48 GiB, 256k at 48 GiB or more). Aider sizes num_ctx per request by default anyway.
- Aider prints model warnings for models it does not know.
More setup guides
Same tool, other providers
Related reading
- Ollama Decision Models: Run Nimble Locally with --askOllama 0.40.4 runs decision models locally: ollama run nimble --ask answers yes/no, label and score questions with probabilities. Commands and limits.
- Ollama 0.40 on Mac: MLX by Default, Disk Space DoubledOllama 0.40 runs supported models on MLX on Apple Silicon and keeps a backup copy of each model you load. What it costs in disk, what is fixed, and the cleanup.
- GitHub Copilot CLI With Ollama: Local Models and the New SandboxCopilot CLI 1.0.94 finds local Ollama models from /model and ships an OS-level sandbox. Setup, the 4k context trap, and why local is not offline.
- Hermes Agent Guide (2026): What It Is, Local Setup With Ollama, Skills, and Hermes vs OpenClawHermes Agent is Nous Research's open-source, self-improving AI agent. Run it locally with Ollama, see how its skills system works, and compare it with OpenClaw.
- What Is OpenClaw? Setup, Skills, MCP Server, Claude Code, and Ollama (2026 Guide)What is OpenClaw? A self-hosted personal AI agent you reach through chat apps. Install, skills and ClawHub, its MCP server, Claude Code use, and Ollama models.
- GitHub Copilot for JetBrains Gains Persistent Memory and Ollama BYOKGitHub Copilot for JetBrains adds memory across chat sessions, Ollama as a BYOK provider, and enterprise settings for MCP access. What each feature does.
FAQ
How do I use Ollama in Aider?
Aider connects to Ollama natively: set OLLAMA_API_BASE to the local server and run aider --model ollama_chat/<model>.
Which Ollama model ids work in Aider?
The official docs read for this guide list qwen3.5 and qwen2.5-coder:32b-instruct-fp16. Requests go to http://127.0.0.1:11434.
Is this an official Ollama and Aider setup?
Aider documents this setup in its own docs. It was last checked against 3 official pages on October 17, 2026.
Sources
Last verified against 3 official pages.
- raw.githubusercontent.comhttps://raw.githubusercontent.com/Aider-AI/aider/main/aider/website/docs/llms/ollama.md
- aider.chathttps://aider.chat/docs/llms/ollama.html
- raw.githubusercontent.comhttps://raw.githubusercontent.com/ollama/ollama/main/docs/context-length.mdx
Newsletter
New models, set up the day they ship
One email per week. New model releases, the coding tools that support them and how to wire them up.