Runs llm-d-benchmark scenarios against a Kubernetes cluster through the standup → smoketest → run → teardown lifecycle. Supports pd-disaggregation, LWS, KEDA experiments, dry-run verification, and Grafana/HTML report generation.
Ships in llm-d-autoscaling. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
Arguments: $ARGUMENTS — free-form. May contain a spec name, a backend, a
namespace (-p <ns> / --namespace <ns>), a lifecycle phase (dry-run,
standup, smoketest, run, teardown, report, or all), and a
harness/workload for run. Anything missing is resolved in Step 1.
The benchmark/ directory is an autoscaling test bed
layered on llm-d-benchmark. It is
not wired into the Makefile — it is driven directly by the upstream
llmdbenchmark CLI (installed from an llm-d-benchmark clone next to the repo root — symlinked in worktrees) with
two repo-local inputs:
--spec benchmark/config/specification/{guides,staging}/<name>.yaml.j2 — a
thin Jinja entrypoint that points at a scenario + upstream defaults/templates.--cluster-config benchmark/config/cluster-configs/<backend>.yaml — a
swappable backend overlay (real vLLM, vLLM-CPU-sim, or inference-sim).--workspace benchmark/results — every session lands under this repo-local
directory instead of a scattered temp dir.benchmark/README.md is the source of truth for the directory's design; read it
if anything here is ambiguous. This skill encodes the operational workflow and
guardrails for running one.
--spec)--spec path | Maturity |
|---|---|
benchmark/config/specification/guides/pd-disaggregation.yaml.j2 | recommended |
benchmark/config/specification/staging/pd-disaggregation/baseline.yaml.j2 | experiment (control) |
benchmark/config/specification/staging/pd-disaggregation/queue-aggressive.yaml.j2 | experiment |
benchmark/config/specification/staging/pd-disaggregation/kv-early.yaml.j2 | experiment |
benchmark/config/specification/staging/lws-pd-disaggregation.yaml.j2 | WIP |
benchmark/config/specification/staging/optimized-baseline/baseline.yaml.j2 | experiment (control, static fleet) |
benchmark/config/specification/staging/optimized-baseline/npd-fcoff.yaml.j2 | experiment (EPP work-rate law; workloads in benchmark/config/workloads/npd-fcoff/) |
Run ls benchmark/config/specification/**/*.yaml.j2 to pick up specs added since
this was written. A bare name like pd-disaggregation or
staging/pd-disaggregation/kv-early maps to the matching .j2.
--cluster-config)--cluster-config path | Runtime | GPU | Notes |
|---|---|---|---|
benchmark/config/cluster-configs/ocp/model-sim-qwen3-32b.yaml | real vLLM (CPU) + simulation plugin | no | default for local/Kind; native vllm: metrics; per-model |
benchmark/config/cluster-configs/k8s/inference-sim.yaml | llm-d-inference-sim | no | fake server; lowest fidelity |
benchmark/config/cluster-configs/ocp/vllm.yaml | real vLLM | yes | GPU cluster only |
benchmark/config/cluster-configs/k8s/model-sim-qwen3-8b-npd.yaml | real vLLM (CPU) + simulation plugin | no | optimized-baseline specs only (no P/D); kind |
benchmark/config/cluster-configs/ocp/vllm-npd.yaml | real vLLM | yes | optimized-baseline specs only (no P/D) |
All three expose native vllm: metrics, so a scenario's KEDA strategy
(triggers/thresholds/scaleTargetRef) is unchanged across backends. All three
overlays now set keda.prometheus (baseUrl/port/authMode/secretName only) to
route through the Thanos Querier route with bearer-token auth — this cluster
has no plain-HTTP monitoring namespace, so the scenario's default
prometheus-operated.monitoring... address never resolves. See the
KEDA PROMETHEUS AUTH comment block in any cluster-config file for the
one-time per-namespace secret-creation command this still requires.
standup → (smoketest) → verify ScaledObjects → run → teardown. The
same --spec, --cluster-config, --workspace benchmark/results, and -p <namespace> must be passed to every command in the lifecycle. Add
--dry-run / -n to any of them to render locally without touching the
cluster. ScaledObject verification is a plain kubectl check, not a CLI
subcommand — see Step 7.
run workloads (-l inference-perf -w <workload>)sanity_random.yaml (quick sanity), guide_pd-disaggregation_1.yaml,
shared_prefix_synthetic.yaml, chatbot_synthetic.yaml. Profiles live in
$ROOT/../llm-d-benchmark/workload/profiles/<harness>/; list them if the user needs
options. Other harnesses: guidellm, vllm-benchmark, aiperf.
From $ARGUMENTS and the conversation, settle:
guides/pd-disaggregation if the user gave none and only
one guide exists; otherwise ask which.ocp/model-sim-qwen3-32b for a local/Kind or non-GPU
cluster; ocp/vllm only if the user says they have GPUs. Confirm if unsure.-p) — required. Never guess; ask if not supplied.dry-run, standup, smoketest, run, teardown,
report, or all (dry-run → standup → smoketest → verify ScaledObjects →
run → report, stopping on failure; teardown only on explicit request).run) — default -l inference-perf -w sanity_random.yaml.Restate the resolved plan in one line before proceeding.
llmdbenchmark on PATHRun everything from the repo root — the directory containing benchmark/
(git rev-parse --show-toplevel). That may be the main checkout or a git
worktree.
The specs resolve upstream files at {{ base_dir }}/../llm-d-benchmark, i.e. an
llm-d-benchmark directory next to the repo root. In the main checkout
that is a normal sibling clone. A worktree lives elsewhere, so no sibling
exists; link the real clone in:
ROOT=$(git rev-parse --show-toplevel)
if [ ! -e "$ROOT/../llm-d-benchmark" ]; then
# Find the clone: the main checkout's sibling, or any dir the user names.
MAIN=$(dirname "$(git rev-parse --path-format=absolute --git-common-dir)")
BENCH=$(cd "$MAIN/../llm-d-benchmark" 2>/dev/null && pwd) # else ask the user
ln -s "$BENCH" "$ROOT/../llm-d-benchmark"
fi
If no clone is found, ask the user for its path (or clone it, below). The symlink sits outside the repo, so it is never committed.
The CLI comes from that clone's venv:
source "$ROOT/../llm-d-benchmark/.venv/bin/activate"
llmdbenchmark --version
If that fails: the clone or its venv is missing. Per benchmark/README.md:
git clone https://github.com/llm-d/llm-d-benchmark.git "$ROOT/../llm-d-benchmark"
cd "$ROOT/../llm-d-benchmark" && ./install.sh && cd -
dry-run only)Anything past --dry-run writes to a cluster. Confirm the target with the
user before the first write:
kubectl config current-context
kubectl cluster-info
For KEDA-based scenarios (all current ones), verify the dependencies the
scenario expects (see benchmark/README.md "Prepare a Kubernetes cluster"):
kubectl get deploy -n monitoring # kube-prometheus-stack (prometheus-operated)
kubectl get deploy -n keda # KEDA >= 2.20
kubectl get deploy -n openshift-keda # OpenShift custom-metrics-autoscaler, if the above is empty
If missing, surface the install commands from benchmark/README.md; don't
install them silently. A local Kind cluster is make create-kind-cluster.
llmdbenchmark standup \
--spec <spec.j2> \
--cluster-config <backend.yaml> \
--workspace benchmark/results \
-p <namespace> --dry-run
Then inspect the rendered merge under the printed session directory
(plan/<scenario>/config.yaml) and confirm:
image, accelerator.count
(0 for CPU sims), per-role resources, initContainers, the vLLM command,
any extraObjects;keda block is unchanged;Report what you checked. Stop here if the phase was dry-run.
Local memory check. A local cluster's pods share this machine's memory,
and a CPU-simulator pod holds a real KV cache in RAM (ocp/model-sim-qwen3-32b
gives each vLLM pod a 20Gi limit). When KEDA scales a pool out, the machine
can run out of memory, and the container runtime or the host then kills
pods. The run becomes meaningless, and the machine may hang. Before a
standup on a local cluster:
resources.limits.memory in
plan/<scenario>/config.yaml) times its ScaledObject's
maxReplicaCount (its static replica count if it is not scaled), plus
the EPP, the harness pod, Prometheus and KEDA (about 4Gi together).docker info --format '{{.MemTotal}}', or podman machine inspect for
its Memory). That must not be more than the host's free memory (vm_stat
and Activity Monitor on macOS, free -g on Linux), less a few GiB for the
host itself. Close other memory-heavy work, such as a blis evaluation.k8s/inference-sim overlay (256Mi per pod), a staging variant
with a lower maxReplicaCount, or a remote cluster. Do not edit the
scenario or the overlay silently.While the run goes on, watch kubectl top nodes (if metrics-server runs)
or docker stats --no-stream. If a pod is OOMKilled, or the host starts
swapping hard, stop the run and report it. Do not report it as a scaling
result.
llmdbenchmark standup \
--spec <spec.j2> \
--cluster-config <backend.yaml> \
--workspace benchmark/results \
-p <namespace>
The last line of output is the workspace path — record it. Runs live under
benchmark/results/<user>-<timestamp>/.
llmdbenchmark smoketest \
--spec <spec.j2> --cluster-config <backend.yaml> \
--workspace benchmark/results -p <namespace>
Per-scenario checks that the deployed pods match the scenario (resources, parallelism, env, probes, routing, vLLM flags).
run)The CLI's smoketest checks pods, not autoscaling. A ScaledObject can be
silently broken (bad PromQL, label mismatch, auth failure) while pods are
Ready — the benchmark would then run against a scenario that never scales.
Gate run on all of the following:
kubectl get scaledobject -n <namespace> -o wide
Every ScaledObject in the namespace (prefill/decode queue+KV triggers, plus
any epp- saturation ones the scenario renders) must show
READY=True. ACTIVE=False is normal when idle (traffic is below
threshold) — that is not a failure. READY=False/blank is.
kubectl describe scaledobject <name> -n <namespace> # for any not READY
Read the Conditions block for the actual error (bad trigger config, can't
reach the metrics backend, etc).
kubectl get hpa -n <namespace>
Check the TARGETS column on the KEDA-managed HPA(s) — <unknown>/<target>
means KEDA/the metrics adapter cannot fetch the metric at all, even if the
ScaledObject itself reports Ready. This is the most common "looks fine but
isn't" failure mode.
If HPA targets are <unknown>, check the operator logs for the underlying
error (Prometheus query failure, DNS, auth). KEDA's namespace varies by
distribution — try both:
kubectl logs -n keda deploy/keda-operator --tail=100 | grep -iE "error|fail"
kubectl logs -n openshift-keda deploy/keda-operator --tail=100 | grep -iE "error|fail" # OpenShift custom-metrics-autoscaler
If logs point to the query itself, confirm the trigger's PromQL actually
returns data by running the exact query (label values included, e.g.
model_name="<model.name>") against Prometheus directly — a label mismatch
between the scenario's model.name and what vLLM actually exports is the
usual culprit (see the model.name gotcha below).
Do not proceed to Step 8 until every ScaledObject is READY=True and its
HPA reports real (non-<unknown>) current metric values. Report what you
checked either way.
llmdbenchmark run \
--spec <spec.j2> --cluster-config <backend.yaml> \
--workspace benchmark/results -p <namespace> \
-l inference-perf -w sanity_random.yaml
Record the session directory from the output
(benchmark/results/<user>-<timestamp>/); results land in its results/
subdir. To benchmark again with a different workload, re-run run with
another -w — no need to re-standup.
For a quick look at what's happening across every session (including this one while it's still in progress), no Grafana needed:
benchmark/hack/benchmark_report.sh serve --workspace benchmark/results
then open http://127.0.0.1:8787/. It re-scans the workspace on every
refresh, so it works mid-standup or mid-run, not just after teardown. Each
experiment's Grafana section has a Live dashboard link (time-boxed to
that run's window and namespace, so it shows only that run's data) and, until a
snapshot exists, a Create Grafana snapshot button — both need a local
Grafana at http://localhost:3000 (see below), no CLI step required.
benchmark/hack/benchmark_report.sh also renders a standalone report.html
for one finished session with lifecycle metrics + Grafana links, and captures a
Grafana snapshot that survives Prometheus retention. It manages its own
venv.
One-time: a local Grafana at http://localhost:3000 and a port-forward to the
cluster's Prometheus (kubectl port-forward -n monitoring svc/prometheus-operated 9090:9090), then benchmark/hack/benchmark_report.sh configure. See
benchmark/docs/benchmark-report.md.
After a benchmark run, with the port-forward still up:
benchmark/hack/benchmark_report.sh all <session_dir>
<session_dir> is the top-level benchmark/results/<user>-<timestamp>/. If Grafana isn't
running the snapshot step is skipped and report.html still renders (noting the
gap).
llmdbenchmark teardown \
--spec <spec.j2> --cluster-config <backend.yaml> \
--workspace benchmark/results -p <namespace>
To redeploy after editing a scenario/overlay: teardown, then standup (no in-place update).
-p / --spec / --cluster-config /
--workspace mismatch between standup and teardown orphans resources.benchmark/config/ is vendored — it references <repo-root>/../llm-d-benchmark
(a symlink is fine in worktrees; see Step 2).model.name in a scenario must equal the vLLM --served-model-name and
the HuggingFace id (it is the harness's request/tokenizer id); shortName is
the k8s label. Don't "fix" one without the others.keda.scaledObjects (triggers, thresholds, scaleTargetRef) must
only come from the scenario. keda.prometheus (baseUrl/port/authMode/
secretName) is cluster-dependent and belongs in the --cluster-config
overlay — all three overlays set it for this cluster's Thanos Querier.
If a backend overlay grows a keda.scaledObjects block, that's a bug.keda; OpenShift's custom-metrics-autoscaler operator installs into
openshift-keda instead. The Step 3 dependency check and the Step 7
ScaledObject check both need to look in whichever one is actually present.ocp/vllm.yaml backend needs real GPUs. Default to ocp/model-sim-qwen3-32b
for CPU/Kind.kubectl config current-context before every cluster write; treat
namespace as required input, never a default.staging/<guide>/ holds scaling-strategy variants: baseline.yaml is the
control (verbatim copy of the guide's keda:), each <strategy>.yaml changes
only the keda: block. Run one exactly like a guide, pointing --spec at
its .j2. Compare a variant against baseline on the same backend; promote a
winner by copying its keda: block into scenarios/guides/<guide>.yaml.
For parameter sweeps (e.g. over keda min/max or workload rate), the CLI has
llmdbenchmark experiment (auto standup/run/teardown per treatment) and
llmdbenchmark results (store/query/diff/pull). Reach for these when the user
asks for a sweep rather than a single run.
What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
/llm-d-autoscaling:run-benchmarkfrom llm-d-autoscaling
npx claudepluginhub llm-d/llm-d-autoscaling --plugin llm-d-autoscaling6 skills in this plugin
/blis-evaluationRun step 3 of this repo's autoscaling evaluation protocol (benchmark/protocol/) — evaluate a KEDA scenario, single-pool or prefill/decode, in blis-signal-lab (BLIS with KEDA's scale loop and an HPA per pool) on a laptop, with the same fixed run set, reports and gate as the GPU evaluation (knee staircase, SO-active staircase, mix-shift, overload under and over the cap, agentic, static-replica baseline, scale from zero, bursty, short spikes, scale-down). Translates the ScaledObjects' triggers into blis signals, runs each load, converts blis's output to llm-d-benchmark's layout, and writes one report per run (a per-stage table and a load-vs-supply figure) and a summary. Use when asked to simulate a scaling configuration, to evaluate a scenario with blis or without GPUs, to rehearse step 5, or to try a trigger change before a GPU run. Invoke with /blis-evaluation <scenario.yaml> [blis scenario] [--lab <blis-signal-lab checkout>]./gpu-evaluationRun step 5 of this repo's autoscaling evaluation protocol (benchmark/protocol/) — evaluate a KEDA scenario on a real GPU plant with the fixed run set (knee staircase, SO-active staircase, mix-shift, overload under and over the cap, agentic, static-replica baseline, scale from zero, bursty, short spikes, scale-down) and write one report per run (llm-d-benchmark's report plus a load-vs-supply figure) and a summary, from data captured on the live cluster. Use when asked to run a scenario on GPUs, to measure a scaling configuration on real hardware, to calibrate a knee or μ_SLO on a GPU, or to compare an autoscaled run with a static fleet. Invoke with /gpu-evaluation <scenario.yaml> [backend overlay] [--context <kube-context>]./scenario-sanity-checkSanity-check a benchmark scenario in this repo's benchmark/ test bed end to end — standup succeeds, every pod is Running and healthy, sending requests increases a role's replicas by 1, and stopping the requests scales it back down to minReplicas. Use before trusting a new or edited scenario/staging variant/backend overlay, or when asked to "sanity check", "smoke test the autoscaling of", or "verify scaling for" a scenario. Invoke with /scenario-sanity-check [spec] [backend] [-p namespace]./simulator-verificationRun step 2 of this repo's autoscaling evaluation protocol (benchmark/protocol/) — prove on a real cluster, with a vLLM simulator instead of GPUs, that each failure the step 1 verdict predicted for a KEDA scenario actually shows up (or show that step 1 was wrong), and write the verdict with SVG plots drawn from captured data. Use when asked to verify, reproduce, confirm or test a step 1 / static-signal-analysis verdict on a cluster, to run a staging scenario against vllm-model-sim or llm-d-inference-sim, or to check a proposed fix to a scaling trigger. Invoke with /simulator-verification <step 1 verdict.md> [backend overlay] [--context <kube-context>]./static-signal-analysisRun step 1 of this repo's autoscaling evaluation protocol (benchmark/protocol/) on a KEDA scaling configuration — judge, without a cluster, whether each trigger and their combination can compute the right replica count, and write the verdict. Use when asked to review, assess or analyze a scenario's keda block, a ScaledObject, a new staging variant, or a PromQL scaling trigger before running it. Invoke with /static-signal-analysis <scenario.yaml> [backend overlay].Other plugins' skills for the same job