Skip to content

Aider

Aider is a terminal coding agent that edits files in your repo and commits the results. It talks to any OpenAI-compatible endpoint, which applies edits by having the model rewrite text, not by calling tools, so it needs nothing beyond plain chat completions.

Aider does not yet install cleanly on Python 3.14 - one of its dependencies has no wheel, and the source build fails. Use 3.12:

Terminal window
python3.12 -m venv ~/.aider-venv
~/.aider-venv/bin/pip install aider-chat
Terminal window
lean serve lean-agent-light --port 8080

Leave it running in its own terminal. The first request loads the model and warms the expert cache, so it is slower than the ones after it.

Terminal window
export OPENAI_API_BASE=http://127.0.0.1:8080/v1
export OPENAI_API_KEY=dummy
~/.aider-venv/bin/aider --model openai/lean-agent-light
  • The openai/ prefix selects Aider’s OpenAI-compatible driver. The part after it must match the model id the server reports at /v1/models.
  • OPENAI_API_KEY must be set to something, even when the server has no key configured. When lean serve was started with --api-key, use that key here.
  • No --edit-format flag is needed. Aider negotiates it, and the default is the correct one (see below).

Aider auto-selects the whole edit format for these models, where the model reproduces each edited file in full. That is the format to stay on.

The alternative, diff, asks the model to emit SEARCH/REPLACE blocks. On the 35B this does not work: the blocks fail to apply, Aider retries, and a single edit runs past ten minutes without converging. The server stays healthy throughout - this is a limit of the model’s precision at that quant, not a server bug. Do not pass --edit-format diff.

Reasoning shows up in Aider’s own THINKING panel rather than leaking into the file it is editing, because the server splits the <think> block into reasoning_content.

A typical edit on a small file is roughly 700 tokens of prompt and 150 tokens of response, which on lean-agent-light is a handful of seconds.

whole rewrites the entire file on every edit. This is workable on focused files of a few hundred lines and slow on a 2,000-line module, where every edit costs a full regeneration at local decode speed. Aider on a lean model suits work on specific files rather than a whole repository.

Remedies for slow edits: keep fewer files in the chat (/drop those not being edited), split large files, and prefer a smaller model over a larger one, since decode speed matters more here than raw capability.

Symptom Cause
Connection refused lean serve is not running, or is on a different port.
401 from the server Server started with --api-key; set OPENAI_API_KEY to that key.
Model name not found The name after openai/ must match /v1/models.
Edits never apply, requests take many minutes You are on --edit-format diff. Drop the flag.
pip install fails building a dependency You are on Python 3.14. Use 3.12.