After a restart, a 524k-token prompt is back in 2.8 seconds, not 8 minutes

When a vLLM engine restarts, its prefix cache is gone and a 524k-token prompt takes about 8 minutes to recompute. A new engine that read the prefix back from KVStash reached the first token in 2.45-3.24 s across 6 L40S machines, and every machine passed the answer checks. While an engine still holds a prompt, its own cache is the faster path; KVStash is for when it no longer does.

Last updated

  • 474 s→2.77 s

    Time to first token in a new vLLM engine for a 524,231-token prompt: recomputed, or read back from KVStash (medians across 6 machines).

  • 145.6-194.2x

    Faster than recomputing, across 6 machines (median 171.8x). Text prompt, tokenization included. Compared with vLLM's own cache in the FAQ.

  • 5 of 5

    Passkeys answered after the reload on every machine, identical to vLLM's own cache.

  • vLLM 0.25.1 with the KVStash native connector, GLM-4-9B-chat-1M (fp8 KV cache), one NVIDIA L40S per machine, store on the same host over TCP, 6 Modal machines, 4 Nov 2026.
  • Median of 5 timed requests per machine.

Every machine, every check

Same image, model, prompt and settings on each machine. The read-back time varies between machines; the answers and the bytes do not.

Figure 1Time to first token per machine

MachineRecomputedRead from KVStashFastest to slowest repFaster byAnswer with 16 tokens: KVStashAnswer with 16 tokens: vLLM's own cacheAnswers after reload
Machine 1 476.4 s 2.45 s 2.27-2.48 s 194.2x 3.28 s 2.34 s 5/5 correct, identical to engine cache
Machine 2 463.7 s 3.05 s 2.99-3.07 s 151.9x 3.88 s 2.14 s 5/5 correct, identical to engine cache
Machine 3 489.9 s 2.93 s 2.77-2.99 s 167.4x 3.75 s 2.35 s 5/5 correct, identical to engine cache
Machine 4 462.0 s 2.62 s 2.57-2.65 s 176.2x 3.44 s 2.16 s 5/5 correct, identical to engine cache
Machine 5 472.1 s 3.24 s 3.20-3.27 s 145.6x 4.06 s 2.35 s 5/5 correct, identical to engine cache
Machine 6 478.1 s 2.56 s 2.54-2.61 s 186.8x 3.38 s 2.13 s 5/5 correct, identical to engine cache
  • 524,231-token prompt, text prompt (tokenization included), vLLM 0.25.1, GLM-4-9B-chat-1M, fp8 KV, one L40S per machine, block 64, KVStash on the same host.
  • Median of 5 timed requests after 1 discarded.
  • Answer with 16 tokens: time to the 16th generated token.
  • KVStash: the timed requests, median of 5. vLLM's own cache: the same engine answering one of five questions after the prompt from its prefix cache with the store not running, median of 5.
  • Measured 4 November 2026 on Modal.

How each result is verified

The rules were written before the runs; check.py applies them to the raw files, and every machine passes all five below. check.py also tests a sixth rule, a predicted 120-140x band, which every machine fails by coming out faster; the FAQ explains it.

  1. Same setup. Container image pinned by digest, model revision pinned, and every script and binary checked against recorded SHA-256 hashes.
  2. Correct without the store. With no store running, vLLM answers all five passkeys hidden at 10%, 30%, 50%, 70% and 90% of the prompt.
  3. Correct with the store. After the prefix is read back from KVStash, all five answers are correct and byte-identical to vLLM's own cached answers.
  4. Counted, not assumed. Every timed request hits 8,191 blocks and reads 21.47 GB according to kvblockd's Prometheus counters, with zero aborted connections.
  5. Recomputed from raw data. Medians and speed-ups are recalculated from the per-request records, not copied from logs.

Token-ID requests and block size

Two side measurements on one of the machines, each a single change from the main setup.

Figure 2Same machine, three settings

SettingRecomputedRead from KVStashFaster by
Text prompt, block 64478.1 s2.56 s186.8x
Text prompt, block 32477.6 s2.53 s188.8x
Token ids, block 64476.9 s1.89 s252.7x
  • One Modal L40S machine, same prompt and model, 4 November 2026.
  • Token-ID: the client sends token ids, so tokenizing the prompt is outside the clock (a separate convention).
  • Block 32 vs 64: vLLM KV block size.

Setup

Engine
vLLM 0.25.1, official image pinned by digest (sha256:f0b9a0dc...), eager mode, one request at a time
Connector and store
KVStash native vLLM connector, build 5bfab21 with batched block copies (wheel SHA-256 6df06bd9...; not the vllm-kvblockd package on PyPI), kvblockd daemon on the same host, 32 GiB DRAM arena, fresh store per run
Model
THUDM/glm-4-9b-chat-1m at revision f8579ac0, KV cache fp8 (40,960 bytes per token) in both arms, KV block size 64
Prompt
524,231 tokens of deterministic text with five passkeys at 10% to 90% depth (seed 42, SHA-256 795ab1d2...)
Machines
NVIDIA L40S 48 GB on Modal, 6 separate containers across 3 workspaces, 16 or 32 CPU cores
Counters
kvblockd Prometheus /metrics captured before and after each pass and every 2 s; vLLM metrics every 10 s

