mrsn0.3.0
auth
live

The best local LLM for coding: pick by VRAM first

24 GB → Qwen3 Coder 30B A3B; 12–16 GB → Qwen2.5 Coder 14B at Q4; 8 GB → 7B at Q4. Drop the quant one notch before the model size, and leave 1–2 GB of VRAM for the KV cache.

2026-11-232 min read

The best local LLM for coding fits your VRAM with room left for context: 24 GB → Qwen3 Coder 30B A3B, 12–16 GB → Qwen2.5 Coder 14B at Q4, 8 GB → 7B at Q4. Read the card: nvidia-smi --query-gpu=memory.total --format=csv,noheader.

8 GB
7B
Q4_K_M · ~4.7 GB on disk
12 GB
14B
Q4_K_M · ~9.0 GB on disk
16 GB
20B
Q4_K_M class · ~9–12 GB
24 GB
30B
A3B MoE · ~18.6 GB
Drop the quant one notch before you drop the model size.
1–2

GB of VRAM headroom for the KV cache. Context counts — 14B at Q4 plus 8K misses 10 GB.

Which local LLM for coding fits your VRAM?

Rule: quantised weights + 0.125 GB per 1K tokens of context at 8-bit KV cache; 8K ≈ 1 GB. One quant down beats one size down: Q5/Q4 costs a few percent of quality, a 7B over a 14B far more.

VRAMModelQuantWeights on diskWhy it wins this bracket
8 GBQwen2.5 Coder 7B InstructQ4_K_M~4.7 GBBest tokens-per-second-to-quality ratio for autocomplete and small refactors
12 GBQwen2.5 Coder 14B InstructQ4_K_M~9.0 GBWhole-file edits fit in context; still 30+ tok/s on a 3060-class card
16 GBQwen3 14B or gpt-oss-20bQ4_K_M~9–12 GBBetter reasoning on ambiguous specs; 4090-class cards keep it fast
24 GBQwen3 Coder 30B A3BQ4_K_M~18.6 GBMoE: only ~3B parameters active per token, so speed stays usable

Weights on disk are the GGUF files these commands pull.

Qwen3 Coder vs DeepSeek

Qwen3 Coder (30B A3B) owns the edit loop: tool calling, consistent diffs, ~3B active parameters per token, 40–60 tok/s on one 24 GB card. DeepSeek V3/R1 argues architecture, but its 600B+ flagship writes prose about code faster than code.

The law: local wins the edit loop — refactors, boilerplate, test scaffolding. Hosted frontier models still win long multi-file reasoning. 12 GB is the sweet spot for 14B at Q4 with 8K–16K context; 16 GB opens 20B-class dense models; 24 GB is the closest thing to cloud-quality coding you can host.

Five commands to working

  1. install Ollama (Linux): curl -fsSL https://ollama.com/install.sh | sh
  2. pull the model that fits your bracket: ollama pull qwen2.5-coder:7b
  3. chat with it: ollama run qwen2.5-coder:7b
  4. call it as an OpenAI-compatible API on localhost:11434/v1
  5. point tools at it: export OPENAI_BASE_URL=http://localhost:11434/v1
curl http://localhost:11434/v1/chat/completions \  -d '{"model": "qwen2.5-coder:7b", "messages": [{"role": "user", "content": "Refactor this fn to be async: add(a,b){return a+b}"}]}'curl -s $OPENAI_BASE_URL/models → "qwen2.5-coder:7b" in the list
  • brackets: NVIDIA 8 / 12 / 16 / 24 GB · ollama · GGUF Q4_K_M
  • first published 2026-09-04 · shortlist from 2026 community benchmarks and daily use
  • CPU-only bench from the source: llama.cpp 7B Q4 on a laptop CPU, 5–10 tok/s — patience exercise, not a daily driver
0appreciations — anonymous, one per reader
your message opens the chat panel on the right — the thread remembers, sources ride inline
the feedanswersthe agentsdocsaboutauthschema.jsonopenapi.jsonllms.txt