Ask AI about this guideAsk AI:
Comparison

Best Local LLM for Coding by VRAM in 2026: 8GB, 12GB, 16GB, 24GB and 32GB Picks for Agents

Eleven open-weight model families mapped onto five VRAM tiers, with real GGUF file sizes, KV-cache arithmetic, licenses and vendor-reported coding benchmarks, for agents that edit code and call tools.

Logos of Qwen, gpt-oss, Gemma, Devstral, GLM, Granite, DeepSeek, Phi, MiniMax, Kimi and Llama, the tools compared in this guide
Eleven open-weight model families, sorted onto the VRAM tier where each one is practical.

Get the latest on AI, LLMs & developer tools

New MCP servers, model updates, and guides like this one — delivered weekly.

The Short Answer

The best local LLM for coding depends on how much VRAM you have, and in late 2026 one family covers most of the range. Our picks are Qwen3.5-9B at 8 GB, Gemma 4 12B at 12 GB, gpt-oss-20b at 16 GB, Qwen3.8-27B at 24 GB, and the same Qwen3.8-27B at a higher quantization at 32 GB. Every one of them is Apache 2.0 on Hugging Face, and every file size below comes from the Hugging Face API.

This is a paper-based guide. We read model cards, config files and GGUF listings, and we did the memory arithmetic ourselves. We did not run these models on GPUs, so we make no claim about tokens per second or about how any model behaves on your repository. All benchmark numbers are vendor-reported, and everything here was checked on December 3, 2026. For a head-to-head of the very large Qwen, DeepSeek, Kimi, GLM and MiniMax models, see our open-weight agent model comparison; this page is about what actually fits on a consumer card.

Best Local AI Model for EVERY GPU (8GB to 512GB+) | Oct 2026

Video: RepoChad's October 2026 walkthrough of local models by GPU size. It is one creator's opinion and predates some of the models here.

Quick Picks by VRAM

VRAMPickQuantization and windowWhy
8 GBQwen3.5-9BQ4_K_M, 5.68 GB file, 16K to 32K context with an 8-bit KV cacheVendor-reported BFCL-V4 tool-calling score of 66.1, a cache that stays small (32 KiB per token), 262K native context and Apache 2.0. Granite 4.2 8B is the alternative if code generation matters more: IBM reports LiveCodeBench v6 of 73.24 and SWE-bench Verified of 47.67 (different harnesses, so do not compare the numbers directly).
12 GBGemma 4 12BQ5_K_M, 8.41 GB file, 32K context (estimated total 10.5 GB)Google reports LiveCodeBench v6 of 72.0 for the 12B. Apache 2.0. Leaves room for a real context window.
16 GBgpt-oss-20bQ4_K_M or MXFP4 class file, 11.62 GB, 64K context (estimated total 14.4 GB)Shipped in MXFP4, so the small file is the native format, not a lossy squeeze. 3.6B active parameters. Apache 2.0.
24 GBQwen3.8-27BUD-Q4_K_M, 16.56 GB, 64K context (estimated total 22.0 GB)Qwen reports Terminal-Bench 2.1 of 73.0 and SWE-bench Pro of 61.7. Dense, so every parameter works on every token. Apache 2.0.
32 GBQwen3.8-27B at higher precisionUD-Q6_K, 21.98 GB, 64K context (estimated total 27.5 GB); Q8_0 only at short contextSame model as the 24 GB pick with less quantization loss and room for long agent sessions.
24 to 32 GB, speed firstQwen3.6-35B-A3BUD-Q3_K_XL, 16.85 GB (24 GB) or UD-Q5_K_M, 26.46 GB (32 GB)Mixture of experts with about 3B active parameters, so tokens come faster than from a dense 27B. Qwen reports SWE-bench Verified of 73.4.

"Estimated total" throughout this page means the GGUF file, plus the KV cache for the stated window, plus 1.2 GB for compute buffers and the CUDA context. The 1.2 GB is our assumption. If a row says it fits with 0.2 GB spare, treat that as a no.

Master Comparison Table

Parameter counts come from the Hugging Face API or the model card; sizes from Unsloth or vendor GGUF repos; benchmark text from the vendor card, labelled vendor-reported. The "Model" column uses family names so the logos match the hero image.

FamilyCheckpoints coveredParametersFile sizesLicenseVendor-reported coding
Qwen logo QwenQwen3.8-27B, Qwen3.6-27B, Qwen3.6-35B-A3B, Qwen3-Coder-30B-A3B, Qwen3-Coder-Next, Qwen3.5-9B and 4B27.8B dense; 35.9B with 3B active; 30.5B with 3.3B active; 79.7B with 3B active; 9.65B; 4.66BQwen3.5-4B Q4_K_M 2.74 GB; Qwen3.5-9B Q4_K_M 5.68 GB; Qwen3.8-27B UD-Q4_K_M 16.56 GBApache 2.0Qwen3.8-27B: Terminal-Bench 2.1 73.0, SWE-bench Pro 61.7, LiveCodeBench v6 90.3 (vendor-reported)
gpt-oss logo gpt-ossgpt-oss-20b, gpt-oss-120b20.9B with 3.6B active; 116.8B with 5.1B active20b: 11.62 GB (Q4_K_M); 120b: 63.39 GB (MXFP4)Apache 2.0LiveCodeBench v6 74.6 (20b) and 82.7 (120b) as listed in Qwen's Qwen3.5 card
Gemma logo GemmaGemma 4 12B, 26B-A4B, 31B, E4B11.96B; 25.8B with about 4B active; 31.3B; 8.0B including embeddings12B Q4_K_M 7.12 GB (Google QAT q4_0: 6.98 GB); 31B QAT q4_0 17.65 GBApache 2.0LiveCodeBench v6: 31B 80.0, 26B-A4B 77.1, 12B 72.0, E4B 52.0 (Google model card)
Devstral logo DevstralDevstral Small 2 (24B), Devstral 2 (123B)24.0B dense; 125.0BSmall 2 Q4_K_M 14.33 GBApache 2.0 (Small 2); listed as other on Hugging Face (Devstral 2)Small 2: SWE-bench Verified 68.0%, Terminal Bench 2 22.5% (Mistral)
GLM logo GLMGLM-4.7-Flash (30B-A3B); GLM-5.3-Flash is a 320B class model31.2B with about 3B active; 320B with 18B active (model card)GLM-4.7-Flash Q4_K_M 18.31 GB; Q2_K_XL 11.89 GBMITGLM-4.7-Flash: SWE-bench Verified 59.2, tau2-Bench 79.5 (Z.ai)
Granite logo GraniteGranite 4.2 3B, 8B and 30BDense; checked 8B and 30B on Hugging Face8B Q4_K_M 5.35 GB; 30B Q4_K_M 17.72 GBApache 2.0SWE-bench Verified 47.67 (8B) and 57 (30B); LiveCodeBench v6 73.24 and 75.77 (IBM)
DeepSeek logo DeepSeekR1-Distill-Qwen-14B and 32B (local); V4.1-Flash-1017 (not local)14.8B; 32.8B; V4.1-Flash is a 763B-parameter checkpoint on disk14B Q4_K_M 8.99 GB; 32B Q4_K_M 19.85 GB; V4.1-Flash smallest GGUF 232.98 GBMITR1 distills: LiveCodeBench pass@1 53.1 (14B) and 57.2 (32B), Jan 2025 card
Phi logo PhiPhi-4-reasoning-plus14.66B denseQ4_K_M 9.05 GBMITLiveCodeBench 53.1 (Microsoft card, Apr 2025)
MiniMax logo MiniMaxMiniMax-M3.1-FlashAbout 428B with 23B active (model card)Smallest GGUF we found: 129.36 GB (UD-IQ1_M)MiniMax community license (listed as other)DeepSWE v1.1 73.7% (MiniMax)
Kimi logo KimiKimi K3.1 Pro2.8T total with 104B active (model card)No local build: 2.8T parameters is about 350 GB even at 1 bit per weight (our arithmetic)Custom kimi-k3.1-pro license (listed as other)Vendor tables use Terminal-Bench 4.0, SWE-Marathon and DeepSWE
Llama logo LlamaLlama-4-Scout-17B-16E-Instruct108.6B with 17B activeSmallest GGUF we found: 32.47 GB (UD-IQ1_S)Llama community license; gated with manual approvalNo coding score we could verify

Two notes on the table. The MiniMax-M3.1-Flash card says about 428B parameters while the Hugging Face API lists 220.49B tensor elements, most of them stored as packed U8 values; we suspect the packing explains the gap but did not confirm it, and we use the vendor's figure. DeepSeek V4.1-Flash-1017 is listed at 763B by the API, also with packed and FP8 tensors. Neither number changes the conclusion that these models are far outside a single consumer GPU.

