Prompts Forms Resume Reports ★ Saved ★ Saved★ + Submit a tool
Tools and frameworks

vLLM

About 2228 characters Updated Nov 30, 2026 32 views AI wiki

vLLM is a high-performance large-model inference engine open-sourced by UC Berkeley, whose core innovation is the PagedAttention technique. It can raise the throughput of large-model inference by 5 to 24 times and is currently the preferred solution for deploying open-source large models in production.

What problem it solves

The bottleneck of large-model inference is not compute but memory management. Generating each token requires caching the history's Key and Value (KV Cache), and in long conversations the KV Cache occupies a large amount of memory. Traditional solutions pre-allocate fixed-size contiguous memory, causing severe waste - only 30% is actually used while the remaining 70% sits idle, limiting concurrency.

How PagedAttention works

It borrows the virtual memory paging mechanism of operating systems: the KV Cache is cut into fixed-size blocks stored in non-contiguous physical memory, and a block table maps logical positions to physical ones. Memory can then be allocated on demand, the waste rate drops from 60% to 80% down to below 4%, and concurrency rises sharply.

Other key optimizations

Continuous batching: requests have different lengths, and traditional batching must wait for the longest one before returning. vLLM adjusts the batch dynamically at each token generation step, new requests can join at any time, and long requests do not block short ones.

Prefix caching: when multiple requests share the same system prompt, the already computed KV Cache is reused to avoid recomputation.

Tensor parallelism: supports splitting a large model across multiple GPUs. Quantization support: integrates quantization schemes such as AWQ, GPTQ, and FP8.

How to use it

The most common use is the OpenAI-compatible API server: vllm serve Qwen/Qwen2.5-7B-Instruct, which provides a fully OpenAI-compatible interface on :8000 after startup, so existing applications only need to change the base_url. It also supports offline batch inference in Python.

Performance data

Official benchmarks show that on the same hardware vLLM raises throughput 5 to 24 times over native Hugging Face Transformers inference, with more stable request latency. Compared with Ollama (aimed at personal use), vLLM targets multi-user production service.

Common misconceptions

Many people think vLLM is just "a somewhat faster inference library", but its value lies in letting a single GPU serve far more concurrent users, which directly determines the unit cost of service. Another pitfall is ignoring the --gpu-memory-utilization parameter (default 0.9); when memory is insufficient it must be lowered, or startup fails.