How much VRAM does gpt-oss 20B need at Q4_K_M? OpenAI's first open-weight model since GPT-2

By TechCompare · Updated · How we check

gpt-oss 20B at Q4_K_M is an easy first local model. It needs about 17.0 GB at its full 128K context, reasons decently for its size, and comes from OpenAI under Apache 2.0.

Calculator

Estimated VRAM required

17.0 GB

20B params at Q4_K_M, 131,072 token context, batch 1, inference.

Weights
12.2 GB
KV cache
3.3 GB
Overhead
1.6 GB
Doesn't fit in 16 GB of VRAM at Q4_K_M with 128K of context. Lower the context to 64K (15.2 GB) to fit a single RTX 5060 Ti 16GB. Or keep all 128K of context with Q3_K_M (14.4 GB). Quants below Q4_K_M lose noticeable quality.

Estimate accuracy: Weights within ~3% of most GGUF files from Q4_K_M up, ~7% for Q3_K_M and Q2_K. KV cache within ~5% for standard GQA models, ~10% for MLA or hybrid state estimates. Real VRAM may vary with framework (vLLM vs llama.cpp vs Transformers), Flash Attention, and driver overhead.

Sliding-window attention applied: This model caps 1 of every 2 layers at a 128-token window. KV cache estimate is 50% smaller than naive full-attention math at this context length.

Hardware that fits

Unified memory machines show a model budget, not their installed memory. We hold back 8 GB for the system, or use the vendor's GPU limit when that's lower. It's a planning estimate, not a hard limit.

RTX 3090
Consumer
24 GB
71% used
Apple M5 32GB
Unified
~24 GB
71% of estimate
RTX 5090
Consumer
32 GB
54% used
A100 40GB
Datacenter
40 GB
43% used

Just barely too small

RTX 5060 Ti 16GB
Consumer
16 GB
short by 1.0 GB

gpt-oss 20B at Q4_K_M with native 128K context needs about 17.0 GB of VRAM with all experts resident. It's an MoE with 3.6B active parameters per token, 24 layers, an unusual hidden size of 2880, head_dim 64, and 128K native context. The 20B variant of OpenAI's first Apache 2.0 release is the smallest model in the family and is intentionally sized for laptops and consumer GPUs.

How this is calculated

12.2 GB of weights at Q4_K_M plus a 3.3 GB KV cache (at the full 128K context window) and ~1.6 GB overhead, for about 17.0 GB total. The cache stays small because every other layer only keeps a 128 token sliding window, so just 12 of the 24 layers hold the whole context.

Verdict

A 24 GB consumer card (RTX 3090/4090/5090) is enough for resident mode at the full 128K context. Smaller cards can move expert weights to system RAM, at the cost of slower tokens. Pick gpt-oss over Qwen3 30B-A3B for the Apache 2.0 license and OpenAI lineage at the same footprint. Pick Qwen3 30B-A3B if raw quality matters more.

More gpt-oss scenarios

Kimi K3.1 Pro at Q4_K_M
A 2.78T expert pool with 24 latent attention layers and fixed state in the other 69.
View details
Mistral Large 4 at Q4_K_M
A 1T expert pool with 63 latent cache owners and 44 layers that also store an index key.
View details
Muse Spark Open at Q4_K_M
Only 16 of its 62 layers grow with context, and the other 46 hold a 2,048 token window.
View details

Frequently asked questions

What does '3.6B active' actually mean for inference speed?
Per token, the model only computes through 3.6B parameters worth of expert weights even though all 20B must be reachable. That makes each token cheaper to compute than a dense 20B model, but it doesn't shrink memory, because the next token can pick different experts. If expert weights sit in system RAM instead of VRAM, every token gets slower.
Should I pick gpt-oss 20B or Qwen3 30B-A3B?
Qwen3 30B-A3B is generally stronger at the same active footprint (3B active vs 3.6B). gpt-oss has cleaner licensing and OpenAI lineage. Both fit on the same hardware, so try whichever fits your stack first.
What GPU do I need to run gpt-oss 20B all-resident?
A GPU with at least 24 GB is the practical target for full resident mode at the 128K native context: 12.2 GB of weights plus 3.3 GB KV cache plus 1.6 GB overhead = roughly 17.0 GB. A 16 GB RTX 4080 won't quite fit all-resident, while a 24 GB RTX 3090/4090 has useful headroom.
Does the 3.6B active count lower the VRAM math?
No. The 3.6B figure is what each token computes through, not what has to stay loaded. Different tokens pick different experts, so all 20B parameters need a place in fast memory for full speed. Moving expert weights to system RAM cuts VRAM, but the host then has to hold them and every token gets slower.