Connect Aider to OpenLLM Buddy
Use Aider with OpenLLM Buddy. Set the OpenAI-compatible base URL and key with flags, environment variables, or .aider.conf.yml.
Coding · Integration guide
What is Aider?
Aider is a terminal-based AI pair programmer that reads your repository, edits files, and commits each change to git. Visit Aider.
Why connect OpenLLM Buddy?
Aider works with any OpenAI-compatible server. Prefixing the model with openai/ routes it to your OpenLLM Buddy base URL.
Before you start, create an API key in the console and deploy a model. If anything fails, run the curl test in Step 4 first: no tool can fix a broken endpoint.
Install Aider
Install with the official installer, which keeps Aider in its own environment.
python -m pip install aider-install aider-install
Run with your endpoint
From inside a git repository, pass the base URL, key, and the model with the openai/ prefix.
cd your-project aider \ --openai-api-base https://openllmbuddy-proxy.botbuddytech.workers.dev/v1 \ --openai-api-key YOUR_API_KEY \ --model openai/gemma4:26b
Save the settings
Put the same values in .aider.conf.yml in your repo or home folder so you can just type aider.
openai-api-base: https://openllmbuddy-proxy.botbuddytech.workers.dev/v1 openai-api-key: YOUR_API_KEY model: openai/gemma4:26b
Prefer environment variables for the key: OPENAI_API_BASE and OPENAI_API_KEY. Keep a .aider.conf.yml that contains a key out of version control.
Test the endpoint with curl
Confirm the key, URL, and model id work before debugging Aider. A short JSON reply means the endpoint is healthy.
curl -sS https://openllmbuddy-proxy.botbuddytech.workers.dev/v1/chat/completions -H "Authorization: Bearer YOUR_API_KEY" -H "Content-Type: application/json" -d '{"model": "gemma4:26b", "messages": [{"role": "user", "content": "Reply with OK"}], "max_tokens": 16}'Troubleshooting
- Unknown model warning — Aider does not know the context window of custom models. It still works; add a .aider.model.metadata.json entry to silence the warning.
- Bad edits — smaller models struggle with Aider's diff formats. Try --edit-format whole or a larger model.
- 401 or 403 — the API key is wrong, revoked, or missing the Bearer prefix. Create a fresh key in the console.
- 404 on /chat/completions — the base URL must end in /v1, with no trailing /chat/completions and no extra path.
- Model not found — the model id must match your deployment exactly. Run the curl test and copy the id you used.
- Timeouts on the first request — a GPU that was idle may still be loading the model. Retry after a minute.
- Connection refused from Docker or a remote host — use the public HTTPS base URL, never localhost.
Connection details
Use these values wherever Aider asks for an OpenAI-compatible provider.
Base URL: https://openllmbuddy-proxy.botbuddytech.workers.dev/v1 Chat URL: https://openllmbuddy-proxy.botbuddytech.workers.dev/v1/chat/completions API key: your key from the console Model id: gemma4:26b