The Continuity Layer
Run your own AI · Best local coding model

The best local model for coding

thecontinuitylayer.com/open/compare/best-local-coding-model

Checked 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

MemoryModelDownloadContextWhy
16GBgpt-oss-20b14GB128KTool use and adjustable reasoning; tight on 16GB
24–32GBQwen3.8 27B18GB256KOllama lists it for Claude Code, OpenCode and other agent harnesses
24–32GBDevstral Small 215GB384KBuilt for agents that explore and edit codebases; Apache 2.0
24–32GBQwen3-Coder 30B A3B19GB256KOnly 3.3B parameters work per word, so it is fast
64GB+Qwen3-Coder-Next52GB (4-bit)256K80B 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.