🚀 B200 starting at $3.75/hr. The best price you'll find. DC in US West → (Access it from button on top after login).

Get Your B200 →
Start Building
Technical

vLLM Tutorial: How to Deploy and Serve LLMs on GPU Cloud (2026)

Most teams deploy vLLM and watch GPU utilisation sit at 30%. Here is what PagedAttention and continuous batching actually do to fix that, and how to run it on GPU cloud for a fraction of hyperscaler cost.

Author photo
packet.ai Team
July 23, 2026

vLLM is the de facto open-source inference engine for production LLM serving in 2026, running on GPU cloud, it delivers 3–5x more throughput than a naive PyTorch inference loop on the same H100, at a fraction of hyperscaler cost.

Key takeaways

  • vLLM v0.25.1 (July 2026) is the current stable release: Python 3.10–3.14, CUDA 12+, NVIDIA GPUs compute capability 7.0+.
  • PagedAttention reduces KV cache memory waste by 55–80% versus static allocation, directly increasing concurrent request capacity.
  • vLLM continuous batching keeps GPU utilisation above 85–92% vs 68–74% for TGI under equivalent load (2026 benchmarks).
  • On a single H100, vLLM peaks at ~12,500 tokens/sec aggregate for Llama 3.1 8B; a single H200 reaches 3,800+ tok/s/GPU at FP8 for 70B models.
  • packet.ai H100 starts at $2.50/hr, H200 at $2.49/hr, and B200 at $3.75/hr, versus $4.59–$13.78/hr on AWS and Azure for equivalent silicon.
  • TGI entered maintenance mode in December 2025. Hugging Face now contributes to vLLM and SGLang instead.

Most teams start with a model, a GPU instance, and a Python script. That works for one user. Under 10 concurrent requests, GPU utilisation drops to 30–40% and queue times spike. The fix is not bigger hardware. It is the right inference engine.

vLLM, originally built at UC Berkeley's Sky Computing Lab and now maintained by 2,000+ contributors including NVIDIA, Hugging Face, and Red Hat, solves this with two core innovations: PagedAttention and vLLM continuous batching. This vLLM tutorial walks through what those are, how to deploy vLLM on GPU cloud step by step, and how to pick the right GPU for your model size and budget.

This post is part of the packet.ai LLM inference cluster. For a full breakdown of inference cost across GPU models, see our guide to GPU cluster options on packet.ai.

How vLLM Works: PagedAttention and Continuous Batching Explained

Standard LLM inference pre-allocates a contiguous VRAM block for every request, sized to the maximum sequence length. On a workload with variable prompt lengths, 60–80% of that allocation sits empty. GPU utilisation hovers around 30–40% at moderate request rates, even on an H100.

vLLM solves this with two techniques that compound on each other.

PagedAttention applies OS virtual memory paging to KV cache management. Rather than one contiguous block per request, it divides VRAM into fixed-size 16-token blocks and allocates them on demand. Logical block tables map each request's attention positions to non-contiguous physical blocks. The result: memory waste drops by 55–80%, and the same GPU can serve significantly more concurrent requests. On an 80 GB H100 running a 7B FP16 model, this is the difference between 30 concurrent requests and 100+, depending on sequence length distribution (Kwon et al., SOSP 2023).

vLLM continuous batching operates at the decode-iteration level rather than the request level. At each step, the scheduler checks the queue. When one request finishes, a new one joins the active batch immediately, with no idle slots. Static batching leaves finished slots locked until the whole batch completes; continuous batching eliminates that waste entirely.

55–80%

KV cache waste reduction via PagedAttention

3–5x

throughput vs naive PyTorch loop (H100)

200+

model architectures supported natively

v0.25.1

latest stable release (July 2026)

vLLM also ships with prefix caching (automatic prefix caching, APC), which reuses KV blocks across requests that share a system prompt or few-shot prefix. For RAG pipelines and agent workflows where every request starts with the same 2,000-token context, this cuts prefill compute to near zero for repeat prefixes.

The current stable release is v0.25.1 (July 2026). It requires Python 3.10–3.14 and an NVIDIA GPU with compute capability 7.0 or above (Volta and later: V100, T4, A100, H100, H200, B200, RTX 6000 Pro).

vLLM vs TGI vs SGLang: Which Inference Engine for 2026 Workloads

