vLLM
An inference engine and serving stack for language models. Its central problem is sharing finite GPU memory and compute among requests whose prompts and response lengths are different.
Application
Sends a prompt and generation settings through the compatible HTTP API. A streaming client receives partial output while generation is still running; one HTTP request spans many engine iterations.
- Application API + input processingHTTP + prompt
- Output processing ApplicationStream text chunks
One pass through the system.
Select a step to highlight the components involved in the diagram.
Why it is built this way.
Throughput competes with latency
Large token batches keep GPUs occupied but can increase waiting time. Prompt length, generation length and traffic shape matter more than a single headline tokens-per-second number.
Paged memory is still finite
Block allocation reduces waste; it does not remove the KV memory limit. Under pressure the scheduler can preempt requests and later recompute their progress.
Parallelism adds communication
Sharding a model helps it fit across GPUs but introduces collective communication. More GPUs do not guarantee lower latency, especially across a slow interconnect.
Read the implementation.
vllm/v1/engine/core.pyStart with the engine loop and follow scheduling into model execution and output handling.
vllm/v1/core/sched/scheduler.pyRead how token budgets, waiting requests and available KV blocks determine each batch.
vllm/v1/worker/gpu_worker.pyFollow worker initialization, device memory and the handoff to model execution.
Go deeper with the official docs
- vLLM V1 architecture and process boundaries
- Automatic prefix caching and block identity
- Paged attention: how kernels access KV blocks
Educational diagrams, synthesized from the linked project documentation. Components and boundaries vary by version and deployment.