How to Tell What Fits

Three things consume VRAM when you run a model with llama.cpp or a runtime built on it. The weights are the GGUF file, and you can read that size straight off the repo. The KV cache stores the keys and values of every token in your context, and it grows with the window. The rest is compute buffers and the CUDA context, which we budget at 1.2 GB.

The cache is where models differ most. Our formula for each model is: cache bytes per token = 2 (keys and values) × layers that use full attention × KV heads × head dimension × 2 bytes (fp16). We read those inputs from each model's config.json. Models with sliding-window layers, such as Gemma 4, add a fixed window cost on top. Qwen3.8 and Qwen3.6 use linear attention on three of every four layers, so only a quarter of their layers grow with context.

KV Cache by Model

All values are fp16 cache in GB (109 bytes), computed by us from config.json for each checkpoint. They are arithmetic, not measurements. Linear-attention layers in the Qwen models keep a small fixed-size state that does not grow with context; we did not model it and rely on the 1.2 GB allowance. GLM-4.7-Flash uses a compressed latent cache, shown here as a best case.

ModelAttention layout (from config)Per token16K32K64K128K
Qwen3.8-27B16 of 64 layers use full attention, 4 KV heads, head dim 25664.0 KiB1.072.154.298.59
Qwen3.6-35B-A3B10 of 40 full attention, 2 KV heads, head dim 25620.0 KiB0.340.671.342.68
Qwen3-Coder-Next12 of 48 full attention, 2 KV heads, head dim 25624.0 KiB0.400.811.613.22
Qwen3-Coder-30B-A3Ball 48 layers full attention, 4 KV heads, head dim 12896.0 KiB1.613.226.4412.88
Qwen3.5-9B8 of 32 full attention, 4 KV heads, head dim 25632.0 KiB0.541.072.154.29
gpt-oss-20b12 full attention layers (12 more use a 128-token window), 8 KV heads, head dim 6424.0 KiB0.400.811.613.22
gpt-oss-120b18 full attention layers, 8 KV heads, head dim 6436.0 KiB0.601.212.424.83
Gemma 4 12B8 global layers (1 KV head, head dim 512) plus 40 sliding-window layers (1024 tokens)16.0 KiB plus a fixed window0.600.871.412.48
Gemma 4 26B-A4B5 global layers plus 25 sliding-window layers20.0 KiB plus a fixed window0.550.881.552.89
Gemma 4 31B10 global layers (4 KV heads) plus 50 sliding-window layers80.0 KiB plus a fixed window2.183.526.2111.58
Devstral Small 240 layers, 8 KV heads, head dim 128160.0 KiB2.685.3710.7421.47
GLM-4.7-Flash47 layers, compressed latent cache (512 + 64 dims), best case52.9 KiB0.891.773.557.10
Granite 4.2 8B40 layers, 8 KV heads, head dim 128160.0 KiB2.685.3710.7421.47
Granite 4.2 30B64 layers, 8 KV heads, head dim 128256.0 KiB4.298.5917.1834.36

8GB Tier: Qwen3.5-9B

At 8 GB the budget is tight: a 5.68 GB file, an 1.2 GB allowance and a window of 16K leaves about 0.6 GB. Qwen3.5-9B at Q4_K_M is our pick because it combines Qwen's reported LiveCodeBench v6 of 65.6 and BFCL-V4 of 66.1 with a cache of only 32 KiB per token. Qwen's table for it also lists gpt-oss-20b at 74.6 on LiveCodeBench, so the 9B is not the strongest coder you could run; it is the strongest that fits.

ModelQuantFile (GB)ContextKV cache (GB)Est. total (GB)Note
Qwen3.5-9BQ4_K_M5.6816K0.547.4Fits with 0.6 GB spare. At 32K the estimate is 8.0 GB, so use an 8-bit KV cache.
Qwen3.5-9BQ3_K_M4.6732K1.076.9Fits with room. Quality cost of 3-bit is not covered by any vendor benchmark.
Granite 4.2 8BQ4_K_M5.358K1.347.9Fits only with a short window, because Granite's cache is 160 KiB per token.
Qwen3.5-4BQ4_K_M2.7432K1.075.0Lots of room; Qwen reports LiveCodeBench v6 55.8 and BFCL-V4 50.3, versus 65.6 and 66.1 for the 9B.
Gemma 4 E4BQ4_K_M4.9816K0.56.7Fits (assumes 2 KV heads on the global layers), but Google's LiveCodeBench v6 of 52.0 is the lowest of the tier.

With 8 GB we would not go below Q4_K_M for agent work, and we would keep the window at 16K, using an 8-bit KV cache if you need 32K. Granite 4.2 8B is smaller on disk (5.35 GB) but its cache is 160 KiB per token, so you only get about 8K before it overflows.

Qwen3.5 small model benchmark chart from the Qwen3.5-9B model card
Qwen3.5 small-model chart from the Qwen3.5-9B model card. Vendor-reported. Credit: Qwen / Alibaba Cloud.

12GB Tier: Gemma 4 12B

A 12 GB card gives you room for a model of about 8 GB with a real window. Gemma 4 12B at Q5_K_M is 8.41 GB, and its sliding-window design keeps the 32K cache to 0.87 GB, for an estimated total of 10.5 GB. Google reports LiveCodeBench v6 of 72.0 for it, the best published figure in this tier. Q6_K is 9.79 GB and technically fits, but with 0.1 GB spare we would not run it.

ModelQuantFile (GB)ContextKV cache (GB)Est. total (GB)Note
Gemma 4 12BQ5_K_M8.4132K0.8710.5Fits with 1.5 GB spare. Q4_K_M leaves 2.8 GB.
Gemma 4 12BQ6_K9.7932K0.8711.9Technically fits, with 0.1 GB spare. Not recommended.
Qwen3.5-9BQ6_K7.4664K2.1510.8Fits; the longer window is the benefit over Gemma at the same VRAM.
Granite 4.2 8BQ6_K7.2216K2.6811.1Fits at 16K only.
Phi-4-reasoning-plusQ4_K_M9.058Knot computed10.3 plus cacheFile plus overhead is already 10.3 GB before any cache. A 2025 model with a 32K limit; skip it for agent work.

If your work is long-context, Qwen3.5-9B at Q6_K can hold a 64K window in an estimated 10.8 GB. Phi-4-reasoning-plus is listed only to show why we skip it: a 9.05 GB file and a 32K limit for a model with a 53.1 LiveCodeBench score.

16GB Tier: gpt-oss-20b

This is the tier where gpt-oss-20b shines. Its Q4_K_M GGUF is 11.62 GB, nearly the same as its Q8_0 at 12.11 GB, because the weights ship in MXFP4. A 64K window costs 1.61 GB of cache, for an estimated 14.4 GB in total. At 128K the estimate reaches 16.0 GB, which is over.

ModelQuantFile (GB)ContextKV cache (GB)Est. total (GB)Note
gpt-oss-20bQ4_K_M11.6264K1.6114.4Fits with 1.6 GB spare. At 128K the estimate is 16.0 GB, which is over.
Gemma 4 12BQ8_012.6764K1.4115.3Fits with 0.7 GB spare; near-lossless 8-bit.
Qwen3.8-27BUD-Q3_K_XL13.1516K1.0715.4Fits at 16K only. Strong benchmarks, 3-bit quantization.
Qwen3.6-35B-A3BUD-Q2_K_XL12.2964K1.3414.8Fits; 2-bit on a MoE, so test it on your own repo first.
Gemma 4 26B-A4BUD-Q2_K_XL10.5564K1.5513.3Fits comfortably; the Google QAT q4_0 file is 14.44 GB and needs about 16.2 GB at 16K.
Devstral Small 2Q3_K_M11.4716K2.6815.3Fits at 16K only; the cache is large.

The alternatives are real. Gemma 4 12B at Q8_0 uses 12.67 GB and gives you near-lossless 8-bit with image input. A 2-bit Qwen3.6-35B-A3B (12.29 GB) fits but we cannot say what 2-bit costs in coding quality; try it before trusting it. Qwen3.8-27B at 3-bit fits only at 16K.

24GB Tier: Qwen3.8-27B

With 24 GB, Qwen3.8-27B at UD-Q4_K_M is a 16.56 GB file and a 64K window adds 4.29 GB, for an estimated 22.0 GB. Qwen reports Terminal-Bench 2.1 of 73.0, SWE-bench Pro of 61.7 and LiveCodeBench v6 of 90.3 for it, which are the highest agentic figures of any model that fits here.

