Best local LLM for coding: choosing a model
The best local LLM for coding depends on your hardware and how you work. A direct answer by memory tier, from autocomplete to agents, with the model to pull for each.
By Leon Mallett
What you’ll learn
How to choose a coding model that fits your hardware and your workflow, and why the best model for autocomplete is not the same as the best one for an agent.
Match the model to the job
Different coding tasks want different things:
- Autocomplete needs to be fast above all. A small model gives quick, low-latency suggestions. Quality matters less than speed here, because you are the one deciding what to accept.
- Chat and multi-file edits benefit from a larger, more capable model, since it is reasoning about your code rather than finishing a line.
- Agentic work, where the tool explores a codebase and makes changes across files, wants a model trained for it, with strong tool use and a long context window.
Many people run two models: a small one for autocomplete, and a larger one for chat and edits. Tools like Continue let you assign each separately.
The best local LLM for coding, by hardware
The short answer is to match the model to your memory. These are well-supported coding models from our catalogue that fit each budget. Pull the tag shown, and try two finalists on your own code before you settle; the figures are approximate and depend on quantisation and context length.
| Memory | Model | Pull with | Best for |
|---|---|---|---|
| Under 8GB | Qwen2.5-Coder 7B at 4-bit | qwen2.5-coder:7b |
Fast autocomplete and simple edits |
| 12–16GB | Qwen2.5-Coder 7B at a higher precision | qwen2.5-coder:7b |
The same model with room for better quality and longer context |
| ~24GB | Qwen3-Coder 30B-A3B or Devstral Small 24B | qwen3-coder:30b |
Agentic, multi-file work |
| 48GB+ | Qwen2.5-Coder 32B, or a 30B model at higher precision with long context | qwen2.5-coder:32b |
A capable model with headroom, or a large model plus a small autocomplete one |
On Apple Silicon, use your total unified memory as the budget and match it to the rows above. For agent-driven work specifically, Devstral Small was built for it, and the picks above sit alongside the sourced model rankings, which carry the benchmark detail. Below 8GB you can still run Qwen2.5-Coder 7B at a low quantisation for autocomplete, though you will feel the size on harder tasks.
Doing it
- Work out your memory budget, and check what fits with the hardware matrix.
- Pick a coding model in that budget using the guide above.
- If you have room, set up two models: a small fast one for autocomplete and a larger one for chat and edits.
- Try it on your own code. Benchmarks are a starting point, not a verdict. The only test that matters is whether it helps on your actual work.
What can go wrong
- Using one heavy model for autocomplete. Suggestions lag, and you stop using them. Keep autocomplete on a small, fast model.
- Choosing on benchmarks alone. A model that tops a leaderboard may not suit your language or style. Trial two finalists on real tasks.
- Overreaching your memory. A coding model crammed into VRAM with no room for context will drop the thread on multi-file work.
Next steps
With a model chosen, the natural next step is local coding agents, for when you want the tool to do more than suggest. The coding tools catalogue lists the editors and assistants to pair with your model.