vLLM
A high-performance server for running language models. Optimized for GPU and capable of handling multiple simultaneous requests — the standard for production.
Why It's Needed
A typical model run through Python processes requests one at a time and inefficiently uses VRAM. vLLM keeps the model in memory and serves responses to dozens of clients in parallel.
Key Techniques
- PagedAttention — page-based management of KV-cache, akin to virtual memory in an OS;
- Continuous batching — new requests are added on the fly, without waiting for the batch to complete;
- Quantization — running quantized models to save memory.
Launch
pip install vllm
vllm serve Qwen/Qwen2.5-7B-Instruct --port 8000
After starting, the server provides an OpenAI-compatible API — it can be substituted for a cloud endpoint without rewriting code.
vLLM vs Ollama
| vLLM | Ollama | |
|---|---|---|
| Purpose | Server, production | Local desktop |
| Speed | Very high | Good |
| Entry barrier | Moderate | Low |
| Windows | Limited | Yes |