ModelQuantFile (GB)ContextKV cache (GB)Est. total (GB)Note
Qwen3.8-27BUD-Q4_K_M16.5664K4.2922.0Fits with 2.0 GB spare.
Qwen3.8-27BUD-Q4_K_XL17.6632K2.1521.0Fits with 3.0 GB spare.
Qwen3.6-35B-A3BUD-Q3_K_XL16.85128K2.6820.7Fits with 3.3 GB spare and a very long window.
Gemma 4 31BQAT q4_0 (Google)17.6532K3.5222.4Fits with 1.6 GB spare.
Devstral Small 2Q4_K_M14.3332K5.3720.9Fits with 3.1 GB spare.
Qwen3-Coder-30B-A3BUD-Q4_K_XL17.6732K3.2222.1Fits with 1.9 GB spare.
GLM-4.7-FlashQ4_K_M18.3132K1.7721.3Fits with 2.7 GB spare if the latent cache works in your runtime.

If you prefer speed, Qwen3.6-35B-A3B at UD-Q3_K_XL (16.85 GB) fits even 128K at an estimated 20.7 GB. If you need a vendor-published SWE-bench Verified, Devstral Small 2 reports 68.0% and fits at 32K. GLM-4.7-Flash gives MIT terms, and Gemma 4 31B in Google's QAT q4_0 build is 17.65 GB with a 22.4 GB estimate at 32K. For an agent harness that will drive these, see our local models with Ollama setup guide.

32GB Tier: Qwen3.8-27B at Higher Precision

At 32 GB the question changes from "what fits" to "what do I do with the extra room". Moving Qwen3.8-27B to UD-Q6_K (21.98 GB) and a 64K window gives an estimated 27.5 GB. A 128K window at Q6_K reaches 31.8 GB and leaves almost nothing. Q8_0 (29.05 GB) only works at very short context.

ModelQuantFile (GB)ContextKV cache (GB)Est. total (GB)Note
Qwen3.8-27BUD-Q6_K21.9864K4.2927.5Fits with 4.5 GB spare.
Qwen3.8-27BUD-Q6_K21.98128K8.5931.8Fits with 0.2 GB spare; too tight in practice.
Qwen3.8-27BQ8_029.0516K1.0731.3Fits with 0.7 GB spare; short context only.
Qwen3.6-35B-A3BUD-Q5_K_M26.46128K2.6830.3Fits with 1.7 GB spare.
Gemma 4 31BQ5_K_M21.6664K6.2129.1Fits with 2.9 GB spare.
Qwen3-Coder-NextUD-Q2_K_XL26.7664K1.6129.6Fits; 2-bit on an 80B MoE. Q4_K_M is 48.53 GB and needs CPU offload.

Qwen3.6-35B-A3B at UD-Q5_K_M (26.46 GB) holds a 128K window in about 30.3 GB, which suits long agent sessions. Qwen3-Coder-Next fits only at 2-bit, and its Q4_K_M file is 48.53 GB, so it needs offload. If you are choosing hardware for this tier or above, our Mac, DGX Spark and Strix Halo comparison covers unified-memory machines.

The 11 Model Families

Each section covers one family: facts we verified, license and cost, pros, cons and who should skip it. MiniMax, Kimi, Llama 4 Scout and DeepSeek V4.1 are included because readers ask about them, with an honest note that they do not fit a consumer GPU.

Qwen3.8-27B, Qwen3.6-27B and Qwen3.6-35B-A3B

Qwen logo qwen.ai

Qwen is the family that decides most of this page. Qwen3.8-27B appeared on Hugging Face in August 2026 and Alibaba's Qwen account announced the open weights on Aug 14, 2026. It is a native multimodal model with 27.78 billion parameters on the Hugging Face API. The config shows 64 layers, but only 16 of them use full attention. The other 48 use linear attention, which is why its KV cache is small for its size.

Qwen3.6-35B-A3B is the speed option. It is a mixture of experts with 35.95 billion parameters, 256 experts and 8 routed per token, and Qwen's card puts about 3B parameters active per token. Qwen3.6-27B shares the dense size of Qwen3.8-27B and is the older sibling. Our recommendation is to run Qwen3.8-27B unless you have a reason to prefer an MoE's speed.

SpecValue
Parameters (HF API)Qwen3.8-27B: 27.78B; Qwen3.6-35B-A3B: 35.95B; Qwen3.5-9B: 9.65B; Qwen3.5-4B: 4.66B
Context262,144 native for Qwen3.8-27B, extensible to 1,000,000 per the card
GGUF sizes (Unsloth)27B: UD-Q3_K_XL 13.15 GB, UD-Q4_K_M 16.56 GB, UD-Q4_K_XL 17.66 GB, UD-Q6_K 21.98 GB, Q8_0 29.05 GB
35B-A3B sizesUD-Q2_K_XL 12.29 GB, UD-Q3_K_XL 16.85 GB, UD-Q5_K_M 26.46 GB
KV cache (fp16)27B: 64 KiB per token; 35B-A3B: 20 KiB per token (our arithmetic from config.json)
Vendor-reported codingQwen3.8-27B: Terminal-Bench 2.1 73.0, SWE-bench Pro 61.7, LiveCodeBench v6 90.3; Qwen3.6-35B-A3B: SWE-bench Verified 73.4, Terminal-Bench 2.0 51.5, LiveCodeBench v6 80.4

Key features

  • Hybrid linear and full attention, so long context costs far less memory than in a plain transformer of the same size.
  • Native multimodal input, useful when an agent reads screenshots of a failing UI.
  • Ollama library tags exist for the family (for example qwen3.8:27b-q4_K_M and qwen3.6:35b-a3b), and Unsloth publishes GGUF quants for llama.cpp.
  • Qwen's own Qwen3.5-9B card lists BFCL-V4 of 66.1, the strongest tool-calling number among the small models we checked.

License and cost (checked December 3, 2026): Apache 2.0 on Qwen3.8-27B, Qwen3.6-27B, Qwen3.6-35B-A3B and Qwen3.5-9B and 4B (Hugging Face API). The weights are free; you pay for the GPU and the power it draws. We did not price hardware.

Free tier or trial: Free to download. Hosted access also exists, but this page is about local runs, so we did not check hosted prices.

Limits: The Qwen3.8-27B card says its 1M context is the hosted version's default; local runs are bounded by the KV cache you can afford. The 35B-A3B file at Q5 is 26.46 GB, so it needs the 32 GB tier or CPU offload.

Pros

  • Highest vendor-reported agentic coding scores of any model that fits in 24 GB at 4-bit.
  • Cheap cache: 4.29 GB at 64K for the 27B, versus 10.74 GB for Devstral Small 2 at the same length.
  • Apache 2.0 across the checkpoints we cover, with Ollama and llama.cpp support.
  • A full ladder of sizes from 4B to 35B-A3B means one family can serve every tier on this page.

Cons

  • A dense 27B generates more slowly than a 3B-active MoE on the same card.
  • Reasoning models spend tokens thinking, which lengthens agent loops. Check your tool's thinking settings.
  • The best scores are vendor-reported on vendor-chosen harnesses, so your own repo may differ.

Benefit for you: One family covers 8 GB to 32 GB, so you can keep a single prompt style and tool configuration while you change the model file as your GPU changes.

Standout use case: A 24 GB card running Qwen3.8-27B at UD-Q4_K_M with a 64K window as the model behind an agent such as Cline, Kilo Code or Antigravity.

Skip it if: You have 8 GB or less (use the 9B or 4B), or you want maximum tokens per second (use the 35B-A3B or gpt-oss-20b).

Qwen announces open weights for Qwen3.8-27B: a native multimodal dense model with 262K native context, extendable to 1M, which Qwen says outperforms Qwen3.7-Plus overall.

— @Alibaba_Qwen Aug 14, 2026
Qwen benchmark chart for Qwen3.6-35B-A3B from the Hugging Face model card
Benchmark chart from the Qwen3.6-35B-A3B model card. Vendor-reported. Credit: Qwen / Alibaba Cloud. We did not re-run these tests.
Qwen 3.6 vs Gemma 4: I Built the Same App With Both Locally

Video: Zero to MVP builds the same app with Qwen 3.6 and Gemma 4 locally. This is one creator's test; we did not reproduce it.

Qwen3-Coder-30B-A3B and Qwen3-Coder-Next

Qwen logo qwen.ai

