Many people use LLM (Large Language Models) services to code at work but don't necessarily see a path to use them at home on a budget.
Here are two quick recipes: one for a fully local, privacy-focused setup, and another using OpenRouter.
Local LLMs
- Make sure you have ollama installed and running.
- Note down a wich model(s) you have installed and plan to use. We'll use deepseek-r1 and qwen2.5-coder as example models.
Deepseek
is general purpose and a good candidate for reasoning whileqwen2.5-coder
is specialized for coding tasks.
$ ollama list
NAME ID SIZE MODIFIED
deepseek-r1:14b ea35dfe18182 9.0 GB 2 hours ago
qwen2.5-coder:14b 9ec8897f747e 9.0 GB 2 hours ago
I'm using the 14-B distilled models based on my hardware. You can experiment with different ones and find what speed vs quality tradeoff you're comfortable with. The Ollama models site is very handy to get information about models and their distilled versions.
- follow the guide which tells you to run:
aider --model ollama_chat/<model>
So in our case, that becomes:
aider --model "ollama_chat/deepseek-r1:14b" --editor-model "ollama_chat/qwen2.5-coder:14b"
We could simply use one model for everything but this "plan vs execution" pattern works really well both locally and remotely.
Use aider --help
or visit the options page on aider's site to understand the differences between --model
(main model), --editor-model
(editor tasks), and --weak-model
(commit messages and history summarization).
Cheaply with OpenRouter
If you're not satisfied with using your hardware for everything and are ok with sending data to an LLM in the cloud, you can use OpenRouter.
The advantage of using OpenRouter over a specific LLM service like Claude, ChatGPT API or others is that you can have a cloud independent approach and mix and match APIs paying in only one place, while also setting specific budgets that you can't go over.
user u/Baldur-Norddahl Reddit LocalLLama shared a snippet of what it looks like. You'll notice it's very similar to our local example with the addition of the OpenRouter API Key as an environment variable and that we use Claude 3.7 and the full version of Deepseek r1:
export OPENROUTER_API_KEY=sk-or-v1-xxxx
aider --architect --model openrouter/deepseek/deepseek-r1 --editor-model openrouter/anthropic/claude-3.7-sonnet --watch-files
You can easily monitor your activity an estimate what your coding sessions are actually like. This may lead you to switch from Claude 3.7 to something cheaper. Again, it's all about personal experience and quality tradeoffs.
In Closing
Both patterns are very useful and allow you a great degree of flexibility. There's a lot of power in customization and avoiding vendor lock-in. You'll be able to experiement with cline/aider or whatever the next tool is. As hardware becomes more powerful, you could have a very productive experience on a plane, even without internet access.
Shoutout to Georgi Gerganov's llama.cpp which is the core that allows ollama to work.