Local Coding Models
Qwen2.5-Coder, DeepSeek-Coder, Codestral, CodeLlama — the best local models for code in May 2026.
The "what's the best local code model in 2026" answer has stabilised around Qwen2.5-Coder 32B and Qwen3-Coder (when it ships at relevant sizes), with DeepSeek-Coder-V2 and Codestral as the backups, plus DeepSeek R1 / R1-distills for reasoning-heavy refactors. For the agentic-coding workflow built on top see agentic coding overview, Aider, Continue.dev, Cline. For general models see models overview; for hardware see tiers.
The picks
★ ★ Qwen2.5-Coder 32B
- The dominant local code model since late 2024. Apache 2.0.
- Variants: 0.5B / 1.5B / 3B / 7B / 14B / 32B; base + instruct.
- 32B-Instruct at Q4 fits comfortably in 24GB VRAM (Tier 2+ in hardware tiers).
- Strong on Python, JS/TS, Rust, Go; excellent FIM (fill-in-middle); long context.
- Pair with Aider for diff-based editing or Continue.dev for tab-completion.
- ★ ★ The default local-coding pick in May 2026.
★ ★ DeepSeek-Coder-V2
- Apache-style license; multiple sizes including a 236B MoE.
- Strong on competitive-programming style tasks.
- DeepSeek-Coder-V2-Lite (16B MoE, ~2.4B active) is a great mid-tier pick — fits Tier 1+ hardware.
- ★ Strong runner-up to Qwen2.5-Coder on coding tasks.
★ Codestral (Mistral, 22B)
- Mistral's coding model. Mistral Non-Production License — limited commercial use (read it).
- Strong on Python; good at FIM.
- 22B fits 24GB at Q4 with room.
★ DeepSeek R1 / R1-distill for refactoring
- R1's reasoning traces are excellent for "explain this code" / "find the bug" / "refactor this complex function" tasks.
- The Llama 70B and Qwen 32B distills give you reasoning-flavoured coding at consumer-tier hardware.
- Pair with Aider's architect mode — R1-distill as architect, Qwen2.5-Coder as editor.
CodeLlama 70B
- Older (Aug 2024); still solid but outclassed by Qwen2.5-Coder 32B and DeepSeek-Coder-V2 for most tasks.
- Llama 2 license — fine for most uses.
StarCoder 2
- BigCode collaborative model; fully OSS data + weights.
- 3B / 7B / 15B; good for FIM tab-completion at smaller sizes.
- Great if you care about training-data provenance / licensing of training data.
Smaller / FIM-focused
- Qwen2.5-Coder 1.5B / 3B / 7B — Tier 0–1 friendly; 1.5B-Q4 runs well on a Mac Mini base.
- DeepSeek-Coder 6.7B — older but still a strong tab-completion model on Tier 1.
- StarCoder 2 3B / 7B — FIM-strong at small sizes.
Picking by hardware tier
| Tier | Recommended coding model |
|---|---|
| Tier 0 (CPU/16GB) | Qwen2.5-Coder 1.5B or 3B |
| Tier 1 (3060 12GB / M4 16GB) | Qwen2.5-Coder 7B or 14B |
| Tier 2 (3090 24GB / 5090 32GB) | ★ ★ Qwen2.5-Coder 32B at Q4_K_M |
| Tier 3+ | Qwen2.5-Coder 32B at Q8 + R1-distill 70B for architect |
What "good at code" means in 2026
Different things, often confused:
- Tab completion / FIM — small model, low latency, decent context awareness; Qwen2.5-Coder 7B is plenty.
- Diff editing (Aider workflow) — model needs to faithfully follow the search/replace block format. Qwen2.5-Coder 32B handles this cleanly; 14B is borderline.
- Architect / planning — model writes a plan that an editor model executes. R1-distill, DeepSeek-Coder-V2, Qwen 3 are stronger here.
- Agentic full-task (Cline / OpenHands) — requires reliable tool calling, robustness over many turns; harder than the others; few open models nail this consistently.
Honest gaps vs. closed APIs
- Frontier closed code models (Claude Opus 4.7, GPT-5) still beat the best open code models on hard architectural decisions, ambiguous spec interpretation, large-codebase reasoning. The gap on routine coding is small or zero.
- Long context. Many local code models cap at 32K–64K usable context. Frontier APIs go to 200K–1M. For huge-codebase agentic work, this matters.
- Speed. A 32B model on a 3090 generates ~25–35 tok/s. Claude / GPT do 80+ tok/s. Acceptable for human-pace; punishing for agent-loop pace.
- Reliability of tool calls. Local models drop tool calls or malformed JSON more often than Claude / GPT in May 2026. Aider's diff format is forgiving by design; agentic tools are less forgiving.
Pick this if…
- One pick for a Tier-2+ home setup: ★ ★ Qwen2.5-Coder 32B-Instruct, Q4_K_M.
- Smaller hardware: Qwen2.5-Coder 7B or 14B.
- Reasoning-heavy refactoring: DeepSeek R1-distill 70B as Aider architect, Qwen2.5-Coder 32B as editor.
- Apache-2.0 strict licensing: Qwen2.5-Coder.
- You want the fully-open-data model: StarCoder 2.
- You don't mind paying APIs: Aider with Claude Sonnet 4.7 is still the best agentic-coding experience in May 2026 if you have the budget.