Terminal AI Coding (Aider + Ollama)

Aider + Ollama = Claude Code/Cursor alternative in your terminal. Git-aware, auto-commits, works with any local model. Your code never leaves your machine.

The short answer

Terminal AI Coding (Aider + Ollama) is a local AI stack for AI pair programming in your terminal with local models, fully private. Aider + Ollama = Claude Code/Cursor alternative in your terminal. Git-aware, auto-commits, works with any local model. Your code never leaves your machine. It combines 6 components, is rated intermediate, and takes about 10 minutes to set up. Expect around $800 in hardware and $0/month versus cloud.

Cost
~$800
$0/mo vs cloud
Difficulty
intermediate
Setup time
~10 min
Use case
AI pair programming in your terminal with local models, fully private

~$800 hardware · $0/mo vs cloud

Terminal AI Coding (Aider + Ollama)

AI pair programming in your terminal, entirely local. Aider is an open-source terminal-based AI coding assistant (44K+ GitHub stars) that edits files directly in your repo, creates sensible git commits, and works with any LLM. Connect it to Ollama for local inference, and you get a fully private alternative to Claude Code, Cursor, or GitHub Copilot.

What you get

  • AI code edits in your terminal - describe a change, Aider edits your files
  • Git-native - auto-commits with sensible messages, easy to diff/undo
  • Codebase-aware - maps your entire project for context-aware changes
  • 100+ languages - Python, JS, Rust, Go, C++, and everything else
  • Lint + test integration - auto-fix issues found by your linters
  • Fully private - all inference runs on your GPU, zero data leaves your machine
  • $0/month - no API costs, no per-seat licenses

Architecture

ComponentRole
AiderTerminal AI coding assistant (CLI tool)
OllamaServes the coding model locally
Qwen3 Coder 30B A3BFast MoE coding model - 3B active params

For most users, Qwen2.5 Coder 14B is a great fit on a 24GB card. For faster responses, the Qwen3 Coder 30B A3B MoE model uses only 3B active parameters per token. Recommended GPU: RTX 3090 (best value 24GB) or RTX 4090.

Prerequisites

  • Python 3.9+
  • Ollama installed and running
  • A coding model pulled in Ollama
  • Git initialized in your project

Setup

Step 1: Install Aider

python -m pip install aider-install
aider-install

Step 2: Pull a Coding Model

ollama pull qwen2.5-coder:14b

Step 3: Start Ollama with Larger Context

Ollama defaults to 2K context window, which is too small for coding. Start it with 8K+:

OLLAMA_CONTEXT_LENGTH=8192 ollama serve

Step 4: Start Coding

cd /your/project
aider --model ollama_chat/qwen2.5-coder:14b

Aider will analyze your repo structure, create a git commit if needed, and present you with a chat prompt. Describe what you want to build or change.

Use it

Add a Feature

> Add a rate limiter to the API endpoint using a decorator pattern

Aider reads your codebase, finds the right files, and makes the edit. It then shows you the diff and asks if you want to commit.

Fix a Bug

> The login endpoint throws a 500 when the email field is empty. Fix it.

Aider finds the handler, adds validation, and commits the fix.

Refactor Code

> Extract the database logic from views.py into a separate repository layer

Aider creates the new file, updates imports, and moves the code.

Write Tests

> Write pytest tests for the user registration flow

Aider generates tests based on your existing code patterns.

Cost vs cloud

Local Aider + OllamaCursor / Claude Code
Monthly$0$20-100
Hardware~$800 once (3090)$0
Code privacyNever leaves youUploaded to vendor
Model choiceAny local modelLimited providers
Git workflowAuto-commit + diffManual or limited

For a solo dev, the 3090 pays for itself in about 8 months vs Cursor Pro. For teams under IP/compliance restrictions, it's the only option that works.

Troubleshooting

  • Aider can't connect to Ollama → Make sure ollama serve is running. Set OLLAMA_API_BASE=http://127.0.0.1:11434.
  • Context too small → Always start Ollama with OLLAMA_CONTEXT_LENGTH=8192 or higher. Aider will also warn if the window is too small.
  • Slow responses → Use a smaller quant (Q4_K_M) or a coding-specific model. The MoE Qwen3 Coder 30B A3B is fastest for its size.
  • Model warnings → Aider shows warnings for unfamiliar models. You can suppress them by adding an .aider.model.settings.yml file.
  • Aider won't install → Make sure pip is up to date: python -m pip install --upgrade pip.

Swap components

Frequently asked

What is the Terminal AI Coding (Aider + Ollama) stack for?

Aider + Ollama = Claude Code/Cursor alternative in your terminal. Git-aware, auto-commits, works with any local model. Your code never leaves your machine. It is purpose-built for AI pair programming in your terminal with local models, fully private and runs entirely on your own hardware.

How much does the Terminal AI Coding (Aider + Ollama) stack cost?

Terminal AI Coding (Aider + Ollama) costs around $800 in hardware up front and $0/month to run, since everything is self-hosted — no per-token or subscription fees versus a cloud equivalent.

How long does it take to set up Terminal AI Coding (Aider + Ollama)?

Plan for roughly 10 minutes. The stack is rated intermediate.

What do I need to run Terminal AI Coding (Aider + Ollama)?

Terminal AI Coding (Aider + Ollama) is built from 2 tool(s), 2 model(s), 2 hardware item(s). Each is listed below with a link.