vLLM
Configure vLLM for high-throughput local inference.
WatchThatSite integrates with vLLM, a high-throughput inference engine for running open-source models locally with exceptional performance.
What is vLLM
vLLM is an open-source LLM inference engine optimized for throughput and latency. It runs models locally with advanced optimization techniques like PagedAttention.
Installation
Prerequisites
- CUDA-capable GPU (NVIDIA) or AMD GPU
- Python 3.9+
- CUDA 11.8+ (for GPU acceleration)
Install vLLM
pip install vllmWith GPU Support
# For NVIDIA GPUs
pip install vllm[cuda]
# For AMD GPUs
pip install vllm[rocm]Running vLLM Server
Basic Start
vllm serve meta-llama/Llama-2-7b-hf --port 8000With Parameters
vllm serve meta-llama/Llama-2-13b-hf \
--port 8000 \
--gpu-memory-utilization 0.9 \
--max-num-seqs 256Docker
docker run --gpus all \
-p 8000:8000 \
vllm/vllm:latest \
--model meta-llama/Llama-2-7b-hfHugging Face Models
vLLM works with most Hugging Face models:
- Llama 2: Meta's popular model
- Mistral: Efficient 7B model
- Qwen: Alibaba's models
- Zephyr: Fine-tuned models
- Phi: Small, efficient models
- Others: 10000+ compatible models
Find models at Hugging Face Models.
Add to WatchThatSite
- Go to Settings > AI Providers
- Click Add Provider Key
- Select vLLM from the provider dropdown
- Enter:
- Base URL:
http://localhost:8000(or your server) - Model Name: The model you're running (e.g.,
meta-llama/Llama-2-7b-hf) - API Key (optional): If you configured authentication
- Base URL:
- Optionally select specific models
- Click Save
Configuration
Basic URL Setup
- Local:
http://localhost:8000 - Remote:
http://your-server:8000 - Custom port:
http://localhost:9000
Model Name
Must match deployed model:
- Full path:
meta-llama/Llama-2-7b-hf - Custom name if configured
- Check with:
curl http://localhost:8000/v1/models
Authentication (Optional)
Add authentication header:
vllm serve meta-llama/Llama-2-7b-hf \
--api-key sk-1234567890Performance Tuning
GPU Memory
# Use 90% of GPU memory
vllm serve model-name --gpu-memory-utilization 0.9Parallelism
# Parallel workers
vllm serve model-name --tensor-parallel-size 2Request Batching
# Max concurrent requests
vllm serve model-name --max-num-seqs 256System Requirements
Minimum
- Small models (7B): 8GB VRAM
- Medium models (13B): 16GB VRAM
- Large models (70B): 48GB VRAM
Recommended
- Dedicated GPU
- High-bandwidth GPU interconnect
- Sufficient host RAM (2x VRAM)
Advantages Over Ollama
| Feature | vLLM | Ollama |
|---|---|---|
| Throughput | Very high (PagedAttention) | Moderate |
| Latency | Optimized | Good |
| Parallelism | Tensor/pipeline | Limited |
| Setup | More complex | Simple |
| Performance | Excellent | Good |
| Model diversity | Wide (HF models) | Limited |
Recommended Models
Latest models with tool calling support:
- Llama 3.1 70B — Large, powerful, excellent quality
- Mistral Large — Fast, capable, balanced
- Qwen 72B — Alibaba's powerful model
- Zephyr 7B — Fast, instruction-tuned
All vLLM-compatible models are available.
All Available Models
Any model supporting tool calling and vLLM compatibility can run. Popular sources:
- Hugging Face Models — 10,000+ models
- vLLM Docs — Supported models list
- Llama Models — Meta's official models
Run any model:
vllm serve meta-llama/Llama-3.1-70b-instruct --port 8000
# Then point WatchThatSite to http://localhost:8000Troubleshooting
"Connection Refused"
- Verify vLLM server is running
- Check port is correct
- Test:
curl http://localhost:8000/v1/models
"Model Not Found"
- Verify model path is exact
- Pull model from Hugging Face first:
huggingface-cli download meta-llama/Llama-2-7b-hf - Check model is compatible
Out of Memory
- Use smaller model
- Reduce
gpu-memory-utilization - Reduce
max-num-seqs - Add more GPU memory or GPUs
Slow Performance
- Check GPU utilization:
nvidia-smi - Increase
tensor-parallel-size - Use better GPU
- Optimize prompt/batch size
CUDA Errors
- Verify CUDA version matches vLLM requirements
- Update GPU drivers
- Check GPU is compatible
- Try CPU mode for debugging
Model Download Issues
- Check internet connection
- Verify Hugging Face token if private model
- Set HF token:
huggingface-cli login - Manually download and point to local path
Monitoring
Health Check
curl http://localhost:8000/healthList Models
curl http://localhost:8000/v1/modelsCheck Utilization
nvidia-smi # For NVIDIA
rocm-smi # For AMDAdvanced Setup
Multiple Models
Load different models on different ports:
# Terminal 1
vllm serve model1 --port 8000
# Terminal 2
vllm serve model2 --port 8001Distributed Inference
Use tensor parallelism across GPUs:
vllm serve model-name \
--tensor-parallel-size 2 \
--distributed-executor-backend rayProduction Deployment
For production:
- Use systemd service or Docker
- Enable logging and monitoring
- Set up reverse proxy (nginx)
- Configure authentication
- Enable rate limiting
- Set up auto-restart
When to Use vLLM
Choose vLLM when:
- Throughput matters (many requests)
- You need low latency
- You have GPU available
- You want maximum performance
- Running complex deployments