# AI Pair Programming in Your Terminal with Aider and Ollama

> Source: <https://dev.to/everylocalai/ai-pair-programming-in-your-terminal-with-aider-and-ollama-4hdi>
> Published: 2026-06-14 22:05:39+00:00

Want an AI coding assistant that works on YOUR codebase, respects YOUR git history, and doesn't send your code to the cloud? Aider + Ollama gives you exactly that.

Aider is an AI pair programming tool that works directly in your terminal. It sees your files, understands your git repo, and makes real edits to your code. Paired with Ollama running a local model, you get a fully private coding assistant.

```
# Install Aider
pip install aider-chat

# Pull a capable coding model
ollama pull qwen3-coder:30b-a3b
```

Set Aider to use your local Ollama model:

```
# For bash/zsh
export OLLAMA_CONTEXT_LENGTH=8192

# Run Aider with Ollama
aider --model ollama_chat/qwen3-coder:30b-a3b --editor
```

For persistent config, create `.env`

in your project:

```
OLLAMA_CONTEXT_LENGTH=8192
AIDER_MODEL=ollama_chat/qwen3-coder:30b-a3b
# Start Aider in your project directory
cd my-project
aider --model ollama_chat/qwen3-coder:30b-a3b

# Now just describe what you want:
# "Add error handling to the API routes"
# "Refactor the database connection into a singleton"
# "Write unit tests for the user service"
```

Aider reads your files, makes changes, and commits them with sensible messages. You approve each change before it's applied.

On a **RTX 4090** with Qwen3 Coder 30B at Q4: ~15-20 tok/s, enough for real-time code suggestions.

Qwen2.5 Coder 14B runs faster (~35 tok/s) and fits on a 12GB GPU, great for smaller projects.

*Originally published on everylocalai.com*
