Install any skill in seconds. Free to start, no credit card required.
Get Started Free →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.
.claude/skills/graniet-vllm/SKILL.md| Test case | Without → With | Effect | Δ tokens | Δ turns |
|---|---|---|---|---|
| case-11 | ✗→✓ | ▲ Improved | 62% | 0% |
| case-01 | ✗→✓ | ▲ Improved | 83% | 0% |
| case-02 | ✗→✓ | ▲ Improved | 49% | 0% |
| case-08 | ✗→✓ | ▲ Improved | 55% | 0% |
| case-12 | ✗→✓ | ▲ Improved | 240% | 0% |
This skill is repo-local and stays inactive until explicitly activated.
When the original instructions refer to legacy tool names, use these Kheish mappings:
terminal => bashweb_extract => web_fetch, plus web_search when discovery is neededsearch_files => grep_search and glob_searchbrowser_* tools require a browser-capable surfaced tool or MCP; if none is available, use the closest available surface and say so explicitlyWhen the instructions mention local helper files, resolve them from ${KHEISH_SKILL_DIR}.
vLLM achieves 24x higher throughput than standard transformers through PagedAttention (block-based KV cache) and continuous batching (mixing prefill/decode requests).
Installation:
bashpip install vllm
Basic offline inference:
pythonfrom vllm import LLM, SamplingParams llm = LLM(model="meta-llama/Llama-3-8B-Instruct") sampling = SamplingParams(temperature=0.7, max_tokens=256) outputs = llm.generate(["Explain quantum computing"], sampling) print(outputs[0].outputs[0].text)
OpenAI-compatible server:
bashvllm serve meta-llama/Llama-3-8B-Instruct # Query with OpenAI SDK python -c " from openai import OpenAI client = OpenAI(base_url='http://localhost:8000/v1', api_key='EMPTY') print(client.chat.completions.create( model='meta-llama/Llama-3-8B-Instruct', messages=[{'role': 'user', 'content': 'Hello!'}] ).choices[0].message.content) "
Copy this checklist and track progress:
Deployment Progress:
- [ ] Step 1: Configure server settings
- [ ] Step 2: Test with limited traffic
- [ ] Step 3: Enable monitoring
- [ ] Step 4: Deploy to production
- [ ] Step 5: Verify performance metricsStep 1: Configure server settings
Choose configuration based on your model size:
bash# For 7B-13B models on single GPU vllm serve meta-llama/Llama-3-8B-Instruct \ --gpu-memory-utilization 0.9 \ --max-model-len 8192 \ --port 8000 # For 30B-70B models with tensor parallelism vllm serve meta-llama/Llama-2-70b-hf \ --tensor-parallel-size 4 \ --gpu-memory-utilization 0.9 \ --quantization awq \ --port 8000 # For production with caching and metrics vllm serve meta-llama/Llama-3-8B-Instruct \ --gpu-memory-utilization 0.9 \ --enable-prefix-caching \ --enable-metrics \ --metrics-port 9090 \ --port 8000 \ --host 0.0.0.0
Step 2: Test with limited traffic
Run load test before production:
bash# Install load testing tool pip install locust # Create test_load.py with sample requests # Run: locust -f test_load.py --host http://localhost:8000
Verify TTFT (time to first token) < 500ms and throughput > 100 req/sec.
Step 3: Enable monitoring
vLLM exposes Prometheus metrics on port 9090:
bashcurl http://localhost:9090/metrics | grep vllm
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:
bash# Run vLLM in Docker docker run --gpus all -p 8000:8000 \ vllm/vllm-openai:latest \ --model meta-llama/Llama-3-8B-Instruct \ --gpu-memory-utilization 0.9 \ --enable-prefix-caching
Step 5: Verify performance metrics
Check that deployment meets targets:
For processing large datasets without server overhead.
Copy this checklist:
Batch Processing:
- [ ] Step 1: Prepare input data
- [ ] Step 2: Configure LLM engine
- [ ] Step 3: Run batch inference
- [ ] Step 4: Process resultsStep 1: Prepare input data
python# Load prompts from file prompts = [] with open("prompts.txt") as f: prompts = [line.strip() for line in f] print(f"Loaded {len(prompts)} prompts")
Step 2: Configure LLM engine
pythonfrom vllm import LLM, SamplingParams llm = LLM( model="meta-llama/Llama-3-8B-Instruct", tensor_parallel_size=2, # Use 2 GPUs gpu_memory_utilization=0.9, max_model_len=4096 ) sampling = SamplingParams( temperature=0.7, top_p=0.95, max_tokens=512, stop=["</s>", "\n\n"] )
Step 3: Run batch inference
vLLM automatically batches requests for efficiency:
python# Process all prompts in one call outputs = llm.generate(prompts, sampling) # vLLM handles batching internally # No need to manually chunk prompts
Step 4: Process results
python# Extract generated text results = [] for output in outputs: prompt = output.prompt generated = output.outputs[0].text results.append({ "prompt": prompt, "generated": generated, "tokens": len(output.outputs[0].token_ids) }) # Save to file import json with open("results.jsonl", "w") as f: for result in results: f.write(json.dumps(result) + "\n") print(f"Processed {len(results)} prompts")
Fit large models in limited GPU memory.
Quantization Setup:
- [ ] Step 1: Choose quantization method
- [ ] Step 2: Find or create quantized model
- [ ] Step 3: Launch with quantization flag
- [ ] Step 4: Verify accuracyStep 1: Choose quantization method
Step 2: Find or create quantized model
Use pre-quantized models from HuggingFace:
bash# Search for AWQ models # Example: TheBloke/Llama-2-70B-AWQ
Step 3: Launch with quantization flag
bash# Using pre-quantized model vllm serve TheBloke/Llama-2-70B-AWQ \ --quantization awq \ --tensor-parallel-size 1 \ --gpu-memory-utilization 0.95 # Results: 70B model in ~40GB VRAM
Step 4: Verify accuracy
Test outputs match expected quality:
python# Compare quantized vs non-quantized responses # Verify task-specific performance unchanged
Use vLLM when:
Use alternatives instead:
Issue: Out of memory during model loading
Reduce memory usage:
bashvllm serve MODEL \ --gpu-memory-utilization 0.7 \ --max-model-len 4096
Or use quantization:
bashvllm serve MODEL --quantization awq
Issue: Slow first token (TTFT > 1 second)
Enable prefix caching for repeated prompts:
bashvllm serve MODEL --enable-prefix-caching
For long prompts, enable chunked prefill:
bashvllm serve MODEL --enable-chunked-prefill
Issue: Model not found error
Use --trust-remote-code for custom models:
bashvllm serve MODEL --trust-remote-code
Issue: Low throughput (<50 req/sec)
Increase concurrent sequences:
bashvllm serve MODEL --max-num-seqs 512
Check GPU utilization with nvidia-smi - should be >80%.
Issue: Inference slower than expected
Verify tensor parallelism uses power of 2 GPUs:
bashvllm serve MODEL --tensor-parallel-size 4 # Not 3
Enable speculative decoding for faster generation:
bashvllm serve MODEL --speculative-model DRAFT_MODEL
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
| Case | Status | Duration (ms) | Turns | Tokens | Tool calls | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Without | With | Δ | Without | With | Δ | Without | With | Δ | Without | With | Δ | ||
case-11 | fail→pass | 15,559 | 8,296 | -47% | 1 | 1 | 0% | 2,726 | 4,412 | +62% | 0 | 0 | — |
case-01 | fail→pass | 10,127 | 34,593 | +242% | 1 | 1 | 0% | 2,035 | 3,716 | +83% | 0 | 0 | — |
case-02 | fail→pass | 13,465 | 8,331 | -38% | 1 | 1 | 0% | 3,076 | 4,594 | +49% | 0 | 0 | — |
case-03 | pass→pass | 6,562 | 4,410 | -33% | 1 | 1 | 0% | 1,427 | 3,705 | +160% | 0 | 0 | — |
case-04 | fail→fail | 11,066 | 6,654 | -40% | 1 | 1 | 0% | 1,966 | 4,018 | +104% | 0 | 0 | — |
case-05 | pass→pass | 5,124 | 3,874 | -24% | 1 | 1 | 0% | 1,149 | 3,548 | +209% | 0 | 0 | — |
case-06 | fail→fail | 5,360 | 3,817 | -29% | 1 | 1 | 0% | 1,074 | 3,468 | +223% | 0 | 0 | — |
case-07 | pass→pass | 15,503 | 5,636 | -64% | 1 | 1 | 0% | 2,760 | 3,704 | +34% | 0 | 0 | — |
case-08 | fail→pass | 15,447 | 7,822 | -49% | 1 | 1 | 0% | 2,652 | 4,120 | +55% | 0 | 0 | — |
case-09 | pass→pass | 16,635 | 7,036 | -58% | 1 | 1 | 0% | 2,934 | 4,011 | +37% | 0 | 0 | — |
case-10 | pass→pass | 3,096 | 2,459 | -21% | 1 | 1 | 0% | 599 | 3,155 | +427% | 0 | 0 | — |
case-12 | fail→pass | 4,317 | 2,570 | -40% | 1 | 1 | 0% | 943 | 3,206 | +240% | 0 | 0 | — |
case-13 | pass→pass | 7,967 | 4,208 | -47% | 1 | 1 | 0% | 1,270 | 3,576 | +182% | 0 | 0 | — |
case-14 | pass→pass | 11,325 | 3,259 | -71% | 1 | 1 | 0% | 2,181 | 3,380 | +55% | 0 | 0 | — |
case-15 | pass→pass | 4,890 | 2,822 | -42% | 1 | 1 | 0% | 931 | 3,195 | +243% | 0 | 0 | — |
case-16 | pass→pass | 4,051 | 5,200 | +28% | 1 | 1 | 0% | 809 | 3,645 | +351% | 0 | 0 | — |
case-17 | pass→pass | 20,673 | 12,746 | -38% | 1 | 1 | 0% | 3,716 | 5,283 | +42% | 0 | 0 | — |
case-18 | pass→pass | 18,005 | 8,643 | -52% | 1 | 1 | 0% | 2,971 | 4,344 | +46% | 0 | 0 | — |
case-19 | fail→pass | 20,706 | 7,931 | -62% | 1 | 1 | 0% | 3,865 | 4,257 | +10% | 0 | 0 | — |
case-20 | pass→pass | 15,729 | 14,454 | -8% | 1 | 1 | 0% | 2,950 | 5,471 | +85% | 0 | 0 | — |
case-21 | pass→pass | 16,693 | 14,178 | -15% | 1 | 1 | 0% | 3,862 | 5,783 | +50% | 0 | 0 | — |
case-22 | pass→pass | 14,930 | 14,974 | +0% | 1 | 1 | 0% | 2,807 | 5,673 | +102% | 0 | 0 | — |
DecimalAI ran this skill against gemini-3.6-flash twice over the same eval suite — once with the skill loaded and once without — and compared the two runs case by case. 22 cases were attempted. The headline lift of +27 percentage points is the difference between those two pass rates over the 22 comparable cases.
Without the skill loaded, the model failed this case. With it loaded, the same prompt on the same model passed. This is one improved case from the latest verified run; every case, including any that regressed, is in the table above.
Other measured skills in the registry, with their headline benchmark lift.