VRAM Requirements for Coding LLMs: What Every Tier Actually Runs

作者 Jakub Rusinowski · 最后更新 2026-08-04 · 硬件数据由我们的 VRAM 引擎

8 GB VRAM runs Qwen3-Coder 8B plus an autocomplete model — a real entry point. 16 GB runs Devstral-2 22B, the first genuinely agent-capable tier. 24 GB runs Qwen 3.6 27B or Qwen 2.5 Coder 32B — the sweet spot. Above that, ~49 GB (2×24 GB or a 96 GB+ Mac) unlocks Qwen3-Coder 80B-A3B. Coding agents need context headroom on top of weights, so budget one notch looser than a chat-only setup.

Coding is the hardest workload to size VRAM for, because three things compete for the same memory: model weights, the KV cache (which grows with context length — and agent tools routinely push 16–32K-token contexts), and any second model you run for autocomplete. Generic "7B needs 5 GB" tables ignore the last two, which is how people end up with an agent that crashes the moment Cline loads a big file.

Every figure below is the Q4_K_M requirement computed by the same engine as our compatibility checker — weights + KV cache + overhead, not a copied spec-sheet number. For any specific GPU + model combination, including quant and context options, the checker gives the exact verdict.

8 GB VRAM — the honest entry point

RTX 3060/4060-class cards and 16 GB Macs. One current-gen small coder, or coder + autocomplete if you keep contexts modest.

模型VRAM (Q4)可运行于上下文许可
Qwen3-Coder 8B
Daily driver — Current-generation, FIM-tuned, leaves ~2 GB headroom on an 8 GB card for context growth.
ollama pull qwen3-coder:8b
5.6 GB8 GB GPU (RTX 3060/4060)
Mac: 16 GB 统一内存
125KApache-2.0
StarCoder 2 3B
Autocomplete sidecar — Small enough to run alongside the 8B — instant ghost text while the bigger model handles chat.
ollama pull starcoder2:3b
2.6 GB8 GB GPU (RTX 3060/4060)
Mac: 16 GB 统一内存
16KBigCode OpenRAIL-M

12–16 GB VRAM — the first agentic tier

RTX 3060 12GB, RTX 4060 Ti 16GB / 5060 Ti 16GB, RX 7800 XT-class, 24 GB Macs. Dedicated coding agents become reliable here.

模型VRAM (Q4)可运行于上下文许可
Devstral-2 22B
Best agent under 24 GB — Purpose-built for multi-file agent loops; on a 16 GB card it fits with context room to spare.
ollama pull devstral:22b
14.1 GB16 GB GPU (RTX 4060 Ti 16GB / 5060 Ti)
Mac: 24 GB 统一内存
125KApache-2.0
Codestral 22B
FIM specialist (non-commercial) — Great completions, but MNPL license — personal projects only.
ollama pull codestral:22b
14.2 GB16 GB GPU (RTX 4060 Ti 16GB / 5060 Ti)
Mac: 24 GB 统一内存
32KMNPL-0.1 (non-production)
StarCoder 2 15B
Legacy option — Fits a 12 GB card; pick it only when the newer 8B/22B options don’t cover your language.
ollama pull starcoder2:15b
10.2 GB12 GB GPU (RTX 3060 12GB / 4070)
Mac: 16 GB 统一内存
16KBigCode OpenRAIL-M

24 GB VRAM — the sweet spot

RTX 3090/4090, RX 7900 XTX, 32 GB Macs. The tier this hub recommends aiming for if you’re buying hardware for coding.

模型VRAM (Q4)可运行于上下文许可
Qwen 3.6 27B
Best overall — ~6 GB of headroom left on a 24 GB card — enough for 32K contexts or an autocomplete sidecar.
ollama pull qwen3.6:27b
17.6 GB24 GB GPU (RTX 3090/4090)
Mac: 24 GB 统一内存
256KApache-2.0
Qwen 2.5 Coder 32B
Dedicated coder — Tighter fit (~4 GB headroom) — superb quality, but keep contexts moderate or drop the sidecar.
ollama pull qwen2.5-coder:32b
20.1 GB24 GB GPU (RTX 3090/4090)
Mac: 32 GB 统一内存
128KApache-2.0
Qwen 3.6 35B-A3B
Fast MoE alternative — Only 3B active parameters — noticeably faster tokens than the dense 27B at similar quality.
ollama pull qwen3.6:35b-a3b
21.9 GB24 GB GPU (RTX 3090/4090)
Mac: 32 GB 统一内存
256KApache-2.0

48 GB+ — workstation and Mac territory

