Skip to content

Validate an llm-d deployment

Use this guide after every deploy, scale event and rollout step: a smoke test proves the endpoint answers, a benchmark proves the deployed stack meets its SLO under load, and this book's slo_check.py turns per-request records into a verdict CI can gate on. Both llm-d tools talk to the router endpoint, so they work unchanged on TPU. Chapter 21 shows how the steps fit together; chapter 24 covers what makes a number trustworthy.

Prerequisites

  • A deployed llm-d path on TPU (Optimized baseline) with NAMESPACE set.
  • curl and, for auto-discovery and JSON output, jq.
  • For the benchmark: a CPU node with room for the harness pod and, unless you pass --no-pvc, shared storage for the workload PVC (on GKE, a Filestore instance that bills until removed).

Steps

1. Smoke-test the endpoint

healthcheck.sh (in the llm-d repository at docs/operations/validation/smoke-test/healthcheck.sh) checks /health (optional), /v1/models and one completion with its latency. From a port-forwarded or reachable endpoint:

./healthcheck.sh -e http://${IP} -m Qwen/Qwen3-32B -l 5000 -o json

-l 5000 fails the run when inference takes longer than 5,000 ms; --api chat forces chat completions; --require-health makes a non-200 /health a failure. From inside the cluster, as a one-off pod:

kubectl run llm-d-healthcheck --rm -i --restart=Never \
  --namespace ${NAMESPACE} \
  --image=alpine:3.20 \
  -- sh -lc '
    apk add --no-cache bash curl jq >/dev/null &&
    bash -lc "$(cat docs/operations/validation/smoke-test/healthcheck.sh)" -- -e http://llm-d-gateway:80 -o json
  '

Replace http://llm-d-gateway:80 with your router address (http://<release>-epp:80 in Standalone Mode). For repeated runs, the guide's ConfigMap plus Job form keeps the script in the cluster.

Check: exit status 0, and the JSON reports the model and a latency under your budget.

2. Install the benchmark CLI

curl -sSL https://raw.githubusercontent.com/llm-d/llm-d-benchmark/main/install.sh | bash
cd llm-d-benchmark
source .venv/bin/activate
llmdbenchmark --version

The installer uses sudo to place helm, helmfile, kubectl and oc in /usr/local/bin; an early stop can be silent, so check they exist there and are executable.

Check: the installer ends === Done === and llmdbenchmark --version prints a version.

3. Resolve the endpoint and the exact model ID

# Standalone Mode
export GUIDE_NAME=optimized-baseline
export ENDPOINT_URL="http://$(kubectl get service ${GUIDE_NAME}-epp -n ${NAMESPACE} -o jsonpath='{.spec.clusterIP}')"
export GATEWAY_CLASS=standalone
# Gateway Mode on GKE:
# export ENDPOINT_URL="http://$(kubectl get gateway llm-d-inference-gateway -n ${NAMESPACE} -o jsonpath='{.status.addresses[0].value}')"
# export GATEWAY_CLASS=gke

kubectl run curl-probe -n "${NAMESPACE}" --rm -it --restart=Never \
    --image=cfmanteiga/alpine-bash-curl-jq \
    -- sh -c "curl -s ${ENDPOINT_URL}/v1/models | grep -o '\"id\":\"[^\"]*\"'"

Always pass --gateway-class: without it the CLI's rendered plan may not match your topology.

Check: the probe prints the ID you will pass to --model.

4. Run a sanity profile, then the guide's load ladder

llmdbenchmark \
    --spec           guides/optimized-baseline \
    run \
    --endpoint-url   "${ENDPOINT_URL}" \
    --gateway-class  "${GATEWAY_CLASS}" \
    --model          "Qwen/Qwen3-32B" \
    --namespace      "${NAMESPACE}" \
    --harness        inference-perf \
    --workload       sanity_random.yaml \
    --monitoring

Pass the .yaml form of the profile. --monitoring adds the engines' /metrics and pod logs to the report. After the sanity run, use the guide's guide_<guide-name>_<n>.yaml profiles, which reproduce its published load ladder. Every harness except lm-eval records TTFT, ITL, TPOT, end-to-end latency and throughput and writes the harness-agnostic benchmark_report,_stage_*.yaml files.

Check: the run ends with a BENCHMARK RUN SUMMARY; read the report per stage. The stage where P90 TTFT crosses your SLO is the pool's capacity at that replica count.

5. Turn records into an SLO verdict

python code/ch21_operating/slo_check.py --cpu-smoke
python code/ch21_operating/slo_check.py results.json --replicas 4

The script computes nearest-rank p50, p90 and p99 of TTFT and TPOT, the verdict at your SLO's percentile (default P90, 3 s TTFT and 100 ms TPOT), the saturation ratio the SLO-aware autoscaler sees and the replica count its law asks for. It reads records with ttft_s and tpot_s fields (or chapter 19's agentic_client.py run --json output); llmdbenchmark's per-request schema is not documented, so map its fields yourself.

Check: the smoke path ends cpu-smoke: OK; on your records the script exits 1 on a breach, so CI can gate a rollout on it.

6. Clean up benchmark resources

The CLI removes the harness pod and its ConfigMaps after each run (unless --no-cleanup) but keeps the workload PVC and the llm-d-prism dashboard. Delete llm-d-prism first (it mounts the PVC), then the PVC, following the upstream page's cleanup commands.

Check: kubectl get pvc -n ${NAMESPACE} no longer lists workload-pvc.

Troubleshooting

Symptom Cause Fix
did not return expected model 'X' --model differs from what the EPP serves Step 3's probe; pass the exact ID
Could not detect endpoint for <stack> No --endpoint-url in run-only mode Pass --endpoint-url and --gateway-class
Timed out after 240s waiting for workload PVC No shared storage class Provide one, or --no-pvc
Harness pod Pending, Insufficient cpu No CPU node with room Add CPU capacity
Harness cannot download a gated tokenizer No Hugging Face token for the harness Follow the upstream token handling section
unrecognized arguments: --pvc-bind-timeout Old llmdbenchmark git -C llm-d-benchmark pull and rerun the installer
Smoke test passes without jq but cannot auto-discover jq missing Pass -m

References