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, ~25–32 tokens/sec on an RTX 3060 12GB or RTX 4070, 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
Tested reference: RTX 3060 12GB / RTX 4070. Figures are for Q4_K_M with a modest context window.
| Model | Size | Build | VRAM used | Speed |
|---|---|---|---|---|
| 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 | ~25–32 tok/s |
| 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 | ~10GB | ~34–42 tok/s |
| 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 | ~50–60 tok/s |
| 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 | ~4.5GB | ~50–60 tok/s |
| 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 | ~2.2GB | ~90–100 tok/s |
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’s ~40 tok/s 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 519 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, ~25 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 (~25–32 vs ~50–60 tok/s) 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?
20 structured courses with hands-on chapters - build RAG chatbots, AI agents, and ML pipelines on your own hardware.
Was this helpful?