TGI is no longer a real option. Hugging Face moved TGI to maintenance mode in December 2025 and now contributes directly to vLLM and SGLang. TGI accepts minor patches and documentation fixes, but no new features are coming. The 2026 decision is vLLM versus SGLang.

Criterion vLLM SGLang TGI
7B–8B throughput (H100) ~12,500 tok/s ~16,200 tok/s ~2,500 tok/s
70B+ throughput gap vs SGLang 3–5% behind marginal lead not comparable
GPU utilisation under load 85–92% 85–92% 68–74%
Prefix/shared-context workloads APC (good) RadixAttention (better) none
Model coverage 200+ architectures narrower maintenance only
Cold start (70B) ~60 sec ~60 sec variable
Active development Yes, 2,000+ contributors Yes, growing Maintenance mode

The practical rule: use vLLM for 70B+ models, diverse model types, or when you want the largest community and broadest hardware support. Use SGLang if your workload is heavily prefix-shared: agent pipelines, RAG with fixed system prompts, or structured output at scale. The throughput gap on large models is 3–5%, which is within noise for most production workloads (Spheron H100 benchmarks, March 2026; Rawlinson 2026 dual-H100 benchmark).

On dual H100 serving Llama 3 70B, vLLM achieves 210ms TTFT at p50 and 20ms TPOT at p50; SGLang is roughly 10% ahead on TTFT, a difference that matters for interactive chat but not for batch workloads.

GPU Selection for vLLM: H100, H200, or B200: VRAM Math and Cost per Token

The right GPU for vLLM depends on two numbers: model size in VRAM and your target cost per million output tokens.

GPU VRAM Max precision packet.ai price/hr Best for
L40S 48 GB GDDR6 FP16/BF16 from $0.66/hr 7B–13B inference
H100 SXM 80 GB HBM3 FP8 from $2.50/hr 13B–70B, high concurrency
H200 SXM 141 GB HBM3e FP8 from $2.49/hr 70B single-GPU, best $/token
B200 SXM 192 GB HBM3e FP4/FP8 from $3.75/hr 70B–405B, lowest CPM at scale

Quick VRAM sizing rule: a model in BF16 needs roughly 2 bytes per parameter. Llama 3.1 8B needs ~16 GB; Llama 3.1 70B needs ~140 GB. Add 20% headroom for KV cache at target concurrency. An H200 at 141 GB fits Llama 3.1 70B in BF16 with room for KV cache, while an H100 at 80 GB requires FP8 quantization or tensor parallelism across two GPUs for the same model.

packet.ai H200 SXM starts at $2.49/hr, which is 44% below the $4.50/hr on-demand median on AWS and Azure for the same GPU, with no egress markup and no multi-year lock-in.

On cost per million output tokens: for Llama 3.3 70B at FP8, a single H200 delivers approximately $0.50/M tokens versus $0.17/M tokens on a B200 (SemiAnalysis InferenceX benchmarks, 2026). If your workload runs above 50M tokens/month, the B200's higher hourly rate pays for itself quickly.

Provider H100 SXM/hr H200 SXM/hr B200 SXM/hr
packet.ai from $2.50 from $2.49 from $3.75
CoreWeave ~$2.80–$3.50 ~$3.50–$4.50 ~$4.34+
Lambda Labs ~$2.49–$3.50 ~$3.50–$4.50 ~$4.50+
AWS / Azure $4.59–$8.90 $8.00–$13.78 $10.00–$14.24

How to Deploy vLLM on GPU Cloud: Step-by-Step Setup

This section covers a single-GPU vLLM deployment on GPU cloud from instance launch to a working OpenAI-compatible API endpoint. The commands work on any H100 or H200 instance running Ubuntu 22.04 with CUDA 12.1+ and Docker.

1

Provision your GPU instance

Spin up an H100 SXM, H200 SXM, or B200 SXM instance on packet.ai clusters. SSH in and run nvidia-smi to confirm all GPUs appear with correct VRAM. Dynamic-tier GPU instances on packet.ai are SSH-ready in under 5 minutes.

2

Pull the official vLLM Docker image

Using Docker avoids dependency conflicts and pins your vLLM version. The official image includes CUDA, cuDNN, and all required Python packages. For a deeper look at Docker flags and OOM debugging, see our guide to vLLM Docker deployment for production LLM inference.

docker pull vllm/vllm-openai:latest
3

Launch the OpenAI-compatible API server (single GPU)

