Aider + Ollama: code in the terminal with a 100% agent local
Aider is a coding assistant that lives in your terminal, next to your Git repository. You describe a change in French, it reads the right files, writes the patch, and automatically commits the result. Connected to Ollama, everything happens on your machine: no code is sent to the cloud. This guide provides a reproducible end-to-end setup—pip installation, a config file pointing to Ollama’s OpenAI-compatible endpoint, model selection based on your VRAM, and the commands that really matter (/add, /architect, /diff). It ends with an honest look at the limitations of local models compared with a cloud model, so you know when local is enough and when it falls short.
#Why use Aider in the terminal
Where Cline or Continue live in VS Code, Aider embraces the terminal. You stay in your shell, at the root of your Git repository, and converse with the model as if it were a colleague with access to the code. It is a different workflow, closer to the command line, that appeals to people who live in tmux and do not like leaving the keyboard.
- Git-focused
- Each accepted change becomes a clean commit with a message written by Aider. Your history stays readable, and you can undo any change with a simple git revert.
- Automatic repo map
- Aider builds a map of your repository (function signatures, classes, structure) and sends it to the model along with the open files. The model understands the context without you loading the entire project.
- Editor-agnostic
- Aider modifies files on disk. You continue using your usual editor in parallel: Aider sees your changes, and you see its changes.
- 100% local with Ollama
- Connected to Ollama, the model runs on your GPU. Your code and prompts never leave the machine, which makes all the difference for proprietary code or code covered by an NDA.
#Requirements and installation
This guide gets you to the model. The kit gets you to the coding copilot in your editor.
- Lifetime online access
- PDF + files
- Lifetime updates
Three building blocks: Python for Aider, Ollama running with a loaded coding model, and a git repository. Aider requires a git repository to work fully—it is what drives the commits.
- 01Check OllamaOllama must listen on its default port. Run ollama list to confirm that it responds and see which models are already installed.
- 02Install AiderThe recommended approach uses pipx or the official install script, which isolates Aider in its own environment to avoid Python dependency conflicts.
- 03Navigate to a git repositoryOpen a terminal at the root of a version-controlled project. If the project is not yet under git, run git init first: Aider needs it to commit its changes.
#Configure Aider for Ollama
Aider talks to Ollama through its OpenAI-compatible endpoint. Two things to configure: the base URL of Ollama (an environment variable) and the model to use. The cleanest approach is to place an .aider.conf.yml file at the project root (or in your home directory for a global setting), so you don't have to re-enter the options each time you launch it.
To avoid retyping anything, put these settings in a configuration file. Aider automatically reads an .aider.conf.yml found at the repository root or in your home directory.
#Which model for your VRAM
Aider sends a lot of context (added files + repo-map) and expects a well-formed patch in return. A model that is too small produces broken diffs that Aider cannot apply. Aim for the largest coder model your GPU can load comfortably, while leaving headroom for context.
| Available VRAM | Recommended model | Expected behavior |
|---|---|---|
| 8 GB | Qwen 3.5 9B | Simple tasks, short files. Correct diffs one file at a time (256k ctx, Apache 2.0). |
| 12 GB | Qwen 3.5 9B in Q8 | Maximum tier quality: more reliable multi-file patches, better use of the repo map. |
| 16 GB | Devstral 24B or gpt-oss 20B | Devstral (Mistral, Apache 2.0) is designed for coding agents: it follows multistep instructions more reliably. |
| 24 GB and up | Qwen3-Coder 30B-A3B | Code MoE (3B active), 256k ctx: solid, fast diffs, with reasoning close to a cloud assistant on medium-complexity tasks. |
| Versatile | GLM 4.7 Flash (MoE, MIT) | Solid alternative, very capable in agent mode if Qwen doesn’t suit you. |
#The end-to-end workflow
Here’s the typical workflow for a change, from launching Aider to committing. Once you get into this rhythm, you can chain changes together without ever leaving the terminal.
- 01Run Aider from the repository rootAider starts, reads the config, builds the repo map, and displays a prompt. It indicates the active model and the number of detected files.
- 02Add the relevant files with /addAdd only the files the task needs to modify. The fewer files in the context, the more precise the model remains. The repo-map already gives the model a view of the rest of the project.
- 03Describe the modification in FrenchType your request in natural language: “add email validation to the registration form.” Aider thinks it through, then proposes a patch.
- 04Review the proposed diffAider shows the diff before applying it. Check it. If something is wrong, reply to correct it: “non, utilise une regex plus stricte”.
- 05Let Aider commitOnce the patch is applied, Aider automatically creates a commit with a descriptive message. Your Git history stays clean, and every change is traceable.
- 06Iterate or cancelContinue with the next change. If you don't like an Aider commit, /undo cancels the last commit it created without touching anything else.
#Key commands for everyday use
Aider is controlled with slash commands in its prompt. A handful is enough to cover 90% of use cases.
- /add fichier
- Adds one or more files to the editing context. Aider will write to these files. Limit yourself to what is strictly necessary.
- /drop fichier
- Remove a file from the context. Useful when switching tasks to start with a clean context.
- /architect
- Enables plan-then-code mode: the model first reasons about the approach, then generates the diff. Ideal for nontrivial changes.
- /diff
- Displays the changes made since the last commit, so you can review what Aider changed before continuing.
- /undo
- Undo the last commit created by Aider. An immediate safety net if a change goes wrong.
- /run commande
- It runs a shell command (tests, linter) and feeds the output back into the chat. Aider can then make corrections based on the actual errors.
- /ask question
- Ask a question about the code WITHOUT triggering a modification or commit. To understand before acting.
#Local limitations compared with the cloud
Let's be honest: a local model on 8 to 16 GB doesn't match a cutting-edge cloud model. Knowing the limitations prevents frustration and helps you choose the right tool for the task.
- Sometimes malformed diffs
- Small models sometimes produce a patch that Aider cannot apply (broken format). Moving to a larger model or increasing num_ctx significantly reduces this problem.
- Shorter context
- A cloud model can handle dozens of files. Locally, keep the context tight: add only a few files at a time with /add, and rely on the repo-map instead of loading everything.
- Multi-file reasoning
- Refactors that touch many files at once remain a weak point for local models. Break them into several small tasks, or switch to /architect to structure them.
- GPU-dependent speed
- Latency depends on your card. A 32B model on a modest card will be slow. If responsiveness is the priority, a well-tuned 7B or 14B is more pleasant for everyday use.
#Frequently asked questions
Is Aider really free and 100% local with Ollama?+
Why won't Aider connect to my Ollama?+
Is a git repository required to use Aider?+
Which local model should you choose for Aider?+
What's the difference between Aider and Cline?+
Feedback, an error, or a clarification? Let us know—it improves the guide for everyone.