Serving an open-weight LLM with vLLM on an H100

From a bare Ubuntu image to an OpenAI-compatible endpoint for Llama 3.1 70B in FP8, with the flags that matter and how to measure throughput yourself.

CtCheapServ teamWritten by Updated 9 min read
A GPU card floating above a pedestal with light beams flowing out
On this page8
  1. What fits on one H100
  2. The base system
  3. The flags that matter
  4. A systemd unit that survives reboots
  5. A reverse proxy with an API key
  6. How to measure it
  7. Monitoring
  8. When to move on

This guide builds a vLLM server step by step, so you can reproduce it on a bare Ubuntu image or adapt the vLLM template on our H100 plans. The target is a production-shaped endpoint: Llama 3.1 70B Instruct in FP8 on a single 80 GB H100, an OpenAI-compatible API behind a reverse proxy with an API key, and enough measurement to know when it is time for a second card.

What fits on one H100

An 80 GB card holds a 70B model only if the weights are quantised. In FP8, Llama 3.1 70B weighs about 70 GB, which leaves roughly 8 GB for the KV cache after CUDA and vLLM overhead. At about 320 KB of BF16 cache per token, that holds roughly 25,000 tokens across all running requests: one 16k conversation or a couple of dozen short chats at once, but not a single 32k context. If you need long contexts and high concurrency on 70B, you want two H100s with tensor parallelism; if you need neither, an 8B or 14B model on an RTX 5090 costs a fraction and answers faster.

ModelPrecisionWeightsKV cache left (80 GB)Full 8k contexts at once
Llama 3.1 8BBF1616 GB~58 GB~50
Qwen2.5 32BFP833 GB~41 GB~20
Llama 3.1 70BFP870 GB~8 GB~3
Llama 3.1 70BBF16140 GBdoes not fit2× H100 minimum

The base system

Start from the Ubuntu 24.04 · CUDA 12.8 · driver 570 base. Confirm the card and driver, then install a Python environment. We use uv because it resolves the CUDA wheels in seconds.

nvidia-smi --query-gpu=name,memory.total,driver_version --format=csv
curl -LsSf https://astral.sh/uv/install.sh | sh
uv venv /opt/vllm && source /opt/vllm/bin/activate
uv pip install vllm==0.6.6 huggingface_hub[cli]

Log in to Hugging Face with a token that has accepted the Llama licence, and pre-download the weights to /data, so the service loads a local copy instead of fetching 70 GB when it first starts:

huggingface-cli login
huggingface-cli download neuralmagic/Meta-Llama-3.1-70B-Instruct-FP8 --local-dir /data/models/llama-70b-fp8

The flags that matter

vLLM has a hundred flags. Five of them decide whether the server is good.

vllm serve /data/models/llama-70b-fp8 \
  --served-model-name llama-3.1-70b \
  --max-model-len 16384 \
  --gpu-memory-utilization 0.95 \
  --max-num-seqs 48 \
  --enable-prefix-caching \
  --host 127.0.0.1 --port 8000
  • --max-model-len reserves KV cache per sequence. Set it to the longest prompt you will actually serve, not to the model's maximum; 16k halves the memory per slot compared with 32k.
  • --gpu-memory-utilization 0.95 is safe on a card that runs nothing else. Leave it at the default 0.9 if you share the GPU with a second process.
  • --max-num-seqs caps concurrent sequences. Too high and requests queue inside the scheduler with long tails; too low and the card idles. Start at 48 for 70B FP8 at 16k and adjust from the metrics.
  • --enable-prefix-caching reuses KV blocks for identical prompt prefixes, which is most of a chat system prompt. It is close to free and can noticeably raise throughput on chat traffic.
  • --host 127.0.0.1: vLLM's only authentication is an optional static key (--api-key) that covers the /v1 routes and nothing else, so the server must never listen on the public interface.

A systemd unit that survives reboots

cat > /etc/systemd/system/vllm.service <<'EOF'
[Unit]
Description=vLLM OpenAI-compatible server
After=network-online.target
[Service]
User=vllm
Environment=HF_HOME=/data/hf
ExecStart=/opt/vllm/bin/vllm serve /data/models/llama-70b-fp8 --served-model-name llama-3.1-70b --max-model-len 16384 --gpu-memory-utilization 0.95 --max-num-seqs 48 --enable-prefix-caching --host 127.0.0.1 --port 8000
Restart=always
RestartSec=5
[Install]
WantedBy=multi-user.target
EOF
useradd -r -d /data -s /usr/sbin/nologin vllm && chown -R vllm /data
systemctl daemon-reload && systemctl enable --now vllm
journalctl -fu vllm

Loading 70 GB of weights takes a while; the log line Uvicorn running on http://127.0.0.1:8000 means the server is ready.

A reverse proxy with an API key

Caddy gets a certificate automatically and can check a bearer token in three lines. Point a DNS record at the server first.

apt install -y caddy
cat > /etc/caddy/Caddyfile <<'EOF'
llm.example.com {
  @noauth not header Authorization "Bearer CHANGE-ME-32-RANDOM-CHARS"
  respond @noauth 401
  reverse_proxy 127.0.0.1:8000 {
    flush_interval -1
  }
}
EOF
systemctl reload caddy

flush_interval -1 is what makes streaming responses stream instead of buffering. Test with the OpenAI SDK by setting base_url to https://llm.example.com/v1 and api_key to the token; nothing else in your client changes.

How to measure it

Throughput depends on prompt length, completion length and how many requests arrive at once, so measure it with your own traffic. Replay a sample of real requests at a fixed concurrency with a load-testing tool or a short script, starting at one and doubling each round, and read these figures while each round runs:

FigureWhere to read itWhat it tells you
Generation throughputAvg generation throughput in the vLLM logOutput tokens per second across all requests
Running and pending requestsRunning and Pending in the same log lineWhether requests have started to queue
KV cache usageGPU KV cache usage in the same log lineHow close sequences are to being preempted
Time to first tokenvllm:time_to_first_token_seconds at /metricsHow long a user waits before the answer starts

Aggregate throughput rises with concurrency while each request slows down, until the KV cache fills up or the card runs out of compute; beyond that point, queueing only adds latency. If your traffic regularly sits there, the next step is more GPU memory: a larger card gives the KV cache more room, and several cards with --tensor-parallel-size add compute as well and also unlock BF16.

Monitoring

vLLM exposes Prometheus metrics at /metrics. The three worth alerting on are vllm:num_requests_waiting (anything above a handful for more than a minute means you are saturated), vllm:gpu_cache_usage_perc (above 90% means sequences are being preempted) and vllm:e2e_request_latency_seconds at p95. Add nvidia-smi dmon -s um or the netdata add-on for the card itself.

When to move on

Three signals say the setup has outgrown one card: the waiting-requests metric is rarely zero, your product needs 32k contexts at real concurrency, or you want to serve two models at once. All three are solved by more GPU memory, either a larger card or several cards with tensor parallelism; with several cards, the same unit file works with the tensor-parallel flag added. Until then, this single card serves a surprising amount of traffic for a fixed monthly price.

Ct
CheapServ team

Articles are written and kept up to date by the CheapServ team. Each one shows the day it was published and the day it was last changed.

Deploy your first server in under a minute.

Top up from $25 in BTC, ETH, XMR or USDT. Your balance never expires and unused funds are refundable.

Sign up now