2×24 GB GPUs, a 48 GB card, or 64–128 GB Apple unified memory (of which ~75% is usable for models).

模型VRAM (Q4)可运行于上下文许可
Qwen3-Coder 80B-A3B (MoE)
The workstation prize — ~96% of the open flagship’s coding quality; 3B active params keep it fast even at this size.
ollama pull qwen3-coder:80b-a3b-q4
49.1 GB2×48 GB GPUs / big unified memory
Mac: 96 GB 统一内存
125KApache-2.0
Devstral-2 123B
Agentic maximalist — 71.6% SWE-bench Verified — the strongest open agent you can self-host without a server room.
ollama pull devstral:123b
75.1 GB2×48 GB GPUs / big unified memory
Mac: 128 GB 统一内存
125KApache-2.0

The two VRAM rules specific to coding

Rule 1 — reserve context headroom. KV cache grows linearly with context length. A model that "fits" at 8K context can overflow at 32K — and agent tools like Cline live at 16–32K. If your card fits a model with less than ~15% VRAM to spare, either lower the quant one step or choose the next model down. (This is exactly what the checker models when you change the context slider.)

Rule 2 — MoE changes the math in your favor. Mixture-of-experts models need all weights resident but only stream active experts per token — so Qwen3-Coder 80B-A3B is *faster* than a dense 27B once loaded, and with llama.cpp expert offload it degrades gracefully onto system RAM instead of refusing to load. If you're between tiers, a small-active MoE (35B-A3B, 80B-A3B) is usually the better stretch than a bigger dense model. More in our MoE models guide.

On Apple Silicon, count ~75% of unified memory as usable for models — a 48 GB Mac is a "36 GB card" for planning purposes.

Upgrading a tier?

If this page moved your target from 8 GB to 16 or 24, these are the cards each tier is priced around — the 4060 Ti 16GB as the value pick, the 3090/4090 for the sweet spot.

联盟营销声明: 本页部分链接为联盟推广链接——如果你通过它们购买,LLM Configurator 可能会获得佣金,而你无需支付任何额外费用。作为亚马逊联盟成员(Amazon Associate),LLM Configurator 会从符合条件的购买中获得收益。
NVIDIA GeForce RTX 4060 Ti 16GB
16 GB VRAM · 165 W board power
2026年价格波动较大——请以当前商品页价格为准。
在亚马逊查看价格
NVIDIA GeForce RTX 3090 24GB
24 GB VRAM · 350 W board power
2026年价格波动较大——请以当前商品页价格为准。
在亚马逊查看价格
NVIDIA GeForce RTX 4090 24GB
24 GB VRAM · 450 W board power
2026年价格波动较大——请以当前商品页价格为准。
在亚马逊查看价格

没有硬件?先租一块 GPU

Or skip the purchase: rent the exact VRAM tier for an hour and watch actual memory usage with your real workload before spending anything.

完整列表见 云 AI 目录.

常见问题

How much VRAM do I need for a local coding LLM?
Practical minimums at Q4: 8 GB for Qwen3-Coder 8B (real entry point), 16 GB for Devstral-2 22B (first reliably agentic tier), 24 GB for Qwen 3.6 27B or Qwen 2.5 Coder 32B (the sweet spot). Add ~15% headroom on top of the model figure for agent-length contexts.
What is the best coding LLM for 16 GB VRAM?
Devstral-2 22B — about 14 GB at Q4_K_M, purpose-built for agentic coding, Apache 2.0. If you need more context headroom or a second model for autocomplete, Qwen3-Coder 8B at ~6 GB is the flexible alternative.
Why does my coding model run out of VRAM with long files?
KV cache. The figures on spec sheets assume short contexts, but the cache grows with every token of context — and coding agents stuff files, diffs, and plans into context. A 20 GB model on a 24 GB card can OOM at 32K context. Fixes: lower the quant, cap context, or use KV-cache quantization. See our CUDA out-of-memory troubleshooting guide.
Is 8 GB VRAM enough for a local coding assistant?
Yes, with the right expectations: Qwen3-Coder 8B plus StarCoder2 3B autocomplete is a genuinely useful daily setup for completions, explanations, and small edits. What 8 GB does not support well is autonomous multi-file agent work — that starts being dependable at 16 GB and gets comfortable at 24 GB.
How much unified memory does a Mac need for coding models?
Count roughly 75% of unified memory as available for models. 16 GB Mac → Qwen3-Coder 8B; 24–32 GB → Devstral-2 22B; 32–48 GB → Qwen 3.6 27B; 96–128 GB → Qwen3-Coder 80B-A3B. M-series memory bandwidth makes these very usable for coding, especially MoE models.

继续阅读