Install Aider
python -m pip install aider-install aider-installaider-installsets Aider up in its own isolated environment, so it won't clash with your other Python packages.Tell Aider where Ollama is
On macOS or Linux:
export OLLAMA_API_BASE=http://127.0.0.1:11434On Windows (restart the shell afterwards):
setx OLLAMA_API_BASE http://127.0.0.1:11434Pull a coding model and start Ollama with more context
ollama pull qwen3-coder:30b OLLAMA_CONTEXT_LENGTH=8192 ollama serveLeave that terminal running. On a 12–16 GB card, pick a smaller coding model from the Ollama library instead.
Aider's docs say it sizes Ollama's context window for each request (your request plus 8K tokens for the reply), so files aren't silently cut off. You can pin a fixed size instead with a settings file (see troubleshooting).
Start Aider in your project
In a second terminal:
cd /to/your/project aider --model ollama_chat/qwen3-coder:30bAider recommends the
ollama_chat/prefix overollama/. It may print warnings about models it doesn't know; the Aider docs explain these and they're usually safe to ignore.Aider writes changes to your files and commits them to git. Work on a branch, and review with
git diffor/undoinside Aider if a change is wrong.Verify it works
CheckAdd a file to the chat and ask for a small, checkable change:
/add README.md Add a one-line "Requirements" section that says Python 3.10 or newer.Aider should show a diff, apply it, and make a commit. Confirm with:
git log --oneline -1The latest commit should be Aider's, describing the README change.
Troubleshooting
Check that
ollama serveis running and thatcurl http://127.0.0.1:11434replies "Ollama is running". On Windows, open a new terminal aftersetxso the variable is loaded.Smaller and heavily quantized models struggle with Aider's edit formats. Try a larger model, or a higher-precision tag. Model choice matters more here than in plain chat.
Create
.aider.model.settings.ymlin your project or home directory. The Aider docs give this shape (use your model's name):- name: ollama/qwen2.5-coder:32b-instruct-fp16 extra_params: num_ctx: 65536A larger
num_ctxneeds more memory for the KV cache.Continue brings the same local model into VS Code or JetBrains: autocomplete, chat and edits. Its docs have a dedicated Ollama guide.