Method

  1. Each machine runs one container: vLLM 0.25.1, the KVStash connector and daemon, the model, and a fixed 524,231-token prompt with five passkeys.
  2. Cold: the prompt is computed from scratch with no store running (this is also the reference for the answers).
  3. Populate: a fresh store, the prompt computed once more while the connector writes its KV blocks.
  4. Warm: a new engine with its own prefix cache off, so every request must read the prefix back from KVStash. One warm-up request is discarded, then 5 timed requests; the median is reported.
  5. After the timed requests, the five passkey questions are asked again through the store and compared with the cold reference.
  6. kvblockd Prometheus counters are captured before and after every pass and scraped every 2 s; every timed request must hit the expected 8,191 blocks and read 21.47 GB.

Limits of this study

  • Slower than vLLM's own prefix cache: answering a question with 16 tokens took 1.4-1.8x as long through KVStash as from vLLM's own cache while the engine held the prompt. The gain is over recomputing, which is what a restarted or new engine does without a store.
  • One request at a time, store on the same machine over loopback TCP. Not a serving load test, and no network in the path: over 50 GbE the 21.47 GB need at least about 3.5 s on the wire.
  • vLLM 0.25.1 with connector build 5bfab21, not the current vLLM release or the package on PyPI; KV cache in fp8 in both the cold and warm arms.
  • Text-prompt times include tokenizing the 524k-token prompt; the token-ID row excludes it.
  • The cold time is measured on a boot with prefix caching on (it also produces the reference answers); this inflates the denominator by under about 0.5%.
  • A pre-run check of loopback write speed was relaxed to 0.8 GB/s for Modal hosts (they measured 0.94-1.18 GB/s); writes are not part of the timed reads.
  • check.py prints NOT VERIFIED for every machine because each speed-up is above the 120-140x band set beforehand from two AWS runs (134.5x and 126.2x on a g6e.2xlarge with block 32 on 1 September); every other rule passes. The token-ID row is also above its own planned band of 170-195x.

Check it yourself

The per-machine table, the raw results of every pass, the Prometheus snapshots and the checker are all here. Run python3 check.py <cell folder> on a raw bundle to recompute the timing figures; the two answer-time columns are medians read from fused-A2.json and fused-C.json in the same bundle.

Questions about this study

Changelog. 4 November 2026: first publication, measured the same day on Modal. 9 November 2026: added the like-for-like comparison with vLLM's own cache from the same raw records (KVStash is slower), the AWS results behind the predicted band and what check.py prints, the network floor for a remote store, the connector build, and fixed a number that did not render.

Is KVStash faster than vLLM's own prefix cache?

No, it is slower. Compared like for like, answering a question with 16 generated tokens took 2.13-2.35 s from vLLM's own prefix cache while the engine still held the prompt, and 3.28-4.06 s through KVStash: 1.4-1.8x as long. Generating the 16 tokens took 0.82 s both through KVStash and in the cold pass on the same engine (the own-cache pass records only the total), which puts vLLM's own time to first token at roughly 1.3-1.5 s against 2.45-3.24 s from KVStash. What KVStash adds is that the cache survives: a restarted or second engine gets it back instead of recomputing for 462-490 s.

Why is there a range and not one number?

Because the read-back time depends on the machine. The same container image, model, prompt and settings gave 145.6x to 194.2x across 6 Modal L40S machines, and 134.5x on an AWS g6e.4xlarge (L40S) on 2 September 2026 (477.6 s recomputed, 3.55 s read back; 126.2x on a g6e.2xlarge with block 32 on 1 September). The recompute time hardly moves (about 462-490 s); the read-back time does. We quote the range and the median, never the best machine alone.

What about a store on another machine?

Not measured in this study: the store ran on the same machine over loopback TCP, moving 21.47 GB per request. Over a network the link sets a floor for the whole read: the store alone delivered 6.22 GB/s between two machines on 50 GbE, so these bytes need at least about 3.5 s on that link, and about twice that on 25 GbE. Study 3 (Figure 3) measured an engine with the store on a separate AWS instance, 25 Gbit/s away, at up to 110k tokens; a two-machine run at 524k is planned.

Did reading the cache back change the answers?

No. On every machine the five passkey questions, asked at five depths of the 524k-token prompt, were answered correctly before and after the reload, and the answers after the reload were byte-identical to the answers vLLM gave from its own prefix cache.

What is the token-ID row?

A separate convention: the client sends token ids instead of text, so tokenizing the 524k-token prompt is outside the clock. It is shown in its own row (252.7x against recomputing, on one machine) and never mixed with the text-prompt numbers.

Which engine version is this?

vLLM 0.25.1, pinned by image digest, with KVStash connector build 5bfab21. That is not the current vLLM release, and not the vllm-kvblockd package on PyPI. A rerun with the released package on the current vLLM release is planned; until then this study covers only the stack named here.

Can I check these numbers myself?

Yes. Download the raw results and run check.py: it recomputes the timing figures from the per-request records and the Prometheus snapshots, checks the answers and counters, and prints PASS or FAIL for each rule. Every rule passes except one, R5c: the speed-up had to fall inside 120-140x, a band set beforehand from two AWS runs (134.5x on the AWS g6e.4xlarge (L40S) and 126.2x on a g6e.2xlarge with block 32 on 1 September). Every Modal machine read back faster, so every result is above the band and check.py prints NOT VERIFIED. We kept the rule as written rather than change it after the runs. check.py does not compute the two answer-time columns: they are the medians of needles[].elapsed_s in fused-A2.json (vLLM's own cache) and of reps[].total_s in fused-C.json (KVStash), in the same raw files. No GPU is needed to check.

Bring one workload. We will measure it with you.

Tell us your engine, model, GPUs and where context repeats or gets lost. We reply with what we would measure, what success looks like, and when KVStash is not worth it.

Or write to rudray@kvstash.com