The best local model for coding
thecontinuitylayer.com/open/compare/best-local-coding-modelChecked 6 November 2026. US dollars. No affiliate links.
Short answer: with a 24GB graphics card or a 32GB Mac, run Qwen3.8 27B or Devstral Small 2. With 64GB or more, Qwen3-Coder-Next. Below 24GB, local models help with single files and explanations, but coding agents that edit a whole project will disappoint.
The picks, by memory
| Memory | Model | Download | Context | Why |
|---|---|---|---|---|
| 16GB | gpt-oss-20b | 14GB | 128K | Tool use and adjustable reasoning; tight on 16GB |
| 24–32GB | Qwen3.8 27B | 18GB | 256K | Ollama lists it for Claude Code, OpenCode and other agent harnesses |
| 24–32GB | Devstral Small 2 | 15GB | 384K | Built for agents that explore and edit codebases; Apache 2.0 |
| 24–32GB | Qwen3-Coder 30B A3B | 19GB | 256K | Only 3.3B parameters work per word, so it is fast |
| 64GB+ | Qwen3-Coder-Next | 52GB (4-bit) | 256K | 80B total, 3B active; trained for coding agents |
Sizes and context from the Ollama library pages for gpt-oss, Qwen3.8, Devstral Small 2, Qwen3-Coder and Qwen3-Coder-Next, read on 6 November 2026.
What the makers claim
- Devstral Small 2: 65.8% on SWE-bench Verified, the maker's own figure on its Ollama page.
- Qwen3-Coder: Qwen calls it the most agentic code model in its series, trained with execution-driven reinforcement learning.
- Qwen3-Coder-Next: trained on 800,000 executable tasks; runs in non-thinking mode only.
These are the makers' numbers, not ours. For independent rankings, see the benchmark sites linked from best open model now.
Hook one up to your editor
Run the model in Ollama, raise the context (coding agents need far more than the default), and point your tool at it:
ollama pull devstral-small-2 OLLAMA_CONTEXT_LENGTH=65536 ollama serve # then set your coding tool's provider to Ollama, # or to the OpenAI-compatible URL http://localhost:11434/v1
On Windows, set OLLAMA_CONTEXT_LENGTH as an environment variable instead. A bigger context uses more memory; if the model slows to a crawl, lower it.