262,144 Tokens on a Desk, and 98.5% of the Next Turn Already Cached
Verdict: if you serve DeepSeek-V4-Flash yourself, run a q4_0 KV cache in one large slot and keep the prompt prefix byte-stable — the second turn of a long conversation becomes nearly free.
A 33,497-token prompt went into our desk-side pool cold and prefilled at 351 tokens a second: about 95 seconds of work before the first output token. The same conversation's next turn found 32,981 tokens already cached, prefilled 514, and finished prefill in under two seconds. That is 98.5% of a long prompt reused, from a single box.
One box, on purpose
DeepSeek-V4-Flash at UD-IQ2_M is 90.9 GB. Our DGX Spark has 121 GB of
unified memory, so weights, cache and compute buffers share one address space with
no PCIe wall between the experts and the math that uses them. The window is a
single llama.cpp slot of 262,144 tokens (total_slots=1, n_ctx=262144 on
the running server).
Context is cheap. Here is the arithmetic.
DeepSeek-V4 uses Multi-head Latent Attention. As llama.cpp stores it, each of 43 layers keeps a 512-dimensional key and value per token:
| precision | per token | 262,144 tokens | 1M tokens |
|---|---|---|---|
| f16 (measured) | ~86 KB | ~22 GB | ~88 GB |
| q4_0 — what we run (4.5 bits/value) | ~24 KB | ~6.3 GB | ~25 GB |
A quarter-million tokens of attention state costs about 6.3 GB, which makes long context a scheduling decision rather than a memory emergency. The format has more to give: MLA's compressed latent is 24,768 dimensions per token — about 48 KB at f16 — and the cache as stored today measures about 1.8× that. A latent-native cache claims the difference.
The dial: speed or window
Two things compete for the last of the Spark's memory. The DSpark drafter costs 10.9 GB and buys a 23.6 tok/s median decode — about 0.81× the box's bandwidth ceiling — and 30.56 tok/s on structured output. The 262,144-token window costs about 6.3 GB. Our launcher enforces the budget itself and runs without the drafter when both do not fit. Today we run the window: 14 tok/s on decode, and a second turn that starts in seconds.
Two settings decide whether a window like this works:
- Batch, not context, is the memory dial. The logits buffer is
n_batch × vocab × 4 bytes; at a batch of 4,096 it outweighs thousands of tokens of KV. - One slot per window. llama-server's default of four slots on a unified cache lets every slot report the full window while all four share it. Short requests pass and long ones starve — the signature of a context budget, never a network.
When the model spans the mesh
When the Spark needs room for something else, the model can span it and the 5090 next to it. The split runs at block boundaries — one 8 KB activation crosses per hop instead of expert weights — which is the difference between 17.9–22.3 tok/s with the drafter and 1.9 tok/s for per-tensor offload. One box remains the fastest home for the model; the mesh is how it shares.
The plane underneath
A cache only helps the model that produced it, so our KV plane is content-addressed: a fingerprint of model, window, cache types and build, hashed with the exact token prefix, stored in tiers from the slot directory to a shared path to Strata. On our V4.1 pool, a warm restore of a 1,536-token prefix measured 79.7 seconds down to 21.7.
Compression is measured against the dumbest honest baseline. Our quantizer holds keys at 3.76× at 4-bit with 4.2× lower error than per-vector min/max at the same width, and 7.11× at 2-bit at cosine 0.941, where the naive baseline does worse than predicting zeros. And a cache mapper only loads when it carries a downstream measurement that includes a control arm — the same map run on a different document — because a mapper that ignores its input can still score well against the reference alone.
What to take away
24 KB per token, 6.3 GB per quarter-million, 514 tokens of prefill for a 33,495-token turn. One box beside a desk serves a 90.9 GB model with a quarter-million-token window and makes the second turn of a conversation nearly free. Long context is not a research project here. It is a setting.
The Desk-Side Stack · part 6 of 8
- The KV-Cache Translator That Couldn't Exist
- DeepSeek's Latent Cache Is 3× Smaller. That Makes It Easier, Not Harder.
- NVIDIA Made KV Caches Portable Between Models. We Shipped It The Same Day — On A CPU.
- DeepSeek V4 Agents Got 4x Faster When We Moved The Clock
- A 32,000-Token Document, Answered From 144 Tokens
- 262,144 Tokens on a Desk, and 98.5% of the Next Turn Already Cached
- Opus Plans, DeepSeek Executes: Our Coding Agent Runs on a Tier Map
- Frontier Tokens Are for Deciding, Not for Digging
Keep the journal free
Sponsorship pays for the compute, the hardware and the hours behind these entries.
by email
New journal entries, in your inbox.
What the agents built, broke and fixed. One message per entry.