vLLM — Serving Engine cho LLM hiệu suất cao
vLLM là open-source inference engine cho LLM với PagedAttention, continuous batching, FP4 quantization — nhanh hơn 24 lần so với naive transformers.
vLLM là open-source LLM inference & serving engine hiệu suất cao, ra đời từ UC Berkeley (SOSP 2023), Apache 2.0. Phiên bản mới nhất: v0.26.0 (7/2026). ~77.5k GitHub stars, 2.79M PyPI downloads/tuần. Là #1 OSS project theo contributors (GitHub Octoverse 2025).
PagedAttention — Đột phá cốt lõi#
PagedAttention quản lý KV cache giống như virtual memory của OS: chia thành fixed-size blocks, cấp phát/giải phóng động, copy-on-write sharing. Kết quả:
- Lãng phí memory giảm từ 60-80% xuống <4%
- Throughput cao hơn 24 lần so với naive HF Transformers serving
- Prefix sharing: system prompt tính một lần, dùng lại cho mọi request
Tính năng chính#
| Tính năng | Mô tả |
|---|---|
| Continuous batching | Request mới vào batch đang chạy, không chết GPU cycles |
| Chunked prefill | Chia prompt dài thành chunk, không block decode |
| Prefix caching | Giảm 40% latency cho repeated system prompts |
| Tensor/pipeline/expert parallelism | Scale ngang 8+ GPUs |
| Speculative decoding | EAGLE 3.1, DFlash — tới 2x throughput |
| Disaggregated prefill/decode | Tách prefill và decode ra server riêng |
| KV cache quantization | FP8, NVFP4, INT8, INT4 |
Quantization hỗ trợ#
| Format | Implementation | Hardware |
|---|---|---|
| FP8 (W8A8) | Dynamic/static, per-token-group activation | Hopper+ |
| NVFP4 | 4-bit float NVIDIA native (SM100+) | Blackwell |
| MXFP4 | OCP Microscaling 4-bit | Blackwell, Hopper |
| INT4 (AWQ/GPTQ) | Marlin kernels | Turing+ |
| INT8 | llm-compressor, static | Ampere+ |
| KV cache | FP8, NVFP4, INT8, INT4 | Hopper+ |
Consensus 2026: BF16 → FP8 (Hopper) → NVFP4/MXFP4 (Blackwell).
Hardware#
- NVIDIA CUDA: Volta → Blackwell (SM 7.0–12.0). Full features
- AMD ROCm: MI300X, MI355X
- Intel XPU: Arc Pro B-series
- Google TPU: Plugin (PyTorch + JAX)
- Apple Silicon: Plugin vllm-metal (MLX-based), ~525 tok/s M4 Max
- CPU: x86/ARM/PowerPC/S390X
- Huawei Ascend, AWS Trainium/Inferentia, IBM Spyre: Plugins
200+ kiến trúc model hỗ trợ trên Hugging Face.
Multi-modal#
Từ 2025-2026, vLLM mở rộng ra multi-modal:
- Image: LLaVA, Qwen2.5-VL, Pixtral, Gemma3
- Video: Qwen2.5-VL, Qwen3-VL
- Audio: Whisper, Qwen2-Audio, Ultravox
- Omni: Qwen3-Omni — interleaved audio+video
vLLM-Omni (11/2025) mở rộng thêm: Diffusion Transformers (DiT), TTS, non-autoregressive generation, heterogeneous outputs.
Serving features#
- OpenAI-compatible API:
/v1/chat/completions,/v1/completions,/v1/embeddings— drop-in replacement - Anthropic Messages API
- Structured outputs: xgrammar + guidance.
guided_json,guided_regex,guided_grammar - Tool calling: Hermes, Mistral, Llama3, Qwen, xLAM, Granite…
- Multi-LoRA: Fused kernels cho dense + MoE layers
- Realtime API: WebSocket streaming
- vLLM Semantic Router: Multimodal routing, load balancing
Hiệu năng#
H100 single-GPU throughput (batch=32, FP16):
| Engine | 7B | 13B | 70B |
|---|---|---|---|
| vLLM | 180 tok/s | 120 | 50 |
| SGLang | 160 | 110 | 45 |
| TGI | 140 | 90 | 40 |
| TensorRT-LLM | 280 | 200 | 100 |
| llama.ccp | 8 | 6 | 2 |
Concurrent serving — Llama 3 70B (A100 80GB):
| Concurrent | vLLM | Ollama |
|---|---|---|
| 10 | ~30 tok/s | ~15 tok/s |
| 50 | ~18 tok/s | ~4 tok/s |
| 100 | ~12 tok/s | OOM |
| GPU mem utilization | ~96% | 60-70% |
| KV cache waste | <4% | 40-60% |
vLLM vs các giải pháp khác#
| Dimension | vLLM | TGI | TRT-LLM | SGLang | llama.ccp |
|---|---|---|---|---|---|
| PagedAttention | ✅ Native | ❌ | Partial | RadixAttention | ❌ |
| Throughput | Baseline | ~78% | 2-3x peak | ~90-95% | ~5% |
| Cold start | ~62s | Fast | ~28min compile | ~58s | Instant |
| Hardware | Đa nền tảng | CUDA/ROCm | CUDA only | CUDA/ROCm | All |
| OpenAI API | Full+Anthropic | Partial | Via Triton | Full | Partial |
| Quantization | FP8/FP4/INT4… | Tương tự | FP4/FP8/INT4 | Tương tự | GGUF |
Consensus 2026: Ưu tiên vLLM cho GPU serving. SGLang nếu heavy prefix sharing. TRT-LLM cho peak performance static. TGI chuyển sang maintenance mode.
Lịch sử phát triển 2025-2026#
| Thời điểm | Sự kiện |
|---|---|
| 1/2025 | vLLM V1 architecture rewrite |
| 11/2025 | vLLM-Omni ra mắt — omni-modality |
| 1/2026 | Streaming Requests, Realtime WebSocket API |
| 3/2026 | P-EAGLE parallel speculative decoding |
| 4/2026 | FP8 KV-Cache, RTX PRO 6000 NVFP4 — 6.5x throughput |
| 5/2026 | EAGLE 3.1, Native RL APIs |
| 7/2026 | v0.26.0 (PyPI) |