Lab · AI engineering
Serving a language model
Requests fill a GPU batch and its memory; watch batching, long prompts and batch size decide how fast each user gets an answer.
Try it
- Users — 1/s — healthy
- Queue — waiting for a batch slot — healthy — 0 waiting
- GPU — 7 / 8 in the batch — healthy — 82% of memory used
- Request
- Response
A token is a small piece of text the model reads or writes.
A GPU is the chip that runs the model's calculations.
Numbers add up:9 arrived = 1 completed + 7 running + 0 waiting + 1 in flightThe lab checks this sum as it runs, so a counting mistake would show here.
Controls
Follow a request
Pause to pick a request that is on screen.
In the batch
Memory (KV cache)
The KV cache is the memory where the model keeps its saved work on every token so far.
Show data table
| Time | p95 |
|---|---|
| 1s | 189 ms |
| 1s | 212 ms |
| 2s | 296 ms |
| 2s | 296 ms |
| 3s | 296 ms |
| 3s | 296 ms |
Show data table
| Time | Tokens/s |
|---|---|
| 1s | 16 |
| 1s | 54 |
| 2s | 56 |
| 2s | 110 |
| 3s | 126 |
| 3s | 110 |
Show data table
| Time | Waiting | In the batch |
|---|---|---|
| 1s | 0 | 1 |
| 1s | 0 | 2 |
| 2s | 0 | 5 |
| 2s | 0 | 5 |
| 3s | 0 | 5 |
| 3s | 0 | 7 |
Design it
Fast first words, even at double traffic
One GPU serves a language model. Requests arrive about once a second, each with a prompt of 200 to 1,200 tokens. Pick how the GPU batches requests and how many it runs at once, then check the design.
The goals
- At normal traffic, 95% of answers start within 1 s.
- At double traffic, 95% of answers start within 5 s.
- At double traffic, no request is pushed out of GPU memory and started again.
The check runs the same engine as the lab on this page for 60 simulated seconds under each condition, with a fixed seed, so a design always gets the same result. There is no score: each goal passes or fails.
What this model simplifies
- The step times, prefill speed and memory size are made up to show the shape. Real numbers vary by model and hardware by ten times or more.
- Every request's answer length is fixed when it arrives. A real model stops when it writes a special end token.
- Paused requests go back to the queue and redo their work. Real servers can also move saved work to slower memory instead.
- One GPU and one model. Real services spread a model over several GPUs and run many copies behind a load balancer.