Debug Foundry

Watch one new token meet the whole past, without re-reading it.

Turn it, pause it, drag through the steps. Then flip the strategy and watch the bill change.

Not a video. A small simulation of the decode loop — slow memory below, the cache shelf on it, compute above.

Drag to turn · scroll or pinch to zoom

Finished state of the KV cache simulation

Slow memory, this token
0

1/8First step sentence

    0.0s
    Replay the ending with
    Conversation length 2,048 tokens

    What it's for

    Good to know

    The cache trades memory for speed: bytes per token ≈ 2 × layers × KV heads × head size × 2 bytes. An 8B-scale model is roughly 128 KB per token, so a 128k-token conversation is about 16 GB of cache.

    How it works, step by step

      Why each step follows

      Before you rely on it

      Six slabs stand in for thousands of tokens, and the byte numbers come from an illustrative 8B-scale decoder, not a measured GPU. The quadratic re-read, the per-token append, the reservation waste and the page sharing are exactly as shown.

      Reference