Search Ctrl K
Home / Tools
THE FEUTEX TOOLKIT

LLM KV Cache Memory

Estimate key and value cache memory from layers, KV heads, head width and live tokens.

AI Infrastructure workspace● Runs in your browser
01 Your input
02 Your result
View or copy raw result data
FormulaKV tensor storage = 2*layers*heads*width*tokens*batch*bytes/1073741824
Sources and model references

Made for real tasks

  • Estimate key and value cache memory from layers, KV heads, head width and live tokens.
Explore step-by-step workflows →

Worked example

Inputs

Attention layers
32 layers
KV heads per layer
8 heads
Dimensions per head
128 dimensions
Cached tokens per sequence
4096 tokens
Concurrent sequences
4 sequences
Bytes per cache value
2 bytes

Expected results

KV tensor storage
2 GiB

Load the example in the workspace to reproduce these results. Display rounding does not change the underlying calculation.

How to use this tool

  1. Enter attention layers, kv heads per layer, dimensions per head, cached tokens per sequence, concurrent sequences, bytes per cache value in the displayed units.
  2. Calculate the scenario, then compare it with measurements before changing a system.

Try this example

{
  "layers": 32,
  "heads": 8,
  "width": 128,
  "tokens": 4096,
  "batch": 4,
  "bytes": 2
}

Accuracy and scope

Dense KV tensor storage; excludes allocator, metadata and paged-block waste. Use KV heads, not query heads.

Is my data uploaded?

This tool runs locally in your browser. Input and output are not sent to a processing server. Copy or download your result before leaving the page.