Best Coding LLM for 12GB VRAM (12GB VRAM)
The 14B coder tier — a real local Copilot on a 12GB GPU
The best local coding LLM for 12GB VRAM in 2026 is Qwen 2.5 Coder 14B — ~9GB at Q4_K_M, a bandwidth ceiling of ~40 tokens/sec on an RTX 3060 12GB and ~56 on an RTX 4070 (360 and 504 GB/s ÷ 9.0GB — not measurements), and a noticeable quality step over every 7B coder. DeepSeek-Coder-V2 Lite 16B (MoE) fits in ~10GB and feels faster in the editor. The 22B–32B coders need 16–24GB, so the 14B is the 12GB ceiling — and it is a good one.
Models that fit in 12GB VRAM
Reference card: RTX 3060 12GB / RTX 4070. Figures are for Q4_K_M with a modest context window.
| Model | Size | Build | VRAM used | Ceiling tok/s* |
|---|---|---|---|---|
| WINNERQwen 2.5 Coder 14B The 12GB ceiling and worth it — handles the multi-file refactors and repo questions the 7B coders fumble. ollama pull qwen2.5-coder:14b | 14B | Q4_K_M | ~9.0GB | ceiling ~40 tok/s (3060: 360 ÷ 9.0GB) · ~56 (4070: 504 ÷ 9.0GB) |
| DeepSeek-Coder-V2 Lite 16B Only ~2.4B params fire per token, so it generates faster than the dense 14B at similar quality. ollama pull deepseek-coder-v2:16b | 16B (MoE, 2.4B active) | Q4_K_M | ~8.9GB | MoE — ~2.4B active per token; bandwidth is not the limit; not measured |
| Qwen 2.5 Coder 7B The lighter pick when you want a long repo context resident alongside it. ollama pull qwen2.5-coder:7b | 7B | Q4_K_M | ~4.7GB | ceiling ~77 tok/s (3060: 360 ÷ 4.7GB) · ~107 (4070: 504 ÷ 4.7GB) |
| DeepSeek-Coder 6.7B Still the best small fill-in-the-middle model for pure autocomplete. ollama pull deepseek-coder:6.7b | 6.7B | Q4_K_M | ~3.8GB | ceiling ~95 tok/s (3060: 360 ÷ 3.8GB) · ~133 (4070: 504 ÷ 3.8GB) |
| Qwen 2.5 Coder 3B Near-instant inline completions — pair it with a bigger chat model. ollama pull qwen2.5-coder:3b | 3B | Q4_K_M | ~1.9GB | ceiling ~189 tok/s (3060: 360 ÷ 1.9GB) · ~265 (4070: 504 ÷ 1.9GB) |
* Ceiling tok/s = the card’s vendor-listed memory bandwidth ÷ the model’s file size as Ollama lists it — the rate a dense model cannot exceed, because every generated token reads the whole weight set once. We have not measured these cards. Real-world generation usually lands at 50–80% of the ceiling and falls as the context grows; mixture-of-experts rows read only their active parameters, so no ceiling is quoted for them.
What won't fit in 12GB
- ✗Codestral 22B (needs ~13GB) — Needs 16GB even with a short context.
- ✗Devstral 24B (needs ~15GB) — Mistral’s agentic coder — a 16GB-card model.
- ✗Qwen 2.5 Coder 32B (needs ~20GB) — The SOTA local coder — still a 24GB card away.
How to fit more in 12GB
- →The 14B coder (~9GB) plus a 3B autocomplete model (~2.2GB) will not sit together on 12GB once the KV cache lands — run 7B + 3B for a two-model setup, or let the 14B do both jobs.
- →Give the 14B an 8K num_ctx and feed it focused files, not the whole repo — ~3GB of KV budget is roughly 8–12K tokens of code before layers start spilling to system RAM.
- →If completions feel sluggish on a 3060, try DeepSeek-Coder-V2 Lite first — the MoE reads only ~2.4B active parameters per token, which is the difference between waiting on the model and reading as it types.
Quick start
curl -fsSL https://ollama.com/install.sh | shollama run qwen2.5-coder:14bGo from "it runs" to actually building
All 561 chapters — running local models, RAG, agents, fine-tuning — plus the Python Lab and every course added later.
Frequently asked questions
What is the best coding model for an RTX 3060 12GB?
Qwen 2.5 Coder 14B at Q4_K_M — ~9GB, bandwidth ceiling ~40 tok/s on the 3060, and the strongest coder that fits the card fully in VRAM. DeepSeek-Coder-V2 Lite 16B is the faster-feeling MoE alternative at ~10GB.
Is the 14B coder really better than the 7B on 12GB?
Yes — it is the noticeably smarter step up: fewer subtle logic errors and much better cross-file reasoning. The cost is speed (it reads ~9GB per token against the 7B’s ~4.7GB, so its ceiling is roughly half) and context headroom. Keep a small model for autocomplete; for chat and refactors the 14B earns its VRAM.
Can 12GB VRAM run Codestral or the 32B coder?
No — Codestral 22B needs ~13GB and Qwen 2.5 Coder 32B ~20GB. Both spill into system RAM on 12GB and slow to a crawl. The 14B class is the honest ceiling; the 32B coder is the reason people buy 24GB cards.
Related guides
Ready to Go Beyond Tutorials?
25 structured courses with hands-on chapters - build RAG chatbots, AI agents, and ML pipelines on your own hardware.
Was this helpful?