← Back to LLM Fundamentals

Running Models Locally

What is a KV cache, and why it decides what you can serve

A KV cache stores the key and value vectors for tokens the model has already read, so it reads them instead of recomputing them. The size of that memory decides how many users and how much context one GPU can serve.

Start by reading the article for this lesson.

Read the articleOpens in a new tab

Check what you learned

Answer all 3 questions. You need at least 2 right to pass.

1. What does a KV cache store?

2. Which phase is memory bound, prefill or decode?

3. How much KV cache does Llama-3-8B need at 8,192 tokens?