+++
title = "The best local LLM for coding: pick by VRAM first"
description = "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."
+++
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 GB7BQ4_K_M · ~4.7 GB on disk
12 GB14BQ4_K_M · ~9.0 GB on disk
16 GB20BQ4_K_M class · ~9–12 GB
24 GB30BA3B 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.
| VRAM | Model | Quant | Weights on disk | Why it wins this bracket |
|---|---|---|---|---|
| 8 GB | Qwen2.5 Coder 7B Instruct | Q4_K_M | ~4.7 GB | Best tokens-per-second-to-quality ratio for autocomplete and small refactors |
| 12 GB | Qwen2.5 Coder 14B Instruct | Q4_K_M | ~9.0 GB | Whole-file edits fit in context; still 30+ tok/s on a 3060-class card |
| 16 GB | Qwen3 14B or gpt-oss-20b | Q4_K_M | ~9–12 GB | Better reasoning on ambiguous specs; 4090-class cards keep it fast |
| 24 GB | Qwen3 Coder 30B A3B | Q4_K_M | ~18.6 GB | MoE: 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
- install Ollama (Linux):
curl -fsSL https://ollama.com/install.sh | sh - pull the model that fits your bracket:
ollama pull qwen2.5-coder:7b - chat with it:
ollama run qwen2.5-coder:7b - call it as an OpenAI-compatible API on
localhost:11434/v1 - 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
Originally published at mrsn - the dev radar.
