← All guides

How Much VRAM Does gpt-oss 120B Need at Full 128K Context? About 4.5 GiB of Cache, Not 9

A 117B-parameter model with a 128K context window sounds like it needs a rack. It does not. gpt-oss 120B costs about 65GB of weights plus roughly 4.5 GiB of KV cache at the full 131,072-token window, so the whole job lands near 70GB. The reason is in its config.json: half of its 36 layers use a sliding window of 128 tokens and can never grow their cache. This page shows the arithmetic and names the machines that hold it.

Bottom Line

  • The full 131,072-token window costs about 4.5 GiB of KV cache at fp16. Not 9 GiB, which is what the naive calculation gives.
  • The reason is sliding-window attention. 18 of the 36 layers only ever attend to 128 tokens and cost about 4.5 MiB in total.
  • The weights dominate. Hugging Face safetensors shards total 61.48 GB; the Ollama gpt-oss:120b tag is listed at 65GB, MXFP4, 117B parameters.
  • Budget roughly 70GB for the whole job at full context, then add runtime headroom on top.
  • 96GB VRAM fits it with about 25GB spare. A 128GB unified box fits it comfortably. 64GB does not fit at all — the weights alone exceed it.
  • A 4-bit cache saves you almost nothing here. Halving 4.5 GiB frees 2.25 GiB on a ~70GB job. Spend the quality elsewhere.
  • Verify what your runtime allocated. A runtime that ignores the sliding window reserves 9.0 GiB instead, and that gap is bigger than any cache-quantisation setting you can change.

The Arithmetic, From the Model’s Own Config

Every number below comes from the config.json published with openai/gpt-oss-120b, read on 25 August 2026. Nothing here is from memory.

FieldValue
num_hidden_layers36
layer_typesstrict alternation: sliding_attention, full_attention, repeated
sliding_window128
num_key_value_heads8
head_dim64
max_position_embeddings131,072
num_local_experts / num_experts_per_tok128 / 4
quant_methodmxfp4

The KV cache holds one key and one value per key-value head, per layer, per token. So the per-layer, per-token cost at fp16 is:

2 (K and V) x 8 (kv heads) x 64 (head_dim) x 2 bytes = 2,048 bytes = 2 KiB

Now split the layers, because they do not behave the same way.

Layer groupCountTokens cached eachCost at the full window
full_attention18131,07218 x 131,072 x 2,048 = 4,831,838,208 B = 4.5 GiB
sliding_attention18128, always18 x 128 x 2,048 = 4,718,592 B = 4.5 MiB
Total36~4.5 GiB

The sliding half is not a rounding error you should keep track of. It is a thousand times smaller than the other half. At the full window it is 0.1% of the cache.

Compare that with the number you get if you assume all 36 layers cache the whole window:

36 x 131,072 x 2,048 = 9,663,676,416 B = 9.0 GiB

Exactly double. That 9.0 GiB figure is what a generic VRAM calculator will hand you, and it is what most sizing pages quote for a model of this shape.

What the Whole Job Costs

ComponentSizeNote
Weights, MXFP4 (Hugging Face shards)61.48 GB15 safetensors files, summed as displayed
Weights, Ollama gpt-oss:120b tag65 GBDifferent packaging of the same MXFP4 model
KV cache, fp16, full 131,072 tokens4.5 GiBDerived above
KV cache, 8-bit, full window~2.25 GiBHalf of the above
Compute buffer, activations, runtimeNot quotedVaries by runtime; leave real headroom
Working total at full context~70 GBPlus headroom

We are quoting the two weight figures separately and not averaging them. They are different distributions of the same model and they are measured differently. Use the 65GB Ollama figure if you pull it with Ollama, and the 61.48GB figure if you pull the safetensors.

Which Machines Hold It

MemoryFits at full context?Verdict
24GB / 32GBNoNot close. The weights are twice the card.
64GBNoThe weights alone exceed the pool before any context.
96GB VRAMYes, ~25GB spareThe fast option. Highest bandwidth, so the highest tokens per second.
128GB unifiedYes, comfortablyFits with room for a second model. Lower bandwidth, so slower.
256GB+YesOverkill for this model alone.
NVIDIA RTX PRO 6000 Blackwell 96GBThe fast fit. Holds the ~70GB job on one card with headroom.
NVIDIA DGX Spark 128GBThe unified-memory fit. Comfortable capacity, much lower bandwidth.
ASUS Ascent GX10 128GBThe same GB10 silicon as the Spark, usually for less money.

Capacity is not speed. All three hold the model. The 96GB card runs it several times faster than either 128GB box, because memory bandwidth governs tokens per second. Choose on which side of that trade you sit, and see is 96GB of VRAM enough in 2026 for the wider tier argument.

The Thing Nobody Else Says About This Model

The usual rule is that a bigger model buys you less context, because the cache scales with layer count and hidden size. gpt-oss 120B breaks that rule. A 117B-parameter model here carries a full 128K window for 4.5 GiB, which is less than many 30B dense models charge for the same window.

The tradeoff is real and worth naming, because the config makes it explicit. A 128-token sliding window is very short. In half of this model’s layers, a token can attend no further back than 127 positions. Long-range recall in those layers is gone by construction. The model compensates through the 18 full-attention layers, and the design is a deliberate exchange of long-range attention breadth for cache size.

So the honest framing is not “this model is more efficient.” It is: this model spends its long-range attention budget in half its layers and charges you half the cache. If your work depends on precise recall of something 100,000 tokens back, test that specifically rather than trusting the window number. Our context window traps for local agents page covers how that failure looks in practice.

Check What Your Runtime Actually Reserved

The 4.5 GiB figure assumes the runtime implements the short cache for the sliding layers. Not every configuration does. If your loader reports about 9 GiB of KV cache for this model at 128K, it is allocating a full-length cache for all 36 layers, and you are paying double for memory you cannot use.

That is a larger saving than any cache-quantisation option. Fix the allocation before you reach for KV cache quantisation, which on this model saves only about 2.25 GiB on a 70GB job and costs quality to get it.

See Also

Sources

Every cache figure on this page is arithmetic derived from the published config, not a measured allocation. Runtimes add their own buffers and some ignore the sliding window entirely. Check your own loader’s reported cache size against these numbers.

Need OpenClaw fixed live?

Remote rescue sessions for gateway, auth, tunnel, VPS, and model access problems.

See Rescue Session

Read next

Dense 70B or MoE 120B: Which Is the Better Local Model in 2026?
Same disk footprint, very different memory shape. A dense 70B costs 327,680 bytes of KV cache per token; Laguna S 2.1 at 118B costs 49,152. On a 48GB card that is under 20K tokens of context against more than 100K. The layer math, the speed ceiling, the one thing sliding-window attention takes away, and which to run at 48GB and 96GB.
DeepSeek V4-Flash vs gpt-oss-120b: Best Big MoE for Unified Memory?
Compare DeepSeek V4-Flash and OpenAI gpt-oss-120b for 64GB-192GB unified-memory machines: quant sizes, active params, real local context limits, and licenses.
Is 96GB of VRAM Enough for Local AI in 2026?
96GB is the first tier where a dense 70B runs at its full 128K window: 42.5GB of Q4 weights plus exactly 40 GiB of FP16 KV cache is 82.5GB, and it fits. What 96GB unlocks, what it still cannot hold, and what the one card that has it costs in 2026.
How Much SSD Do You Need for a Local Model Library?
Every local-LLM build guide sizes the GPU and forgets the disk. Real footprints, the hoarding multiplier nobody warns you about, load-time arithmetic per drive class, and the honest answer to whether a faster SSD makes your tokens faster. It does not.