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.
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.
Just barely too small
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
Related guides
Frequently asked questions
What does '3.6B active' actually mean for inference speed?
Should I pick gpt-oss 20B or Qwen3 30B-A3B?
What GPU do I need to run gpt-oss 20B all-resident?
Does the 3.6B active count lower the VRAM math?
Related tools
RAM Latency Calculator
Convert DDR3/DDR4/DDR5 timings (CL, tRCD, tRP, tRAS) into true latency in nanoseconds.
Use toolPower Cost Estimator
Estimate annual electricity costs for your PC, Server, or TV.
Use toolData Transfer Calculator
Calculate file transfer time or the speed you need over USB, Wi-Fi or Ethernet, with latency.
Use toolMemory and Storage Throughput Visualizer
Visualize the large speed gap between CPU cache, RAM, and storage.
Use tool