← All articles

Inference · July 5, 2026 · 4 min read

Serving LLMs with vLLM: throughput tuning guide

Learn how to optimize vLLM throughput using memory tuning, quantization, and batching strategies on Podstack's high-performance GPU cloud.

Serving Large Language Models (LLMs) in production is a balancing act between latency (how fast a single user gets a response) and throughput (how many total requests your system can handle simultaneously). While several inference frameworks exist, vLLM has emerged as the industry standard due to its PagedAttention algorithm, which drastically reduces memory waste.

However, simply running vLLM with default settings often leaves performance on the table. To maximize your hardware ROI on Podstack, you need to tune the engine to match your specific workload.

Understanding the vLLM Architecture

vLLM's primary innovation is PagedAttention, which manages KV (Key-Value) cache memory like an operating system manages virtual memory. Instead of allocating a contiguous block of memory for a sequence—which leads to fragmentation—vLLM breaks the cache into blocks.

When tuning for throughput, your goal is to keep the GPU’s Tensor Cores as busy as possible by fitting as many tokens as possible into these blocks without triggering an Out-of-Memory (OOM) error.

Step 1: Optimizing GPU Memory Utilization

The most important parameter in vLLM is --gpu-memory-utilization. By default, vLLM reserves 90% of the available VRAM.

  • For Dedicated Throughput: If you are running a single model on a dedicated Podstack GPU instance, you can often push this to 0.95.
  • For Multi-process Environments: If you have sidecar processes or multiple model runners, you must lower this to avoid crashes.
# Example: Launching vLLM with high memory utilization and specific block size
vllm serve "facebook/opt-125m" \
    --gpu-memory-utilization 0.95 \
    --max-model-len 4096 \
    --block-size 16

Step 2: Tuning Batch Size and Concurrency

Throughput scales with batch size. vLLM uses "continuous batching," meaning it doesn't wait for a full batch to start processing; it adds new requests to the iteration as soon as slots become available.

To maximize throughput, you should tune:

  1. max_num_seqs: The maximum number of sequences per iteration. For smaller models (e.g., Llama 3 8B) on high-end GPUs, increasing this from the default 256 to 512 or higher can saturate the GPU better.
  2. max_num_batched_tokens: This limits the number of tokens processed in a single step. Increasing this helps throughput but can increase the "time to first token" (TTFT).

Step 3: Quantization for Massive Throughput

If your application can tolerate a slight dip in precision, quantization is the single most effective way to double or quadruple your throughput. By using 4-bit or 8-bit weights, you reduce the memory footprint of the model, allowing for significantly larger KV caches.

vLLM supports AWQ and FP8 out of the box. Using an AWQ-quantized model allows you to serve a 70B parameter model on hardware that would normally only fit a 30B model, effectively increasing your throughput-per-dollar.

Step 4: Distributed Serving (Tensor Parallelism)

When working with massive models like Llama 3 70B or Mixtral, a single GPU might not have enough VRAM or memory bandwidth. Using Podstack's multi-GPU configurations, you can enable Tensor Parallelism (--tensor-parallel-size or -tp).

For throughput, the rule of thumb is: use the smallest number of GPUs that can comfortably fit the model and a large KV cache. Spreading a small model across too many GPUs introduces communication overhead that can actually decrease total throughput.

Deployment on Podstack

Podstack makes it easy to deploy these optimized vLLM containers. Since Podstack bills by the second, you can spin up a high-throughput cluster for a batch job and tear it down immediately after completion.

To deploy an optimized vLLM instance using the Podstack API:

import os
from podstack import PodstackClient

# Ensure your PODSTACK_API_KEY is set in your environment
client = PodstackClient(api_key=os.getenv("PODSTACK_API_KEY"))

# Define a high-throughput GPU function
@client.gpu_function(gpu="A100", memory="80GB")
def run_vllm_server():
    # Inside the container, we execute the tuned vLLM command
    os.system("""
        python -m vllm.entrypoints.openai.api_server \
            --model neuralmagic/Meta-Llama-3-8B-Instruct-FP8 \
            --max-num-seqs 512 \
            --gpu-memory-utilization 0.95 \
            --port 8000
    """)

Alternatively, you can use the Podstack API to launch a job directly:

Podstack does not ship a command-line interface. Use the console, the Python package `podstack-sdk`, or the API at https://podstack.ai/api/v1 with a `ps_live_` key.

Practical Tips for Production

  • Monitor Cache Usage: Watch the vllm:gpu_cache_usage_perc metric. If it’s constantly at 100%, you are likely hitting a bottleneck and need more VRAM or more instances.
  • Request Prioritization: If you have a mix of long-form generation and short chat replies, consider running separate Podstack endpoints tuned differently for each.
  • Auto-scaling: Use Podstack’s serverless inference capabilities to scale the number of vLLM replicas based on the queue depth, ensuring you aren't paying for idle GPUs when traffic drops.

By fine-tuning memory allocation and leveraging quantization on Podstack’s on-demand infrastructure, you can achieve production-grade LLM performance without the overhead of traditional cloud management.

Try it on Podstack

Per-second GPUs and pay-per-token models. Add $5, get $10 on your first top-up.

Start building