VRAM Requirements for Coding LLMs: What Every Tier Actually Runs
8 GB VRAM runs StarCoder 2 7B for completion and small edits — a real entry point, but a completion model, not an agent. 16 GB runs Devstral Small 2 24B, 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.
Written by Jakub Rusinowski · Last updated August 4, 2026 · Hardware figures computed by our VRAM engine
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.
| Model | VRAM (Q4) | Runs on | Context | License |
|---|---|---|---|---|
| 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 GB | 8 GB GPU (RTX 3060/4060) Mac: 16 GB unified | 125K | Apache-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 GB | 8 GB GPU (RTX 3060/4060) Mac: 16 GB unified | 16K | BigCode 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.
| Model | VRAM (Q4) | Runs on | Context | License |
|---|---|---|---|---|
| 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 GB | 16 GB GPU (RTX 4060 Ti 16GB / 5060 Ti) Mac: 24 GB unified | 125K | Apache-2.0 |
| Codestral 22B FIM specialist (non-commercial) Great completions, but MNPL license — personal projects only. ollama pull codestral:22b | 14.2 GB | 16 GB GPU (RTX 4060 Ti 16GB / 5060 Ti) Mac: 24 GB unified | 32K | MNPL-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 GB | 12 GB GPU (RTX 3060 12GB / 4070) Mac: 16 GB unified | 16K | BigCode 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.
| Model | VRAM (Q4) | Runs on | Context | License |
|---|---|---|---|---|
| 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 GB | 24 GB GPU (RTX 3090/4090) Mac: 24 GB unified | 256K | Apache-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 GB | 24 GB GPU (RTX 3090/4090) Mac: 32 GB unified | 128K | Apache-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 GB | 24 GB GPU (RTX 3090/4090) Mac: 32 GB unified | 256K | Apache-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).
| Model | VRAM (Q4) | Runs on | Context | License |
|---|---|---|---|---|
| Qwen3-Coder-Next (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 GB | 2×48 GB GPUs / big unified memory Mac: 96 GB unified | 256K | Apache-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 GB | 2×48 GB GPUs / big unified memory Mac: 128 GB unified | 256K | Apache-2.0 |
The two VRAM rules specific to coding
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.
No hardware? Rent the GPU first
Or skip the purchase: rent the exact VRAM tier for an hour and watch actual memory usage with your real workload before spending anything.
- RunPod — RTX 4090 ≈ $0.3–0.7/hr, A100/H100 by the hour; serverless per-second billing available
- Vast.ai — Marketplace of hosted GPUs — often the cheapest per hour (interruptible options)
- Lambda — On-demand A100/H100/B200 instances and clusters, per-hour billing
Affiliate links — we may earn a commission if you sign up, at no extra cost to you.
Full list on the cloud AI directory.
Frequently asked questions
How much VRAM do I need for a local coding LLM?
Practical minimums at Q4: 8 GB for StarCoder 2 7B (completion and small edits), 16 GB for Devstral Small 2 24B (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 Small 2 24B — about 14.5 GB at Q4_K_M, purpose-built for agentic coding, Apache 2.0, and 68% on SWE-bench Verified. If you need more context headroom or a second model for autocomplete, StarCoder 2 7B at ~4.3 GB leaves the room.
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: StarCoder 2 7B is a genuinely useful daily setup for completions and small edits, and StarCoder 2 3B leaves room for a chat model beside it. 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 → StarCoder 2 7B; 24–32 GB → Devstral Small 2 24B; 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.