Skip to main content

vLLM in production: scaling enterprise SME

PagedAttention deep dive, continuous batching, tensor/pipeline parallelism, GPTQ/AWQ quantization, Italian SME deployment patterns on Hetzner/OVH.

What do you think about this article?

vLLM in production: scaling enterprise SME
AI EngineeringPhotos:Pavel DanilyukPexels

At a Glance

PagedAttention deep dive, continuous batching, tensor/pipeline parallelism, GPTQ/AWQ quantization, Italian SME deployment patterns on Hetzner/OVH.

vLLM in production: scaling enterprise SME

vLLM in production: scaling enterprise SME

vLLM (Berkeley LLM Serving Engine) redefined inference scaling paradigm since 2023. PagedAttention: the breakthrough enabling 40-100x memory efficiency improvement in KV caching. In 2026, vLLM is production standard for EU SMEs scaling beyond 10-50 req/sec with stringent SLA. This article details: PagedAttention mechanics, continuous batching optimization, tensor parallelism for multi-GPU, GPTQ/AWQ quantization, deployment patterns on Hetzner/OVH CCX, monitoring + observability, cost-benefit vs Ollama and OpenAI API. Includes Kubernetes manifests and Docker Compose recipes production-ready for Italian startup.

1. PagedAttention: KV caching revolution

The legacy problem: when generating 100 tokens from input query, attention mechanism saves Key-Value tensors for every step. On Llama 3.1 8B with 4096 token context, KV memory ≈ 1.2GB per request (bfloat16 precision). Batch 10 requests = 12GB memory wasted in inefficient caching.

Solution PagedAttention (SOSP 2023 paper): Tokenizes KV cache as virtual memory pages (e.g. 16 tokens per page). If two requests share prompt prefix, their KV pages point to the same physical RAM address (copy-on-write). When token output diverges, pages separate. Memory overhead from 12GB drops to 3-4GB batch 10.

Real impact vLLM with PagedAttention:

  • Memory efficiency: Batch size 50 → 10x improvement in memory per request
  • Latency p99: Scheduling + paging overhead <5ms extra vs naive batching
  • Throughput: Global tokens/sec +40-60% vs sequential streaming
  • Fairness: Scheduler guarantees no-starvation for long requests

2. Continuous batching: intelligent scheduling

Legacy transformer serving: wait for batch N to complete entirely before processing batch N+1. If 1 request in batch is slow (long output), entire batch is blocked. Latency p99 grows exponentially.

vLLM continuous batching: when 1 request in batch outputs token, free it from batch, insert new request from waiting list. Tokens are generated in stream, scheduler disposes dynamically.

vLLM scheduler tuning available via command-line options, supporting fcfs (default), dynamic batching, and fair-share policies.

3. Tensor Parallelism (TP) and Pipeline Parallelism (PP)

On Hetzner Cloud GPU server (2x RTX 4090, 48GB VRAM total), single GPU insufficient for Llama 3.1 70B (80GB). vLLM supports two distributed strategies:

Tensor Parallelism (TP): Split every transformer layer HORIZONTALLY across N GPU. Query + Key + Value linear projections distributed. Communication via all-reduce synchronization after each layer.

Pipeline Parallelism (PP): Split VERTICALLY: GPU1 = first 20 layers, GPU2 = last 20 layers. Less inter-GPU communication, but intra-batch latency increases (GPU1 stalls waiting for GPU2 output).

For SMEs, recommend TP for <4 GPU, PP for >4 GPU.

4. Quantization: GPTQ vs AWQ vs bitsandbytes

Reduce model from FP32 (4B per parameter) to 4-bit (0.5B per parameter) = 8x memory reduction, moderate inference latency degradation.

  • GPTQ: Offline quantization, requires calibration dataset (1 epoch training). Trade-off: setup +2-4 hours, inference speedup 30%.
  • AWQ: Quantizes weights based on actual activation distributions. More accurate than GPTQ, identical setup. Recommended for QA/RAG where accuracy critical.
  • bitsandbytes: On-the-fly quantization, no offline prep. Trade-off: latency overhead +10-15%.

Conclusion

vLLM is production-ready for enterprise-scale self-hosted inference in 2026. PagedAttention + continuous batching + tensor parallelism + quantization = cost-effective scaling path for EU SMEs.

Try These Tools

Free developer tools related to this topic.

Commenti

Caricamento commenti...

Sign in to comment

Discuss this article in the community

Join the Telegram group to discuss with other developers, ask questions and share your experiences.

Did you like this article?

Explore other content on the blog or discover my projects