This command starts vLLM serving Llama 3.1 8B on port 8000 with an OpenAI-compatible endpoint. Swap the model name for any HuggingFace-hosted model your GPU has VRAM to hold.

docker run --gpus all \
  --ipc=host \
  -p 8000:8000 \
  --shm-size 8g \
  -v ~/.cache/huggingface:/root/.cache/huggingface \
  -e HUGGING_FACE_HUB_TOKEN=your_token_here \
  vllm/vllm-openai:latest \
  --model meta-llama/Llama-3.1-8B-Instruct \
  --dtype bfloat16 \
  --gpu-memory-utilization 0.90 \
  --max-model-len 8192 \
  --max-num-seqs 64
4

Test the vLLM OpenAI-compatible API

vLLM exposes /v1/completions, /v1/chat/completions, and /v1/models, the same paths the OpenAI Python SDK hits. No client code changes required.

curl http://localhost:8000/v1/chat/completions \
  -H "Content-Type: application/json" \
  -d '{
    "model": "meta-llama/Llama-3.1-8B-Instruct",
    "messages": [{"role": "user", "content": "What is vLLM?"}],
    "max_tokens": 200
  }'
5

Verify GPU utilisation

Run this in a second SSH session while load-testing. With continuous batching active and concurrent requests queued, SM utilisation should stay above 80%.

watch -n 1 nvidia-smi dmon -s u

Two flags matter most for production tuning: --gpu-memory-utilization controls how much VRAM vLLM reserves for KV cache (0.90 is safer than the default 0.95 on variable-length workloads); --max-num-seqs caps concurrent sequences in the batch. Start conservative and raise both after profiling real traffic.

Watch out

