Aider
Run aider against your own endpoint (vLLM, llama.cpp, Ollama, a LiteLLM or llama-swap gateway) with the right model prefix, safe key handling, a suitable edit format and a verified endpoint.
Scope: the Aider CLI, its YAML, .env and model settings files. Gateways and engines belong to their own skills. Aider talks to models through the LiteLLM client library, so a model name is <provider>/<name>; for any OpenAI-compatible server the provider is openai.
Work through the steps in order. Load a reference only when a step names it.
Discover first
Read-only. Never print keys.
command -v aider && aider --version
ls -l ~/.aider.conf.yml .aider.conf.yml .env ~/.env .aider.model.settings.yml .aider.model.metadata.json 2>/dev/null
env | grep -E '^(OPENAI|ANTHROPIC|OLLAMA|AIDER|LITELLM)_' | sed -E 's/=.*/=<set>/'
Decision flow
- OpenAI-compatible endpoint (vLLM, llama.cpp, llama-swap, LiteLLM, many others):
OPENAI_API_BASE plus --model openai/<served-name>. -> references/custom-endpoints.md
- Ollama:
OLLAMA_API_BASE plus --model ollama_chat/<model>, and fix the context window. -> references/custom-endpoints.md
- Anthropic-format endpoint:
anthropic/<name> with ANTHROPIC_API_BASE (LiteLLM behavior, not documented by aider). -> references/custom-endpoints.md
- Context window, costs, edit format, weak and editor models, reasoning: ->
references/models-and-limits.md
- Edits fail or garble, streaming, tools, reasoning tags: ->
references/compatibility.md
- Install or update: ->
references/install-and-update.md
- Error text: ->
references/troubleshooting.md
Rules
- Ask before changing the system. Installs, editing config files, shell profile exports and exposing a gateway need approval and an undo path (copy the file first).
- Secrets never touch output or git. Keys go in a
0600 .env or the environment; .env stays in .gitignore. Do not use --api-key on the command line (it lands in shell history and ps). Check presence with [ -n "${VAR:-}" ], never echo.
- Prefix the model.
openai/<served-name> for OpenAI-compatible endpoints, ollama_chat/ (not ollama/) for Ollama. A bare name selects a built-in provider.
- Only OpenAI and Anthropic keys go in the YAML. Other provider keys belong in
.env or the environment.
- Aider never enforces token limits. The "unknown context window" warning is usually harmless; real limits are enforced by the server, and Ollama's small default window silently truncates.
- Match the edit format to the model. Small local models often need
whole; set it per model in .aider.model.settings.yml.
- Test the endpoint first.
scripts/check-endpoint.sh before blaming Aider.
- Verify upstream. Flags and defaults come from the aider docs and PyPI release read on the writing date.
Workflows
Connect to a self-hosted endpoint
Fix a broken local setup
Reference index
| File |
Read when |
references/custom-endpoints.md |
Base URLs, prefixes, keys, headers, per-engine setup |
references/models-and-limits.md |
Model metadata, model settings, weak and editor models, reasoning |
references/compatibility.md |
Edit formats, streaming, tool calls, reasoning tags, engine caveats |
references/install-and-update.md |
Install paths, upgrading, config file locations |
references/troubleshooting.md |
Symptom to cause to fix |
references/combos/litellm-gateway.md |
LiteLLM in front of local engines |
Templates: templates/aider.conf.yml, templates/env.example, templates/aider.model.settings.yml, templates/aider.model.metadata.json. Script: scripts/check-endpoint.sh (probes a chat completions endpoint, prints status codes only).
Companion skills
Install any with npx skills add ScaleDockHQ/llm-skills --skill <name>.
litellm: one gateway for several engines.
llm-gateway: whether to use a gateway and which one.
vllm, llama-cpp, ollama, llama-swap: the endpoints Aider talks to.
llm-clients: other clients (IDEs, chat UIs, SDKs).
1---2name: aider3description: Aider, the terminal AI pair-programming tool (aider-chat, `aider`), pointed at self-hosted or gateway models through LiteLLM-style model names. Use to install or upgrade aider, set OPENAI_API_BASE with the `openai/` prefix, `ollama_chat/` or ANTHROPIC_API_BASE for vLLM, llama.cpp, Ollama, LiteLLM or llama-swap, keep keys in .env, fix edit formats, context limits, unknown-model warnings. Not Claude Code, Codex, OpenCode.4license: MIT5compatibility: Needs bash, curl and jq for the check script, Python tooling for aider, and an endpoint serving OpenAI chat completions (or Anthropic or Ollama APIs). Installs, upgrades, config edits and exposing a gateway need the user's explicit approval.6metadata:7 source: https://skillmd.com/skills/scaledockhq/aider8 author: ScaleDockHQ9 version: "0.1.0"10---1112# Aider1314Run `aider` against your own endpoint (vLLM, llama.cpp, Ollama, a LiteLLM or llama-swap gateway) with the right model prefix, safe key handling, a suitable edit format and a verified endpoint.1516**Scope:** the Aider CLI, its YAML, `.env` and model settings files. Gateways and engines belong to their own skills. Aider talks to models through the LiteLLM client library, so a model name is `<provider>/<name>`; for any OpenAI-compatible server the provider is `openai`.1718Work through the steps in order. Load a reference only when a step names it.1920## Discover first2122Read-only. Never print keys.2324```bash25command -v aider && aider --version26ls -l ~/.aider.conf.yml .aider.conf.yml .env ~/.env .aider.model.settings.yml .aider.model.metadata.json 2>/dev/null27env | grep -E '^(OPENAI|ANTHROPIC|OLLAMA|AIDER|LITELLM)_' | sed -E 's/=.*/=<set>/'28```2930## Decision flow31321. **OpenAI-compatible endpoint** (vLLM, llama.cpp, llama-swap, LiteLLM, many others): `OPENAI_API_BASE` plus `--model openai/<served-name>`. -> `references/custom-endpoints.md`332. **Ollama:** `OLLAMA_API_BASE` plus `--model ollama_chat/<model>`, and fix the context window. -> `references/custom-endpoints.md`343. **Anthropic-format endpoint:** `anthropic/<name>` with `ANTHROPIC_API_BASE` (LiteLLM behavior, not documented by aider). -> `references/custom-endpoints.md`354. **Context window, costs, edit format, weak and editor models, reasoning:** -> `references/models-and-limits.md`365. **Edits fail or garble, streaming, tools, reasoning tags:** -> `references/compatibility.md`376. **Install or update:** -> `references/install-and-update.md`387. **Error text:** -> `references/troubleshooting.md`3940## Rules4142- **Ask before changing the system.** Installs, editing config files, shell profile exports and exposing a gateway need approval and an undo path (copy the file first).43- **Secrets never touch output or git.** Keys go in a `0600` `.env` or the environment; `.env` stays in `.gitignore`. Do not use `--api-key` on the command line (it lands in shell history and `ps`). Check presence with `[ -n "${VAR:-}" ]`, never `echo`.44- **Prefix the model.** `openai/<served-name>` for OpenAI-compatible endpoints, `ollama_chat/` (not `ollama/`) for Ollama. A bare name selects a built-in provider.45- **Only OpenAI and Anthropic keys go in the YAML.** Other provider keys belong in `.env` or the environment.46- **Aider never enforces token limits.** The "unknown context window" warning is usually harmless; real limits are enforced by the server, and Ollama's small default window silently truncates.47- **Match the edit format to the model.** Small local models often need `whole`; set it per model in `.aider.model.settings.yml`.48- **Test the endpoint first.** `scripts/check-endpoint.sh` before blaming Aider.49- **Verify upstream.** Flags and defaults come from the aider docs and PyPI release read on the writing date.5051## Workflows5253### Connect to a self-hosted endpoint5455- [ ] Run discovery; back up existing config files.56- [ ] Put the key in a `0600` file and export it: `export OPENAI_API_KEY="$(cat ~/.config/llm/key)"` (any non-empty value for keyless servers).57- [ ] `CHECK_BASE_URL=http://HOST:PORT/v1 CHECK_MODEL=<served-name> scripts/check-endpoint.sh` returns ok.58- [ ] Copy `templates/aider.conf.yml` and `templates/env.example` (as `.env`); add model settings and metadata from `templates/` for the served model.59- [ ] `aider --model openai/<served-name>`, ask for a one-file edit, check `/tokens`.6061### Fix a broken local setup6263- [ ] Auth, 404 or model errors: `references/troubleshooting.md`.64- [ ] Bad or empty edits: `references/compatibility.md` (edit formats), then `references/models-and-limits.md` (context).6566## Reference index6768| File | Read when |69| -------------------------------------- | ------------------------------------------------------------------- |70| `references/custom-endpoints.md` | Base URLs, prefixes, keys, headers, per-engine setup |71| `references/models-and-limits.md` | Model metadata, model settings, weak and editor models, reasoning |72| `references/compatibility.md` | Edit formats, streaming, tool calls, reasoning tags, engine caveats |73| `references/install-and-update.md` | Install paths, upgrading, config file locations |74| `references/troubleshooting.md` | Symptom to cause to fix |75| `references/combos/litellm-gateway.md` | LiteLLM in front of local engines |7677Templates: `templates/aider.conf.yml`, `templates/env.example`, `templates/aider.model.settings.yml`, `templates/aider.model.metadata.json`. Script: `scripts/check-endpoint.sh` (probes a chat completions endpoint, prints status codes only).7879## Companion skills8081Install any with `npx skills add ScaleDockHQ/llm-skills --skill <name>`.8283- `litellm`: one gateway for several engines.84- `llm-gateway`: whether to use a gateway and which one.85- `vllm`, `llama-cpp`, `ollama`, `llama-swap`: the endpoints Aider talks to.86- `llm-clients`: other clients (IDEs, chat UIs, SDKs).