Skip to main content

vLLM Cheatsheet

vLLM is a high-throughput LLM inference serving engine featuring PagedAttention and Continuous Batching for optimal GPU utilization. It supports multi-GPU tensor/pipeline parallelism, hot-loaded LoRA adapters, and an OpenAI-compatible API — the standard choice for production LLM deployment.

Updated: 2026-07-20·22 commands

Quick Start

``bash # Install pip install vllm

# Start serving a model vllm serve meta-llama/Llama-3.1-8b --host 0.0.0.0 --port 8000

# Test with curl curl -s http://localhost:8000/v1/chat/completions \ -d '{"model":"meta-llama/Llama-3.1-8b","messages":[{"role":"user","content":"Hello"}],"max_tokens":100}'

# Check loaded models curl -s http://localhost:8000/v1/models | jq . `

Model Serving

vllm serve is the core command. Models can be HuggingFace IDs (e.g., meta-llama/Llama-3.1-8b) or local paths. Key flags: --port, --host, --dtype, --max-model-len, --gpu-memory-utilization.

Multi-GPU Inference

For large models, split across GPUs with tensor parallel (--tensor-parallel-size) or pipeline parallel (--pipeline-parallel-size). Both can be combined for very large deployments.

LoRA Adapter Support

vLLM supports hot-loading LoRA adapters without restarting. Enable with --enable-lora and register modules with --lora-modules. Multiple adapters coexist; select per-request by specifying the module name as the model.

Memory Optimization

--gpu-memory-utilization controls VRAM usage (default 0.9). --kv-cache-dtype fp8 halves KV cache memory. --max-model-len limits context size. --max-num-seqs controls request concurrency.

OpenAI-Compatible API

vLLM serves endpoints at /v1/chat/completions, /v1/completions, /v1/embeddings, and /v1/models`. Any OpenAI SDK can target vLLM by changing the base URL.

Startup & Modes(2)

CommandLevel
vllm --help
Show vLLM CLI help
Basic
pip install vllm
Install vLLM
Basic

ai-server(19)

CommandLevel
vllm serve
Start model inference server (core command)
Basic
vllm serve --port
Specify server port (default 8000)
Basic
vllm serve --host
Specify bind host address
Basic
vllm serve --tensor-parallel-size
Set tensor parallel size (multi-GPU)
Expert
vllm serve --pipeline-parallel-size
Set pipeline parallel size
Expert
vllm serve --dtype
Specify inference precision
Intermediate
vllm serve --max-model-len
Set maximum model context length
Intermediate
vllm serve --gpu-memory-utilization
Set GPU memory utilization (0-1)
Intermediate
vllm serve --enable-lora
Enable LoRA adapter support
Expert
vllm serve --lora-modules
Load specified LoRA modules
Expert
vllm serve --api-key
Set API key authentication
Intermediate
vllm serve --tokenizer-mode
Set tokenizer mode (auto/slow)
Expert
vllm serve --load-format
Specify model load format
Expert
curl http://localhost:8000/v1/chat/completions
Send OpenAI-compatible chat request to vLLM
Intermediate
curl http://localhost:8000/v1/completions
Send text completion request to vLLM
Intermediate
curl http://localhost:8000/v1/models
List models loaded in vLLM server
Basic
curl http://localhost:8000/health
Check vLLM server health
Basic
vllm serve --kv-cache-dtype
Specify KV cache dtype (auto/fp8)
Expert
vllm serve --max-num-seqs
Set max concurrent sequences
Expert

ai-eval(1)

CommandLevel
vllm bench
vLLM benchmark
Expert

FAQ

This cheatsheet is compiled from official tool documentation. Last updated: 2026-07-20.