Qwen3-Coder-30B-A3B-Instruct arrived in July 2025 and is the model most older local-coding guides recommend. It has 30.5B parameters with 3.3B active (Qwen's card). It is a plain transformer: all 48 layers use full attention with 4 KV heads, so its cache costs 96 KiB per token, about 50 percent more than Qwen3.8-27B's 64 KiB.

Qwen3-Coder-Next (January 2026) is an 80B model with 3B active parameters. Its 2-bit file is 26.76 GB, so it only becomes practical at 32 GB. We found no coding benchmark for it that we could verify against its own card, so we do not rank it on scores.

SpecValue
ParametersCoder-30B-A3B: 30.53B total, 3.3B active; Coder-Next: 79.67B total, 3B active
Context262,144 (Hugging Face config)
GGUF sizes30B-A3B UD-Q4_K_XL 17.67 GB; Coder-Next UD-IQ2_XXS 23.31 GB, UD-Q2_K_XL 26.76 GB, Q4_K_M 48.53 GB
KV cache (fp16)30B-A3B: 96 KiB per token (12.88 GB at 128K); Coder-Next: 24 KiB per token
Ollamaqwen3-coder:30b is in the Ollama library

Key features

  • Trained for agentic coding and tool calling from the start, with a tool-call format that Qwen documents.
  • MoE routing keeps about 3B parameters active, so tokens come quickly on a 24 GB card.
  • Broad runtime support because the 30B-A3B architecture has been in llama.cpp and Ollama for a long time.

License and cost (checked December 3, 2026): Apache 2.0 on both checkpoints (Hugging Face API). Free weights.

Free tier or trial: Free to download and run.

Limits: Coder-Next at Q4_K_M is 48.53 GB, so you need 64 GB of combined memory or heavy CPU offload. At 2-bit it fits 32 GB but with quality risk we could not measure.

Pros

  • Mature, widely supported and fast on 24 GB cards.
  • The cache math is simple and well understood by every runtime.
  • Coder-Next gives a large-model option in 32 GB if you accept 2-bit.

Cons

  • Older than Qwen3.8 and Qwen3.6, and Qwen's own newer comparison tables use the newer models.
  • Full attention on every layer makes long context expensive: 6.44 GB at 64K.
  • We found no verified coding benchmark on its card, so there is no number to cite for Coder-Next.

Benefit for you: If your tooling was tuned for Qwen3-Coder's tool format, you can keep it and still run a modern 3B-active model on a 24 GB card.

Standout use case: Fast autocomplete-style and short agent turns on a 24 GB card where latency matters more than the last few points of benchmark score.

Skip it if: You want the strongest published agentic numbers (go to Qwen3.8-27B) or you only have 16 GB or less.

Qwen3-Coder-Next benchmark chart from the Hugging Face model card
Benchmark chart on the Qwen3-Coder-Next model card. Vendor-reported; we did not transcribe the values. Credit: Qwen / Alibaba Cloud.

gpt-oss-20b and gpt-oss-120b

gpt-oss logo openai.com

OpenAI released gpt-oss-120b and gpt-oss-20b on Aug 5, 2025 under Apache 2.0, and they are still the reference MoE pair for local agents. The 20b has 20.91B parameters with 3.6B active and the 120b has 116.83B with 5.1B active, matching the model card. Both are shipped in MXFP4, which is why the Hugging Face API reports mostly U8 tensors.

That native 4-bit format is the reason gpt-oss-20b is our 16 GB pick. Every Unsloth GGUF of it, from Q3_K_M at 11.51 GB to Q8_0 at 12.11 GB, is within a gigabyte, because most of the weights were already 4-bit. You are not giving up quality to get an 11.6 GB file.

SpecValue
Parameters20b: 20.91B total, 3.6B active; 120b: 116.83B total, 5.1B active
Context131,072 (config); half the layers use a 128-token sliding window
GGUF sizes20b: Q4_K_M 11.62 GB, UD-Q4_K_XL 11.87 GB, Q8_0 12.11 GB, F16 13.79 GB; 120b (ggml-org MXFP4): 63.39 GB
KV cache (fp16)20b: 24 KiB per token; 120b: 36 KiB per token
Third-party coding figureLiveCodeBench v6 74.6 (20b) and 82.7 (120b), as printed in Qwen's Qwen3.5-9B card, not OpenAI's

Key features

  • Native function calling, web browsing and Python tool use are listed on the card, along with adjustable reasoning effort.
  • The sliding-window layers keep the cache at 24 KiB per token, so 64K costs 1.61 GB.
  • Official support in Ollama (gpt-oss:20b and gpt-oss:120b), llama.cpp and vLLM.

License and cost (checked December 3, 2026): Apache 2.0 (Hugging Face API). Free weights. The 120b needs about 64 GB of memory just for the file.

Free tier or trial: Free to download. OpenAI lists the 120b for a single 80 GB datacenter GPU and the 20b for lower-latency local use.

Limits: 131K maximum context. The model is text-only. It was released in Aug 2025, and the newer Qwen and Gemma cards we read report higher scores on recent coding benchmarks.

Pros

  • Smallest quality-preserving file in the 16 GB tier at 11.62 GB.
  • Only 3.6B parameters active, so generation is quick on mid-range cards.
  • Strong agent behavior because tool use and reasoning effort are built in.
  • Clear Apache 2.0 license with a published model card and an OpenAI announcement.

Cons

  • Released in Aug 2025, so it predates the 2026 Qwen and Gemma models, and it has no vision input.
  • Reasoning output can be long at high effort; set low or medium for routine edits.
  • The 120b is a 64 GB-class model, so it is outside every tier on this page without offload.

Benefit for you: A 16 GB GPU gets a model with native tool calling and a 64K window without dropping to 2-bit quantization.

Standout use case: A 16 GB laptop or desktop GPU running gpt-oss-20b as the local model for an agent that edits files and runs tests.

Skip it if: You need image input, or you have 24 GB or more and want the highest published agentic scores.

OpenAI announces gpt-oss-120b and gpt-oss-20b, open-weight reasoning models under an Apache 2.0 license.

— @OpenAI Aug 5, 2025

Gemma 4 12B, 26B-A4B, 31B and E4B

Gemma logo ai.google.dev

Google DeepMind announced Gemma 4 on Apr 2, 2026 as open models for your own hardware under Apache 2.0, and the Gemma account introduced the 12B on Jun 3, 2026. The 12B is described as a unified, encoder-free multimodal model. The family also has a 31B dense model, a 26B-A4B mixture of experts (128 experts, 8 active plus 1 shared) and a small E4B.

The Gemma 4 model card prints LiveCodeBench v6 for all sizes in one table: 80.0 for the 31B, 77.1 for the 26B-A4B, 72.0 for the 12B and 52.0 for the E4B. Codeforces ELO runs 2150, 1718, 1659 and 940 in the same order. These are Google's numbers.

SpecValue
Parameters (HF API)12B: 11.96B; 26B-A4B: 25.81B; 31B: 31.27B; E4B: 8.00B including embeddings
Context262,144 for 12B, 26B-A4B and 31B; 131,072 for E4B (configs)
GGUF sizes12B Q4_K_M 7.12, Q5_K_M 8.41, Q6_K 9.79, Q8_0 12.67 GB; Google QAT q4_0 12B 6.98 GB, 31B 17.65 GB, 26B-A4B 14.44 GB; 31B Q5_K_M 21.66 GB
KV cache (fp16)Global layers have 1 to 4 KV heads and the rest use a 1,024-token window, so 12B is 0.87 GB at 32K and 2.48 GB at 128K
Vendor-reported codingLiveCodeBench v6 80.0 / 77.1 / 72.0 / 52.0 for 31B / 26B-A4B / 12B / E4B

Key features

  • Google publishes quantization-aware-trained q4_0 GGUF files for the 12B, 26B-A4B and 31B, so the 4-bit file is the one the model was trained to survive.
  • Configurable thinking modes on all sizes, according to the card.
  • Ollama tags for 12B, 26B-A4B and 31B in several quantizations, including a QAT variant.
  • Very small cache growth thanks to sliding-window layers.

License and cost (checked December 3, 2026): Apache 2.0 on the 12B, 26B-A4B, 31B and E4B repos (Hugging Face API). Free weights.

Free tier or trial: Free to download.

Limits: The 31B at QAT q4_0 is 17.65 GB and needs a 24 GB card at 32K. Our Gemma cache numbers assume the fp16 layout described in the method section, so runtimes that store the sliding window differently will differ.

Pros

  • Best vendor-reported LiveCodeBench in the 12 GB tier (72.0 for the 12B).
  • QAT files remove the usual 4-bit quality question.
  • Small KV cache, so long windows are affordable.
  • Image input in all sizes we checked.

Cons

  • Google's own table covers LiveCodeBench, Codeforces and Tau2 but we found no SWE-bench or Terminal-Bench row in the Gemma 4 card.
  • In Qwen's Qwen3.6-35B-A3B table, Gemma 4 31B scores 52.0 and 26B-A4B scores 17.4 on SWE-bench Verified, against 73.4 for Qwen3.6-35B-A3B. That is a rival vendor's harness, so treat it as a data point, not a verdict.
  • The E4B is weak at coding (52.0).

Benefit for you: The 12B at Q5_K_M leaves a 12 GB card with a 1.5 GB cushion and a real 32K window, which is rare for a model with a 72.0 LiveCodeBench claim.

Standout use case: A 12 GB card running Gemma 4 12B for code review and refactors where you also paste screenshots.

Skip it if: Your agent loop depends on long multi-file SWE-bench-style tasks, where Qwen3.8-27B has the published edge.

Google DeepMind introduces Gemma 4, open models built for advanced reasoning and agentic workflows, released under Apache 2.0.

— @GoogleDeepMind Apr 2, 2026

The Gemma account introduces Gemma 4 12B, a unified, encoder-free multimodal model released under Apache 2.0.

— @googlegemma Jun 3, 2026
Gemma 4 banner image from Google AI for Developers
Gemma 4 banner from Google AI for Developers, also used on the Hugging Face model card. Credit: Google.

Devstral Small 2 (and Devstral 2)

Devstral logo mistral.ai

Mistral announced the Devstral 2 family on Dec 9, 2025 as two open coding models plus a terminal tool called Mistral Vibe. Devstral Small 2 is a 24.0B dense model with a 256K window under Apache 2.0. Devstral 2 is a 125.0B model listed as other on Hugging Face and is not a local option for any tier here.

Mistral's own table is unusually explicit about coding: Devstral Small 2 scores 68.0% on SWE-bench Verified, 55.7% on SWE-bench Multilingual and 22.5% on Terminal Bench 2. Devstral 2 scores 72.2%, 61.3% and 32.6%. That table is vendor-reported.

SpecValue
ParametersSmall 2: 24.01B dense; Devstral 2: 125.03B
Context256K per the card; config max 393,216
GGUF sizesQ3_K_M 11.47 GB, Q4_K_M 14.33 GB (Unsloth)
KV cache (fp16)160 KiB per token: 5.37 GB at 32K, 10.74 GB at 64K
Vendor-reported codingSmall 2: SWE-bench Verified 68.0%, Multilingual 55.7%, Terminal Bench 2 22.5%

Key features

  • Built for agentic coding with a tool-call chat format documented on its card.
  • Vision input, per the card.
  • Mistral Vibe CLI is the vendor's recommended front end.
  • Ollama tags devstral-small-2:24b and Q4_K_M and Q8_0 variants.

License and cost (checked December 3, 2026): Small 2 is Apache 2.0; Devstral 2 (123B) carries a license listed as other (Hugging Face API). Mistral also sells hosted access; we did not check its prices.

Free tier or trial: Free weights for Small 2.

Limits: The cache is the catch. At 160 KiB per token, 64K needs 10.74 GB on top of a 14.33 GB file, which exceeds 24 GB. On 24 GB, plan for 32K.

Pros

  • A published SWE-bench Verified score (68.0%) for a model that fits 24 GB.
  • Dense and predictable; no expert routing surprises.
  • Apache 2.0 for Small 2 and a clean tool-call format.

Cons

  • Full-attention cache is 2.5 times Qwen3.8-27B's per token, so context is expensive.
  • Qwen3.8-27B reports higher agentic numbers on newer benchmarks, although the benchmarks differ.
  • Released in Dec 2025, so it predates the 2026 Qwen and Gemma models.

Benefit for you: If you want a vendor that publishes SWE-bench Verified for the exact local checkpoint, Small 2 is one of the few.

Standout use case: A 24 GB card running Devstral Small 2 at Q4_K_M with 32K context behind Mistral Vibe or another terminal agent.

Skip it if: You need more than 32K of context on 24 GB, or you want image-heavy workflows beyond basic screenshots.

Mistral introduces the Devstral 2 coding model family in two sizes, both open source, plus Mistral Vibe, a native CLI for end-to-end automation.

— @MistralAI Dec 9, 2025

GLM-4.7-Flash and GLM-5.3-Flash

GLM logo z.ai

Z.ai introduced GLM-4.7-Flash on Jan 19, 2026 as a local coding and agentic assistant for the 30B class. It is a 30B-A3B mixture of experts, 31.22B parameters on the Hugging Face API, MIT licensed. The Z.ai card compares it with Qwen3-30B-A3B-Thinking-2507 and gpt-oss-20b.

The card reports SWE-bench Verified of 59.2 for GLM-4.7-Flash against 22.0 for Qwen3-30B-A3B-Thinking and 34.0 for gpt-oss-20b, and tau2-Bench of 79.5 against 49.0 and 47.7. These are Z.ai's numbers and the comparison models are older. GLM-5.3-Flash (Aug 2026) is a 320B model with 18B active and is a server-class model, not a local one.

SpecValue
ParametersGLM-4.7-Flash: 31.22B total, about 3B active; GLM-5.3-Flash: 320B total, 18B active (card)
Context202,752 (config)
GGUF sizesGLM-4.7-Flash UD-Q2_K_XL 11.89 GB, Q4_K_M 18.31 GB
KV cache (fp16)Uses a compressed latent cache; best case is about 53 KiB per token, so 32K is 1.77 GB
Vendor-reported codingSWE-bench Verified 59.2, tau2-Bench 79.5 (Z.ai, versus older comparison models)

Key features

  • Preserved Thinking mode for multi-turn agentic tasks, as the card instructs for tau2-Bench and Terminal Bench 2.
  • A documented glm47 tool-call parser for vLLM.
  • Ollama tags for q4_K_M, q8_0 and bf16.

License and cost (checked December 3, 2026): MIT license (Hugging Face API). Free weights.

Free tier or trial: Free to download.

Limits: The latent-cache figure is a best case. A runtime that stores the full K and V would need far more memory, so measure your own build before trusting a long window.

Pros

  • MIT license, the most permissive of the 24 GB candidates.
  • Latent cache makes 32K to 64K affordable on paper.
  • Official local-use framing from the vendor.

Cons

  • The published comparison is against 2025 models, so it does not show how it ranks against Qwen3.8-27B or Gemma 4.
  • The Q4_K_M file is 18.31 GB, the largest of the 24 GB candidates besides Qwen3.6-35B-A3B at Q4.
  • Text-only on the repo we checked.

Benefit for you: A permissive license and a small cache for teams that need MIT terms and run on a 24 GB card.

Standout use case: A 24 GB workstation running GLM-4.7-Flash with Preserved Thinking for long tool-calling sessions.

Skip it if: You want the newest benchmark leader, or your runtime does not implement the compressed cache.

Z.ai introduces GLM-4.7-Flash as a local coding and agentic assistant, setting what it calls a new standard for the 30B class.

— @Zai_org Jan 19, 2026

Granite 4.2 (3B, 8B and 30B)

Granite logo ibm.com

IBM's Granite 4.2 is a dense family in 3B, 8B and 30B sizes under Apache 2.0, with native reasoning (thinking) that can be turned off. The model card publishes more agentic numbers than most small-model vendors: for the 8B, SWE-bench Verified 47.67, SWE-bench Pro 19.11, Terminal-Bench 2.1 20.56, LiveCodeBench v6 73.24 and BFCL v4 52.39. The 30B scores 57, 33.29, 29.24, 75.77 and 61.39.

Granite is the pick when you want a small model with documented enterprise-style behavior and a long list of quantization formats (GGUF, MLX, FP8, MXFP4 and NVFP4 repos all exist). The trade-off is a heavy cache: 160 KiB per token for the 8B.

SpecValue
ParametersDense 3B, 8B and 30B
Context131,072 (config)
GGUF sizes3B Q4_K_M 2.24 GB; 8B Q4_K_M 5.35 GB, Q6_K 7.22 GB; 30B Q4_K_M 17.72 GB
KV cache (fp16)8B: 160 KiB per token; 30B: 256 KiB per token (34.36 GB at 128K)
Vendor-reported coding8B: SWE-bench Verified 47.67, LiveCodeBench v6 73.24; 30B: 57 and 75.77

Key features

  • Native thinking toggle: enable_thinking on or off.
  • A documented reasoning parser for vLLM.
  • Sizes small enough for an 8 GB card (8B) or a 24 GB card (30B at short context).

License and cost (checked December 3, 2026): Apache 2.0 (Hugging Face API). Free weights.

Free tier or trial: Free to download.

Limits: The 30B at Q4_K_M is 17.72 GB and a 32K window adds 8.59 GB, so it does not fit 24 GB beyond about 16K.

Pros

  • Unusually complete vendor benchmark table across SWE-bench, Terminal-Bench and BFCL.
  • Apache 2.0 and many formats, including a 3B that is 2.24 GB.
  • LiveCodeBench v6 of 73.24 for an 8B model, on IBM's report.

Cons

  • Large cache per token for the size.
  • The 30B's numbers are below Qwen3.8-27B's headline figures, although the benchmarks differ.
  • No vision input on the repos we checked.

Benefit for you: The 8B gives an 8 GB card a documented SWE-bench Verified score instead of a guess.

Standout use case: A small, license-clean model behind an internal agent where the compliance team wants a named vendor and a published model card.

Skip it if: You need long context on a small card.

Phi-4-reasoning-plus

Phi logo microsoft.com

Microsoft's Phi-4-reasoning-plus (April 2025) is a 14.66B dense reasoning model under MIT with a 32K context. Its card lists LiveCodeBench of 53.1 for the 2024-08 to 2025-02 window, and the Q4_K_M GGUF is 9.05 GB. It is the oldest model in this guide, and we include it because it is the Microsoft option people ask about.

Microsoft has published newer Phi-branded checkpoints since, such as Phi-4-reasoning-vision-15B (created on Hugging Face in January 2026, MIT), but we did not review them for coding, so this guide stays with the reasoning-plus model. Its 32K limit and the absence of a documented tool-calling format on its card make it a weak fit for agents.

SpecValue
Parameters14.66B dense
Context32K per the card
GGUF sizeQ4_K_M 9.05 GB (Unsloth)
Vendor-reported codingLiveCodeBench 53.1 (Microsoft)

Key features

  • Reasoning-tuned for math and science.
  • MIT license.
  • Fits a 12 GB card at short context.

License and cost (checked December 3, 2026): MIT (Hugging Face API). Free weights.

Free tier or trial: Free to download.

Limits: 32K total context, which an agent session can fill quickly.

Pros

  • MIT license.
  • Reasoning strength per parameter at release.
  • Small enough for 12 GB.

Cons

  • Old: April 2025.
  • No tool-calling format documented on the card.
  • LiveCodeBench 53.1 is below every 2026 model here.

Benefit for you: A permissive reasoning model for single-shot code questions on a 12 GB card.

Standout use case: Explaining algorithms or checking logic where you paste a short snippet.

Skip it if: You want an agent that edits many files; use Gemma 4 12B or Qwen3.5-9B instead.

DeepSeek R1 distills (and why V4.1 is not local)

DeepSeek logo deepseek.com

DeepSeek's R1-Distill-Qwen-14B and 32B (January 2025) are MIT-labelled on Hugging Face and derived from Qwen2.5, which DeepSeek's card says was originally Apache 2.0. The card lists LiveCodeBench pass@1 of 53.1 for the 14B and 57.2 for the 32B. Q4_K_M files are 8.99 GB and 19.85 GB.

The current DeepSeek flagship line, V4.1-Flash-1017 from October 2026, is a 763B-parameter checkpoint on disk. The smallest GGUF we found is 232.98 GB (UD-IQ1_S), so it is outside every tier here. The older distills remain useful as small reasoning models, and for the full current lineup see our comparison guide linked below.

SpecValue
ParametersR1-Distill 14B: 14.77B; 32B: 32.76B; V4.1-Flash-1017: 763B (HF API)
GGUF sizes14B Q4_K_M 8.99 GB, Q5_K_M 10.51 GB; 32B Q4_K_M 19.85 GB, Q5_K_M 23.26 GB; V4.1-Flash smallest 232.98 GB
Vendor-reported codingLiveCodeBench pass@1 53.1 (14B), 57.2 (32B)

Key features

  • Chain-of-thought reasoning distilled into Qwen2.5 bases.
  • Broad runtime support.
  • MIT label on Hugging Face.

License and cost (checked December 3, 2026): MIT on Hugging Face; the DeepSeek card notes the Qwen2.5 base terms. Free weights.

Free tier or trial: Free to download.

Limits: Jan 2025 era models, with no documented agent tool-calling format on the card.

Pros

  • Small reasoning models that run in 12 GB (14B) or 24 GB (32B).
  • MIT label.
  • Well tested by the community.

Cons

  • Superseded by 2026 models on every coding number we checked.
  • Long reasoning traces slow short tasks.
  • Not designed for tool calling.

Benefit for you: A cheap reasoning sidekick for algorithm questions, with permissive terms.

Standout use case: Debugging puzzle-style problems offline on a 24 GB card with the 32B.

Skip it if: You want an agent model in 2026; pick Qwen3.8-27B or gpt-oss-20b.

MiniMax M3.1 Flash

MiniMax logo minimax.io

MiniMax-M3.1-Flash (October 2026) is MiniMax's current open agentic model. The card says it has roughly 428B parameters with 23B active and reports 73.7% on DeepSWE v1.1. The license is MiniMax's community license, not Apache or MIT.

It is not a local-GPU model. The smallest Unsloth GGUF we found is 129.36 GB (UD-IQ1_M), and the 4-bit XL file is 249.40 GB. It belongs on a Mac Studio, a DGX Spark cluster or a server. We cover that hardware in the linked guide.

SpecValue
ParametersAbout 428B total, 23B active (model card)
GGUF sizesUD-IQ1_M 129.36 GB, UD-IQ2_XXS 134.95 GB, UD-Q2_K_XL 143.91 GB, UD-Q4_K_XL 249.40 GB
Vendor-reported codingDeepSWE v1.1 73.7%

Key features

  • Agentic coding and tool use focus.
  • Image-text input on the repo.
  • Unsloth GGUF quants exist.

License and cost (checked December 3, 2026): MiniMax community license, listed as other on Hugging Face. Free weights under custom terms; read them before commercial use.

Free tier or trial: Free to download.

Limits: 130 GB or more of memory for any usable quant.

Pros

  • Frontier-class open agentic scores on the vendor's report.
  • Quants available.
  • Active release cadence.

Cons

  • Needs workstation or server memory.
  • Custom license.
  • DeepSWE is not a benchmark the other vendors on this page report.

Benefit for you: Shows where the ceiling is if you later buy 192 GB or more of unified memory.

Standout use case: A 256 GB Mac or similar running the model for a team.

Skip it if: Any GPU tier in this guide.

Kimi K3.1 Pro

Kimi logo moonshot.ai

Moonshot's Kimi K3.1 Pro has 2.8 trillion total parameters with 104B active according to its card, under a custom kimi-k3.1-pro license. The card reports results on Terminal-Bench 4.0, SWE-Marathon and DeepSWE, benchmarks that differ from the ones used by the smaller models on this page.

At 2.8T parameters, even 1 bit per weight is about 350 GB, which is our arithmetic and not a vendor claim. There is no consumer-hardware path, so Kimi appears here only to mark the limit of what a VRAM guide can cover.

SpecValue
Parameters2.8T total, 104B active (model card)
LicenseCustom kimi-k3.1-pro license (other)
Benchmarks on cardTerminal-Bench 4.0, SWE-Marathon, DeepSWE

Key features

  • Frontier-scale agentic model.
  • Open weights under custom terms.

License and cost (checked December 3, 2026): Custom license, free weights. Hardware cost is the barrier.

Free tier or trial: Free to download if you have the storage.

Limits: Terabytes of storage and server-class memory.

Pros

  • Open weights at frontier scale.

Cons

  • Not runnable on the GPU tiers here.
  • Custom license.

Benefit for you: None for a 32 GB or smaller GPU; use hosted access or a cloud GPU instead.

Standout use case: Multi-node server deployments.

Skip it if: Every tier on this page.

Llama 4 Scout

Llama logo llama.com

Meta's Llama-4-Scout-17B-16E-Instruct (April 2025) has 108.64B parameters with 17B active across 16 experts. The Hugging Face repo is gated with manual approval, and the license is the Llama community license, listed as other. The smallest GGUF we found is 32.47 GB (UD-IQ1_S), so even at 1-bit it does not leave room for a cache in 32 GB.

We found no coding benchmark on the card that we could verify. Qwen3.8-27B and gpt-oss-20b are better choices for every tier here.

SpecValue
Parameters108.64B total, 17B active
Smallest GGUF32.47 GB (UD-IQ1_S, Unsloth)
AccessGated: manual approval

Key features

  • Multimodal input.
  • Very long advertised context on the card.

License and cost (checked December 3, 2026): Llama community license, free weights under custom terms.

Free tier or trial: Free after you request access.

Limits: Needs 64 GB or more of memory for sensible quants.

Pros

  • Large knowledge base.
  • Multimodal.

Cons

  • Does not fit 32 GB with a useful cache.
  • Gated download.
  • No verified coding numbers.

Benefit for you: Only relevant if you run 64 GB or more and already standardize on Llama.

Standout use case: Large-memory Macs and workstations.

Skip it if: Every tier in this guide.

License and Cost Table

Local models have no per-token price, so cost means license terms and hardware. We did not price GPUs. If you would rather rent one, see our roundups of GPU clouds and inference providers. License names come from the Hugging Face API as of December 3, 2026.

FamilyLicenseCost of the weightsGated download
Qwen logo QwenApache 2.0 on every checkpoint we cover; Qwen3.8-Flash-Next (180B) is listed as otherFree weights. You pay for hardware and power.No
gpt-oss logo gpt-ossApache 2.0Free weights. 20b fits a 16 GB card; 120b needs about 64 GB of memory in MXFP4.No
Gemma logo GemmaApache 2.0 on the 12B, 26B-A4B, 31B and E4B reposFree weights.No
Devstral logo DevstralApache 2.0 for Small 2; Devstral 2 (123B) listed as otherFree weights for Small 2. Mistral also offers hosted access; we did not check its prices.No
GLM logo GLMMIT (GLM-4.7-Flash and GLM-5.3-Flash)Free weights.No
Granite logo GraniteApache 2.0Free weights.No
DeepSeek logo DeepSeekMIT (R1 distills and V4.1-Flash)Free weights. The distills carry the base-model terms of Qwen2.5, so check before commercial use.No
Phi logo PhiMITFree weights.No
MiniMax logo MiniMaxMiniMax community license (other)Free weights under custom terms; read them before commercial use.No
Kimi logo KimiCustom kimi-k3.1-pro license (other)Free weights under custom terms; no consumer-hardware path.No
Llama logo LlamaLlama community license (other)Free weights under custom terms.Yes, manual approval

Feature Matrix

Based on model cards, Hugging Face pipeline tags, Ollama library tags and Hugging Face GGUF searches. "Not checked" means we did not verify it, not that the answer is no.

FamilyImage inputThinking modeNative tool useOllama libraryGGUF on HFArchitectureRuns in 32 GB or less
Qwen logo QwenYesYesYesYesYesBothYes
gpt-oss logo gpt-ossNoYesYesYesYesMoEYes (20b); 120b no
Gemma logo GemmaYesYesYesYesYesBothYes
Devstral logo DevstralYesNoYesYes (Small 2)YesDenseYes (Small 2)
GLM logo GLMNoYesYesYesYesMoEYes (4.7-Flash)
Granite logo GraniteNoYesYesYesYesDenseYes
DeepSeek logo DeepSeekNoYesNoYesYesDense (distills)Yes (14B, 32B)
Phi logo PhiNoYesNoYesYesDenseYes
MiniMax logo MiniMaxYesNot checkedNot checkedNoYesMoENo
Kimi logo KimiNot checkedNot checkedNot checkedNoNot foundMoENo
Llama logo LlamaYesNoNot checkedNoYesMoENo

Small Models for Tool Calling

"Best small language model for tool calling" is a common query, and the honest answer is that vendors measure it differently. Qwen reports BFCL-V4, IBM reports BFCL v4 and a Tau3 average, Google reports Tau2 and Z.ai reports Tau2. Treat the table as a set of data points, not a leaderboard.

ModelFileVendor-reported tool-use resultSource
Granite 4.2 3B2.24 GB (Q4_K_M)BFCL v4 52.41; Tau3-bench avg 45.78IBM model card
Qwen3.5-4B2.74 GB (Q4_K_M)BFCL-V4 50.3Qwen model card
Granite 4.2 8B5.35 GB (Q4_K_M)BFCL v4 52.39; Tau3-bench avg 58.06IBM model card
Qwen3.5-9B5.68 GB (Q4_K_M)BFCL-V4 66.1Qwen model card
Gemma 4 12B7.12 GB (Q4_K_M)Tau2 avg 69.0%; native function callingGoogle model card
Granite 4.2 30B17.72 GB (Q4_K_M)BFCL v4 61.39; Tau3-bench avg 62.00IBM model card
GLM-4.7-Flash18.31 GB (Q4_K_M)Tau2 79.5Z.ai model card

On those numbers, Qwen3.5-9B has the highest BFCL figure in the small group (66.1), and the 4B is a reasonable choice under 3 GB. Granite 4.2 3B is the smallest model with its own published BFCL score. gpt-oss-20b and Devstral Small 2 both document native tool calling on their cards but we found no comparable number. Whatever you pick, the quickest test is to run ten tool calls from your own agent and count the malformed ones.

Reading the Coding Benchmarks

Every number below is vendor-reported, taken from the model card or a rival vendor's card where we say so. We did not re-run any test. SWE-bench Verified asks a model to resolve real GitHub issues; SWE-bench Pro is a harder variant; Terminal-Bench measures command-line agent tasks; LiveCodeBench v6 uses competitive programming problems; BFCL and Tau2 score tool use. None of the cards we read reported Aider polyglot, so we do not cite it.

ModelSWE-bench VerifiedOther SWE-benchTerminal-BenchLiveCodeBench v6Tool useSource
Qwen3.8-27Bn/a on cardSWE-bench Pro 61.7Terminal-Bench 2.1: 73.090.3n/aQwen model card
Qwen3.6-35B-A3B73.4n/aTerminal-Bench 2.0: 51.580.4n/aQwen model card
Qwen3.5-9Bn/an/an/a65.6BFCL-V4 66.1Qwen model card
Qwen3.5-4Bn/an/an/a55.8BFCL-V4 50.3Qwen model card
Gemma 4 31B52.0 (Qwen's table)n/an/a80.0Tau2 avg 76.9%Google card; Qwen card
Gemma 4 26B-A4B17.4 (Qwen's table)n/an/a77.1Tau2 avg 68.2%Google card; Qwen card
Gemma 4 12Bn/an/an/a72.0Tau2 avg 69.0%Google card
Gemma 4 E4Bn/an/an/a52.0Tau2 avg 42.2%Google card
Devstral Small 268.0%SWE-bench Multilingual 55.7%Terminal Bench 2: 22.5%n/an/aMistral model card
GLM-4.7-Flash59.2n/an/an/aTau2 79.5Z.ai model card
Granite 4.2 8B47.67SWE-bench Pro 19.11Terminal-Bench 2.1: 20.5673.24BFCL v4 52.39IBM model card
Granite 4.2 30B57SWE-bench Pro 33.29Terminal-Bench 2.1: 29.2475.77BFCL v4 61.39IBM model card
gpt-oss-20b / 120bn/an/an/a74.6 / 82.7 (in Qwen's card)n/aQwen Qwen3.5 card
R1-Distill-Qwen-14B / 32Bn/an/an/a53.1 / 57.2n/aDeepSeek model card
Phi-4-reasoning-plusn/an/an/a53.1n/aMicrosoft model card

Three cautions. First, Qwen reports Terminal-Bench 2.1 and 2.0 for different models, and Granite reports 2.1, so the Terminal-Bench column is not directly comparable across rows. Second, the Gemma 4 SWE-bench figures are from Qwen's tables, not Google's. Third, the DeepSeek and Phi LiveCodeBench numbers come from early 2025 cards with a different version of the benchmark, so they are not comparable to the v6 numbers.

Best for X

You wantPickReason
Best on an 8 GB cardQwen3.5-9B Q4_K_MSmallest file with the best LiveCodeBench number, and a cheap KV cache.
Best 12 GB general pickGemma 4 12B Q5_K_MGoogle's LiveCodeBench v6 of 72.0 and a 1.5 GB cushion.
Best 16 GB agent modelgpt-oss-20bNative MXFP4 file of 11.6 GB, 3.6B active parameters, 64K window fits.
Best 24 GB all-rounderQwen3.8-27B UD-Q4_K_MStrongest vendor-reported agentic coding numbers of any model that fits.
Best 32 GB quality pickQwen3.8-27B UD-Q6_KLess quantization loss, still 4.5 GB of headroom at 64K.
Fastest tokens per second at 24 to 32 GBQwen3.6-35B-A3BAbout 3B active parameters per token; Qwen reports SWE-bench Verified of 73.4.
Best vendor-reported SWE-bench at small sizeGranite 4.2 8B (47.67) or Devstral Small 2 (68.0)Both vendors publish SWE-bench Verified for these exact checkpoints.
Longest context on a small cardGemma 4 12B or Qwen3.6-35B-A3BSliding-window or linear-attention layers keep the cache small.
Smallest sensible tool-calling modelQwen3.5-4B or Granite 4.2 3BBoth vendors publish BFCL v4 and the files are under 3 GB.
Frontier open weightsNone of the aboveMiniMax, Kimi, DeepSeek V4.1 and GLM-5.3 need 100 GB or more; see the Mac, DGX Spark and Strix Halo guide.

Runtime Settings That Change the Fit

The fit numbers above assume llama.cpp or a runtime built on it. A handful of settings move them. The llama.cpp server README lists the flags below; check it for your build.

  • Context size (-c, --ctx-size): sets the window and therefore the KV cache. Choose it deliberately, and confirm the value the runtime reports at load.
  • Flash attention (-fa on|off|auto): default is auto. It reduces attention memory and is usually worth leaving on.
  • KV cache type (-ctk, -ctv): allowed values include f16 (default), q8_0 and q4_0. q8_0 uses 8.5 bits per value against 16, so by our arithmetic it roughly halves the cache. We did not measure the effect on coding quality.
  • GPU layers (-ngl): number of layers in VRAM; default is auto.
  • MoE offload (--n-cpu-moe N, --cpu-moe): keeps expert weights of the first N layers, or all, on the CPU. This is how an MoE file larger than your VRAM can still run, at a speed cost we did not measure.

Runtime choice matters too. Ollama has library tags for most of the families here (qwen3.8, qwen3.6, qwen3-coder, gpt-oss, gemma4, devstral-small-2, glm-4.7-flash, granite4.2), while llama.cpp gives you every Unsloth quant. Our runtime comparison covers the trade-offs, and the best AI coding agents and VS Code agent extensions guides cover the front ends that call these models.

Common Mistakes and a Checklist

Common mistakes

  • Comparing the file size to your VRAM and stopping there. The KV cache and compute buffers come on top, and for a 64K window they can add 4 to 11 GB.
  • Assuming every 4-bit file is equivalent. Google's QAT q4_0 files and gpt-oss's native MXFP4 are formats the vendors trained or shipped; a Q4_K_M made after the fact is a different thing.
  • Setting a 128K window because the model advertises one. Most coding sessions never need it, and on Devstral Small 2 it alone would need 21.47 GB of cache.
  • Comparing benchmark numbers across vendors as if they shared a harness. SWE-bench Verified, SWE-bench Pro, Terminal-Bench 2.0 and 2.1, and Tau2 are different tests, and each vendor picks its own settings.
  • Picking the biggest model that technically loads. A model that spills layers to system RAM can slow to a crawl; a smaller model fully on the GPU is usually the better agent backend.
  • Forgetting that a mixture of experts needs all its weights in memory. A 3B-active model is fast, but the Qwen3.6-35B-A3B file is still 16.85 GB at 3-bit.
  • Trusting any VRAM table, including this one, without leaving 1 to 2 GB spare. Display output, a browser and other apps share the same card.

Checklist before you commit

  1. Write down your usable VRAM, after the desktop and any other GPU apps.
  2. Pick the tier in the quick-picks table and note the model and quantization.
  3. Check that the file size plus the KV cache for your intended window, plus about 1.2 GB, is at least 1 GB under your VRAM.
  4. Download the GGUF from the repo we list, or pull the Ollama tag.
  5. Set the context window explicitly in the runtime and confirm the loaded value.
  6. Run three real tasks from your repo: a bug fix, a multi-file change and a test-writing task.
  7. Watch for repeated tool-call errors; if they appear, try the next model in the tier before changing the agent.

How We Evaluated

We read Hugging Face model cards and config files, queried the Hugging Face API for parameter counts and licenses, listed GGUF repos from Unsloth, Google, IBM and ggml-org for file sizes, checked Ollama library tags, read the llama.cpp server README, and verified X posts and YouTube videos before embedding them. All of it was read on December 3, 2026. We computed KV-cache sizes from config.json with the formula above and added a flat 1.2 GB allowance. We did not run any model on a GPU and did not measure tokens per second, so the fit tables are estimates and the "fits" labels mean the estimate is under the stated VRAM.

We left out AesCode-32B (a Microsoft HTML design generator) because it is not a general coding model. We did not review Reddit threads. The model list in the topic notes was out of date in places, so we replaced older versions with the current ones on Hugging Face.

FAQ

What is the best local LLM for coding right now?

It depends on your VRAM. On our numbers, Qwen3.8-27B is the best all-round pick once you have 24 GB, because Qwen reports Terminal-Bench 2.1 of 73.0 and SWE-bench Pro of 61.7 for it and its KV cache is small. At 16 GB, gpt-oss-20b is the sensible choice. At 12 GB, Gemma 4 12B. At 8 GB, Qwen3.5-9B. All four are Apache 2.0. The benchmark numbers are vendor-reported and use different harnesses, so test your own repository before committing.

What is the best local LLM for coding with 8GB of VRAM?

Qwen3.5-9B at Q4_K_M is a 5.68 GB file. With a 16K window we estimate about 7.4 GB in total, which leaves 0.6 GB spare. Qwen reports LiveCodeBench v6 of 65.6 and BFCL-V4 of 66.1 for it. Granite 4.2 8B (5.35 GB) is the alternative if you want IBM's published SWE-bench Verified of 47.67, but its cache is five times larger per token, so you are limited to roughly 8K.

What is the best local LLM for coding with 12GB of VRAM?

Gemma 4 12B at Q5_K_M (8.41 GB) with a 32K window, estimated at 10.5 GB total. Google reports LiveCodeBench v6 of 72.0 for it. If you want a longer window, Qwen3.5-9B at Q6_K (7.46 GB) reaches 64K at an estimated 10.8 GB.

What is the best local LLM for coding with 16GB of VRAM?

gpt-oss-20b. The Q4_K_M file is 11.62 GB because the weights are natively MXFP4, and a 64K window brings the estimate to 14.4 GB. Gemma 4 12B at Q8_0 (12.67 GB, 15.3 GB at 64K) is the near-lossless alternative with image input. A 128K window on gpt-oss-20b is estimated at 16.0 GB, which is over the limit.

What is the best local LLM for coding with 24GB of VRAM?

Qwen3.8-27B at UD-Q4_K_M (16.56 GB) with a 64K window, estimated at 22.0 GB. If you care more about tokens per second than the top benchmark numbers, Qwen3.6-35B-A3B at UD-Q3_K_XL (16.85 GB) activates only about 3B parameters per token and fits a 128K window at an estimated 20.7 GB. Devstral Small 2, Gemma 4 31B QAT and GLM-4.7-Flash also fit, with 32K windows.

What about 32GB of VRAM?

Move the same Qwen3.8-27B up to UD-Q6_K (21.98 GB) and run a 64K window at about 27.5 GB, or use Qwen3.6-35B-A3B at UD-Q5_K_M (26.46 GB) with a 128K window at about 30.3 GB. Q8_0 of the 27B (29.05 GB) only fits at very short context. Qwen3-Coder-Next at 2-bit (26.76 GB) fits, but we cannot say how much quality 2-bit costs.

How did you calculate whether a model fits?

Estimated memory is the GGUF file size from Hugging Face, plus the KV cache computed from each model's config.json, plus a flat 1.2 GB for compute buffers and the CUDA context. The 1.2 GB is our assumption, not a measurement. The method section shows the formula. We did not run these models on GPUs, so treat every row as an estimate and leave 1 to 2 GB spare.

Does a bigger quantization always help coding quality?

Not always, and we cannot quantify it. Lower bit widths shrink the file but we found no vendor benchmark of coding quality per quantization level for these models. Google's QAT q4_0 files and gpt-oss's native MXFP4 are the exceptions: those formats are what the vendors trained or shipped. For everything else, prefer Q4_K_M or higher and compare outputs on your own code.

What is the best small language model for tool calling?

On vendor numbers, Qwen3.5-9B lists BFCL-V4 of 66.1 and the 4B lists 50.3 in Qwen's card. IBM lists BFCL v4 of 52.41 for Granite 4.2 3B, 52.39 for the 8B and 61.39 for the 30B. Gemma 4 12B lists a Tau2 average of 69.0% and native function calling in Google's card. Harnesses differ across vendors, so these are not a leaderboard. gpt-oss-20b and Devstral Small 2 document native tool use on their cards but we found no comparable number.

What do people on Reddit recommend for local coding models?

We did not survey Reddit threads, so we cannot report a community consensus. We built this guide from Hugging Face model cards, GGUF file listings, config files and vendor announcements, which anyone can re-check. If a thread recommends a model we left out, compare its file size and cache math against the tables here.

Can I run these models on a Mac or an AMD or NVIDIA mini PC instead of a GPU?

The same arithmetic applies to unified memory, but you must leave room for the operating system and other apps, and memory bandwidth decides speed. We cover Apple Silicon, DGX Spark and Strix Halo in our hardware comparison, which also explains why 100 GB-plus models such as MiniMax M3.1 Flash need that class of machine.

Are these models free for commercial use?

Qwen3.8-27B, Qwen3.6, Qwen3.5, Qwen3-Coder, gpt-oss, Gemma 4, Devstral Small 2 and Granite 4.2 are Apache 2.0 on Hugging Face. GLM-4.7-Flash, DeepSeek R1 distills and Phi-4-reasoning-plus are MIT, although the DeepSeek distill card notes the Qwen2.5 base terms. MiniMax, Kimi and Llama use custom licenses, and Llama 4 Scout is gated. Read the license file for your own situation; this is not legal advice.

Numbers in this FAQ are estimates or vendor reports as labelled; see the sources list.

Sources

All fetched on December 3, 2026 unless noted.