npx skills add ...
npx skills add davila7/claude-code-templates --skill serving-llms-vllm
Serves LLMs with high throughput using vLLM's PagedAttention and continuous batching. Use when deploying production LLM APIs, optimizing inference latency/throughput, or serving models with limited GPU memory. Supports OpenAI-compatible endpoints, quantization (GPTQ/AWQ/FP8), and tensor parallelism.
npx skills add davila7/claude-code-templates --skill serving-llms-vllm
vLLM achieves 24x higher throughput than standard transformers through PagedAttention (block-based KV cache) and continuous batching (mixing prefill/decode requests).
Installation:
Basic offline inference:
OpenAI-compatible server:
Copy this checklist and track progress:
Step 1: Configure server settings
Choose configuration based on your model size:
Step 2: Test with limited traffic
Run load test before production:
Verify TTFT (time to first token) < 500ms and throughput > 100 req/sec.
Step 3: Enable monitoring
vLLM exposes Prometheus metrics on port 9090:
Key metrics to monitor:
vllm:time_to_first_token_seconds - Latencyvllm:num_requests_running - Active requestsvllm:gpu_cache_usage_perc - KV cache utilizationStep 4: Deploy to production
Use Docker for consistent deployment:
Step 5: Verify performance metrics
Check that deployment meets targets:
For processing large datasets without server overhead.
Copy this checklist:
Step 1: Prepare input data
Step 2: Configure LLM engine
Step 3: Run batch inference
vLLM automatically batches requests for efficiency:
Step 4: Process results
Fit large models in limited GPU memory.
Step 1: Choose quantization method
Step 2: Find or create quantized model
Use pre-quantized models from HuggingFace:
Step 3: Launch with quantization flag
Step 4: Verify accuracy
Test outputs match expected quality:
Use vLLM when:
Use alternatives instead:
Issue: Out of memory during model loading
Reduce memory usage:
Or use quantization:
Issue: Slow first token (TTFT > 1 second)
Enable prefix caching for repeated prompts:
For long prompts, enable chunked prefill:
Issue: Model not found error
Use --trust-remote-code for custom models:
Issue: Low throughput (<50 req/sec)
Increase concurrent sequences:
Check GPU utilization with nvidia-smi - should be >80%.
Issue: Inference slower than expected
Verify tensor parallelism uses power of 2 GPUs:
Enable speculative decoding for faster generation:
Server deployment patterns: See references/server-deployment.md for Docker, Kubernetes, and load balancing configurations.
Performance optimization: See references/optimization.md for PagedAttention tuning, continuous batching details, and benchmark results.
Quantization guide: See references/quantization.md for AWQ/GPTQ/FP8 setup, model preparation, and accuracy comparisons.
Troubleshooting: See references/troubleshooting.md for detailed error messages, debugging steps, and performance diagnostics.
Supported platforms: NVIDIA (primary), AMD ROCm, Intel GPUs, TPUs