Back to Home
Run Aider on Ollama, Bedrock, or Any LLM Provider — One Gateway, Every Model

Run Aider on Ollama, Bedrock, or Any LLM Provider — One Gateway, Every Model

B
Blizine Admin
·2 min read·0 views

Vishal VeeraReddy Posted on May 30 Run Aider on Ollama, Bedrock, or Any LLM Provider — One Gateway, Every Model # ai # tutorial # devops # opensource Aider is the best terminal AI coding tool I've used. But by default it sends every diff through your OpenAI or Anthropic key, which gets expensive fast on real refactors — a single 100-file repo map can torch a few dollars before Aider even reads your prompt. This post shows how to run Aider against any LLM provider — Ollama for free local runs, OpenRouter for mixed-provider routing, AWS Bedrock for the enterprise plate — through a single OpenAI-compatible endpoint. I'll use Lynkr , the self-hosted gateway I maintain, but the pattern works with any OpenAI-compatible proxy. Full disclosure: I build Lynkr. I'll point out where it loses to LiteLLM and OpenRouter further down so you can make an honest call. The setup in three commands # 1. Start the gateway npx lynkr@latest # 2. Point Aider at it export OPENAI_API_BASE = http://localhost:8081/v1 export OPENAI_API_KEY = any-value # 3. Run Aider with any model name Lynkr knows about aider --model openai/gpt-4o Enter fullscreen mode Exit fullscreen mode That's it. Aider speaks the OpenAI Chat Completions protocol; Lynkr speaks it back and quietly translates the call to whichever upstream provider you've configured (Ollama, Bedrock, Anthropic, Azure, OpenRouter, Databricks, llama.cpp, LM Studio, ...). Aider has no idea it's talking to a router. Why bother? The cost math Aider's own leaderboard shows GPT-4o and Claude 3.5 Sonnet at the top — but you don't need a $3-per-million-tokens model to rename a variable. You need it for the architecture decisions. Lynkr's tier routing splits the work: Aider call type Routes to Cost Repo map summarization qwen2.5-coder:7b (Ollama, local) $0 File edits, single-function diffs gemini-flash-1.5 (OpenRouter) ~$0.075/M Architecture / multi-file refactors claude-3.5-sonnet (Anthropic) $3/M On a typical 4-hour Aider session, 80–90% of the calls a

📰Dev.to — dev.to

Comments