The --shm-size 8g flag is mandatory for multi-GPU configurations. Without shared memory headroom, NCCL (NVIDIA's GPU communication library) crashes silently on the first all-reduce operation. Single-GPU deployments are less affected but it is good practice to always include it.

vLLM Tensor Parallelism: Multi-GPU Config for 70B+ Models

A 70B model in BF16 needs roughly 140 GB of VRAM. That exceeds any single H100 (80 GB) and sits at the edge of a single H200 (141 GB) when KV cache is included. For these models, vLLM tensor parallelism splits every transformer layer across multiple GPUs. Each GPU holds a fraction of the attention heads and MLP weights and processes its shard in parallel.

One flag enables it: --tensor-parallel-size N, where N is the number of GPUs. It must equal your provisioned GPU count exactly.

# 70B model on 2x H200 (or 4x H100) via tensor parallelism
docker run --gpus all \
  --ipc=host \
  -p 8000:8000 \
  --shm-size 16g \
  -v ~/.cache/huggingface:/root/.cache/huggingface \
  -e HUGGING_FACE_HUB_TOKEN=your_token_here \
  vllm/vllm-openai:latest \
  --model meta-llama/Llama-3.1-70B-Instruct \
  --dtype float16 \
  --tensor-parallel-size 2 \
  --max-model-len 16384 \
  --gpu-memory-utilization 0.92 \
  --max-num-seqs 64 \
  --enable-prefix-caching
Model Min VRAM (BF16) Recommended config tensor-parallel-size
Llama 3.1 8B ~16 GB 1x L40S or 1x H100 1
Llama 3.1 70B ~140 GB 1x H200 (FP8) or 2x H100 1 or 2
Llama 3.1 405B ~810 GB 8x H200 or 4x B200 8 or 4
DeepSeek V3 (671B) ~1,342 GB 8x B200 8

NVLink-connected GPUs (H100 SXM, H200 SXM, B200 SXM) scale at roughly 1.84x per GPU added via tensor parallelism, near-linear. PCIe-connected consumer cards (RTX 4090, L40S) scale at roughly 1.4x per card, because PCIe bandwidth (~64 GB/s bidirectional) becomes the bottleneck for all-reduce operations between GPUs. For large-model tensor parallelism, SXM interconnect is not optional.

For models above a single node (Llama 3.1 405B on 8x H200 clusters or DeepSeek V3 on multi-node B200), vLLM uses Ray for distributed orchestration and NCCL for inter-GPU communication. Plan for at least 100 Gbps InfiniBand between nodes; standard 10 Gbps Ethernet causes NCCL to become the bottleneck for models above 70B parameters.

vLLM Quantization: FP8, AWQ, and When to Use Each

vLLM quantization reduces VRAM requirements and increases throughput by lowering the bit-width of model weights and activations. Three formats matter in practice for 2026 GPU hardware.

FP8

Native on H100, H200, B200 (Hopper and Blackwell). Typically 1.5–1.8x throughput improvement over BF16 with minimal quality loss on calibrated checkpoints.

Enable: --dtype fp8

AWQ (INT4)

4-bit weight quantization with activation-aware scaling. Roughly 2x VRAM reduction with under 2% accuracy loss on most benchmarks. Useful for fitting 70B models on a single H100.

Enable: --quantization awq

GPTQ (INT4/INT8)

Post-training quantization using layer-wise Hessian approximation. Slightly lower quality than AWQ at INT4, but wide model availability and strong HuggingFace library compatibility.

Enable: --quantization gptq

FP8 is the right default for H100 and H200 on production workloads where you control the checkpoint. AWQ is better when you need to run an off-the-shelf 70B model on a single 80 GB H100 without tensor parallelism. It cuts VRAM from ~140 GB to ~70 GB with acceptable quality. GPTQ is worth considering when an AWQ checkpoint is not publicly available for your target model.

B200 adds native FP4 support (NVFP4), which doubles effective memory bandwidth utilisation versus FP8 and is the cost-per-token frontier for large-model inference in 2026. FP4 is enabled via --dtype nvfp4 on Blackwell hardware, so verify your vLLM version supports it before deployment.

On the same B200 hardware, TensorRT-LLM updates alone dropped inference cost from $0.11 to $0.02 per million tokens over two months in early 2026 by switching to optimised FP4 kernels (NVIDIA Developer, April 2026). Software stack choice moves CPM as much as hardware choice does.

Frequently asked questions

A 70B model in BF16 requires roughly 140 GB of VRAM. Your options: one H200 SXM (141 GB) running the model at FP8 to leave room for KV cache; two H100 SXM (80 GB each) with --tensor-parallel-size 2; or one B200 SXM (192 GB) with full BF16 headroom. The H200 on packet.ai starts at $2.49/hr and is the most cost-efficient single-GPU option for 70B inference in 2026.
vLLM continuous batching schedules at the decode-iteration level. At each token generation step, the scheduler checks whether any request has finished and immediately adds waiting requests to fill the freed slots. Static batching holds all slots until the full batch completes, wasting 60–80% of GPU capacity on variable-length workloads. Continuous batching keeps GPU utilisation above 85% at moderate concurrency. It is enabled by default in vLLM v0.3 and later.
Yes. vLLM exposes /v1/completions, /v1/chat/completions, and /v1/models, the same endpoints the OpenAI Python SDK and compatible clients call. You can switch an existing OpenAI-based application to a self-hosted vLLM endpoint by changing one line: the base_url in your client config. No other code changes are needed. Tool calling and structured output (guided decoding) are also supported.
Use vLLM for 70B+ models, broad model coverage (200+ architectures), and the largest community. Use SGLang if your workload is prefix-heavy: RAG pipelines, agent stacks, or multi-turn chat where every request shares a long system prompt. SGLang's RadixAttention gives roughly 29% higher throughput on 7B–8B models in prefix-heavy workloads. On 70B+ models, the gap narrows to 3–5%, within noise for most production teams.
FP8 is the right default for H100 SXM. Native hardware support gives 1.5–1.8x throughput improvement over BF16 with minimal quality loss. Use AWQ (INT4) if you need to fit a 70B model on a single 80 GB H100 without tensor parallelism across two GPUs. AWQ cuts VRAM roughly in half with under 2% accuracy loss on standard benchmarks. GPTQ is a fallback if no AWQ checkpoint is available for your target model.
It depends on the GPU and model. On packet.ai, an H100 SXM starts at $2.50/hr and an H200 SXM starts at $2.49/hr. Running Llama 3.1 70B at FP8 on a single H200 costs roughly $0.50 per million output tokens at production throughput. AWS and Azure charge $8.00–$13.78/hr for H200, which is 3–5x more for identical hardware. Deploy your vLLM workload on packet.ai GPU clusters and verify current pricing at packet.ai/pricing.

Last reviewed: July 23, 2026. Deploy vLLM on H100, H200, or B200 clusters on packet.ai. Browse available GPU clusters or check current pricing at packet.ai H200 and packet.ai B200.

Waste less compute.

Same models. Same API. Fraction of the cost. Start free — no credit card required.

Start Building →

More from the blog