AI with Ecem
Why memory is the bottleneck
Same GPU, same model. How the KV cache is stored decides how many users fit.
1 · Reserve the max (older servers)
2 · Small pages (vLLM)
3 · Share the prompt start (SGLang)
1 · Reserve the max (older servers)
2 · Small pages (vLLM)
3 · Share the prompt start (SGLang)
GPU MEMORY
Model weights
fixed size
KV CACHE · grows with every token, for every user
A
B
C
reserved, empty
reserved, empty
reserved, empty
User D: no room left
Each request gets space for its longest possible answer, used or not.
The vLLM paper found only 20 to 38% of that memory actually held tokens.
A
A
B
A
B
B
C
B
A
C
B
D
D
E
E
free
Users D and E fit too
Small blocks are handed out only as each conversation grows.
Almost nothing is wasted, so more requests run at once.
Shared start
system prompt
A
B
C
B
D
E
A
C
E
D
more free
Stored once, reused by A, B, C, D and E
Requests that start the same way reuse the stored work.
Less memory and no recomputing. Claude's prompt caching applies the same idea.
llama.cpp shrinks the weights
At 4 bits, a 7B model is about 3.5 GB instead of 14 GB.
If it still doesn't fit, part of it runs on the CPU.
weights, before and after quantization
TensorRT-LLM speeds up each step
Specialized GPU code and an efficient runtime,
tuned for Nvidia's own chips.