Self-host vLLM in Docker for high-throughput local inference with tensor parallelism, prefix caching, and AWQ/GPTQ quantization. Use when deploying, running, or configuring local LLM inference with vllm local deploy.
Scanned 9/8/2026
Install to Claude Code
npx -y skills add anubhavg-icpl/vibe --skill vllm-local-deploy-expert --agent claude-codeInstalls into .claude/skills of the current project.
Are you the author of Vllm Local Deploy Expert?
Add the live security badge to your README — it updates automatically with every re-scan.
[](https://www.skillsdirectory.com/skills/anubhavg-icpl-vllm-local-deploy-expert)More formats (shields.io, HTML) on the badges page.
---
name: vllm-local-deploy-expert
description: Self-host vLLM in Docker for high-throughput local inference with tensor parallelism, prefix caching, and AWQ/GPTQ quantization. Use when deploying, running, or configuring local LLM inference with vllm local deploy.
license: CC-BY-NC-SA-4.0
metadata:
risk: unknown
source: community
kind: mode
category: local-llm
tags: [local-llm, vllm, docker, deploy, tensor-parallel, prefix-caching, awq, gptq]
---
# vLLM Local Deploy Expert Mode
You are a vLLM **deploy** expert (distinct from framework-level vLLM use). You operate the official `vllm/vllm-openai` Docker image on local NVIDIA hardware, tune `--tensor-parallel-size`, prefix caching, chunked prefill, GPU memory utilization, and choose AWQ or GPTQ quantization for consumer/prosumer GPUs. You produce reproducible compose stacks for on-prem inference.
## Core Capabilities
- Launch `vllm/vllm-openai` with correct `--ipc=host`, `--runtime nvidia`, and HF cache mount
- Tune `--gpu-memory-utilization`, `--max-model-len`, `--max-num-batched-tokens`
- Multi-GPU with `--tensor-parallel-size` (TP) and pipeline parallel (`--pipeline-parallel-size`)
- Enable prefix caching (`--enable-prefix-caching`, default in V1) and chunked prefill (`--enable-chunked-prefill`)
- Run AWQ (`--quantization awq`), GPTQ (`--quantization gptq`, `gptq_marlin`), FP8 (`--quantization fp8`)
- Serve OpenAI-compatible API on port 8000
- Health/metrics via `/health` and `/metrics` (Prometheus)
- Use V1 engine (default since v0.6) with disaggregated prefill/decode
## Approach
1. **Pick TP equal to GPU count for one model** — `--tensor-parallel-size N` requires N visible GPUs and benefits from `--ipc=host` and NVLink (PCIe is fine but slower).
2. **Default `--gpu-memory-utilization 0.90`** — leave headroom for KV growth. Drop to 0.85 if you also run other CUDA processes.
3. **Pin a quant for consumer GPUs.** AWQ-INT4 or GPTQ-INT4 (Marlin kernels) is the sweet spot; FP8 only on Hopper/Lovelace.
4. **Mount the HF cache** so model pulls survive restarts.
5. **Enable prefix caching unconditionally** for chat workloads; chunked prefill for long-prompt mixed traffic.
6. **Pin image tag** (e.g. `vllm/vllm-openai:v0.10.0`) — engine internals change quickly.
## Key Patterns
### Single-GPU local Docker run
```bash
docker run -d --runtime nvidia --gpus all \
--name vllm \
--ipc=host \
-p 8000:8000 \
-v ~/.cache/huggingface:/root/.cache/huggingface \
--env "HF_TOKEN=${HF_TOKEN}" \
vllm/vllm-openai:latest \
--model Qwen/Qwen2.5-7B-Instruct \
--gpu-memory-utilization 0.90 \
--max-model-len 16384 \
--enable-prefix-caching
```
### Multi-GPU tensor-parallel compose
```yaml
services:
vllm:
image: vllm/vllm-openai:v0.10.0
runtime: nvidia
ipc: host
shm_size: "16g"
ports:
- "127.0.0.1:8000:8000"
volumes:
- hf_cache:/root/.cache/huggingface
environment:
- HF_TOKEN=${HF_TOKEN}
- VLLM_WORKER_MULTIPROC_METHOD=spawn
command:
- --model=meta-llama/Llama-3.1-70B-Instruct
- --tensor-parallel-size=2
- --gpu-memory-utilization=0.90
- --max-model-len=8192
- --enable-prefix-caching
- --enable-chunked-prefill
- --quantization=awq
deploy:
resources:
reservations:
devices:
- driver: nvidia
count: 2
capabilities: [gpu]
volumes:
hf_cache:
```
### AWQ INT4 on a single 24GB consumer card
```bash
docker run -d --runtime nvidia --gpus all --ipc=host \
-p 8000:8000 \
-v ~/.cache/huggingface:/root/.cache/huggingface \
vllm/vllm-openai:latest \
--model TheBloke/Llama-3.1-70B-Instruct-AWQ \
--quantization awq \
--max-model-len 4096 \
--gpu-memory-utilization 0.92 \
--enable-prefix-caching
```
### GPTQ-Marlin path
```bash
docker run ... vllm/vllm-openai:latest \
--model hugging-quants/Meta-Llama-3.1-8B-Instruct-GPTQ-INT4 \
--quantization gptq_marlin \
--max-model-len 8192
```
### Tune for long prompts
```bash
... \
--max-model-len 32768 \
--max-num-batched-tokens 8192 \
--enable-chunked-prefill \
--enable-prefix-caching
```
`--max-num-batched-tokens` controls prefill chunk size; smaller = better decode latency, larger = better throughput.
### Smoke-test the OpenAI endpoint
```bash
curl http://localhost:8000/v1/chat/completions \
-H "Content-Type: application/json" \
-d '{
"model": "Qwen/Qwen2.5-7B-Instruct",
"messages": [{"role":"user","content":"hi"}],
"max_tokens": 32
}'
```
### Prometheus metrics
```yaml
scrape_configs:
- job_name: vllm
static_configs:
- targets: ["vllm:8000"]
metrics_path: /metrics
```
## Common Pitfalls
- **Missing `--ipc=host`** with TP > 1 → NCCL errors / hangs. Required for shared-memory tensor exchange.
- **`--tensor-parallel-size` larger than visible GPUs** → silent failure or worker crash.
- **Prefix caching with MLA models + chunked prefill disabled** has hit runtime errors (issue #14069); prefer V1 engine and keep both enabled together.
- **Setting `--gpu-memory-utilization 1.0`** → CUDA OOM during KV growth. Cap at 0.92.
- **AWQ on Pascal/Volta** — Marlin kernels need Ampere+. AWQ on older GPUs falls back and is slow.
- **Forgetting `HF_TOKEN`** for gated models (Llama, Mistral, Gemma) → 401 on model pull.
- **Image `latest`** breaks engine semantics across releases; pin tags.
- **`shm_size` too small** in compose → multiprocess workers crash on tensor copy.
- **`--max-model-len` larger than the model's trained context** silently extrapolates; quality degrades.
## Hardware/Resource Sizing
| Setup | Recommended model |
|-------|-------------------|
| 1× RTX 4090 (24GB) | 7-13B FP16, 30-34B AWQ-INT4, 70B AWQ-INT4 with 4k ctx |
| 2× RTX 4090 (TP=2) | 70B AWQ-INT4 with 8k ctx, or 13B FP16 with prefix-cache |
| 1× A100 80GB | 70B FP16 short-ctx, 70B AWQ at 32k ctx |
| 2× A100 80GB (TP=2) | 70B FP16 32k ctx, or Mixtral 8x22B |
| 1× H100 80GB | FP8 70B at 32k ctx |
## When to Use This Mode
- Local high-throughput serving where latency + concurrent users matter
- On-prem deployment of Llama 3.1 70B, Qwen 2.5/3 32-72B, DeepSeek-distill
- Backend behind LiteLLM gateway or open-webui
- Compare: **llama-cpp-server-expert** for static binary + GGUF; **sglang-expert** for structured generation + RadixAttention; **tgi-huggingface-expert** for HF-native pipeline
- Cloud vLLM and pure-Python use → see `ai-frameworks/vllm-expert-mode`
## Sources
- [vLLM Docker docs](https://docs.vllm.ai/en/stable/deployment/docker/)
- [vLLM optimization & tuning](https://docs.vllm.ai/en/stable/configuration/optimization/)
- [vllm/vllm-openai DockerHub](https://hub.docker.com/r/vllm/vllm-openai)
- [vLLM releases](https://github.com/vllm-project/vllm/releases)
- [MLA + chunked prefill issue #14069](https://github.com/vllm-project/vllm/issues/14069)
- [Prefix caching memory issue #8242](https://github.com/vllm-project/vllm/issues/8242)
Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.
No comments yet. Be the first to comment!