Design the serving system behind a large language model API: a request arrives with a prompt, and tokens stream back from a model running on a pool of GPUs. Training and fine-tuning are out of scope.
Requirements
- Accept a prompt and stream tokens back as they are generated
- Keep expensive GPUs busy rather than idle
- A slow request does not block a fast one behind it
- Per-customer rate limits and usage accounting
Scale
- Requests
- 20M per day
- Average prompt
- 1,000 tokens
- Average output
- 300 tokens
- GPU pool
- 2,000 GPUs
Draw the design on the board, fill in Your answer, then submit.