/inferencekit:benchmarkingfrom inferencekit
Measures end-to-end inference latency, throughput, memory, and cost for LLM engines. Routes text, image, audio, and video to separate client timers. Useful for comparing engine/configs and validating performance claims.
Ships in inferencekit. 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.
Read when SKILL.md points to them.
Choose the workload before the metric: complete-request latency, sustained throughput, peak memory or cost at the agreed quality. Use the image/audio route in affordability and video checks for those modalities. Token metrics, text load grids and GSM8K below apply to text; other tasks need a registered adapter, with unsupported checks NOT RUN.
bench rounds --mode audio|image|clip runs fresh-process media comparisons; CPU manifests use hardware.backend: cpu for a CPU lock and process-group telemetry. Compare the final evidence ID for each engine in the run plan; media contracts and round scheduling.
For native phone speech, use on-device speech to import first audio, RTF, underruns and throughput under concurrent open-loop load.
Screen individual changes. Use the full protocol at milestones and for published claims. See round sizing, profiling for mechanism and quality checks for eligibility.
GPU approval: benchmarks, ceiling bw, --gpu-bw measure and gates run only with budget.approved: true in intake.yaml or an explicit yes after you stated the cost (GPU, $/h x hours). Record who approved and when.
bench rounds / bench serve (MCP bench_rounds / bench_serve) | bench decode (MCP bench_decode) | |
|---|---|---|
| Timer | the client, time.perf_counter_ns, outside the engine process | inside the engine's process (engine-timed) |
| Engines | any OpenAI-compatible server: vllm serve, SGLang, llama-server, trtllm-serve, a custom engine | in-process vLLM LLM, SGLang Engine, llama-bench, or --engine cmd |
| Modes | single-user (sequential) and open-loop load | batch 1 only |
| Published? | yes: published numbers come only from here | no: label every number "engine-timed" |
bench rounds launches each manifest engine fresh per round, warms it up, runs bench serve once, stops it, checks GPU memory came back and parses the resolved config, in a Williams order under one GPU lock. Why one client timer: an engine that times itself chooses its own boundaries.
inferencekit doctor this session -> ev_env.runs/<id>/manifest.json; inferencekit manifest validate passes.--extra-body: the workload's, else generation_config.json defaults); each baseline at its best documented config for the goal.inferencekit prompts verify --set <dev|path>), identical for every engine.These invalidate a speed claim. Retain runnable timings with their failed checks as diagnostics.
max_tokens, or token counts disagree between methods.workload.rounds (default 5, never below 3; kernel-loop milestones excepted), sized with n ~= (2.5c/h)^2 and passed as --rounds R, or an adaptive plan pre-registered as --ci-target, --min-rounds and a maximum --rounds (references/statistics.md).inferencekit gates run FAIL: each gate catches a known way to improve the number without improving the engine.Benchmark:
- [ ] 1. Approval recorded; claim and R pre-registered; doctor -> ev_env
- [ ] 2. Ceiling: ceiling bw -> ev_bw; roofline at each context you report -> ev_roof
- [ ] 3. Run manifest: per engine its launch line, env, port, ready_check; best documented config for the goal
- [ ] 4. Prove each knob took effect (resolved config / log line); copy it into manifest resolved_config
- [ ] 5. Single-user: bench rounds --mode single --rounds R (fresh server per cell, Williams order, warmup excluded)
- [ ] 6. Capacity (if a goal): bench rounds --mode load (grid, SLO, price, one shared --ref-e2e-ms) -> N*
- [ ] 7. Gates, per engine, while its server is up: relaunch it from the manifest, gates run, stop it -> ev_gates_<label>
- [ ] 8. Verdicts per bucket and metric: bench rounds' <metric>_ratio_to_best with its paired CI95 (see Comparisons)
- [ ] 9. % of ceiling per engine (derived); fill the fixed tables; inferencekit report
inferencekit doctor
inferencekit ceiling bw # -> ev_bw
inferencekit roofline --model <hf-id or config.json> --dtype fp8 --gpu-bw <ev_bw> --context <prompt + gen/2>
inferencekit prompts verify --set dev # prints path + sha256; or --set <path.jsonl> --expected-sha256 <pre-registered>
inferencekit manifest validate runs/<id>/manifest.json
# single-user. Engines start in the calling directory (a relaunch: the run dir), so with relative launch paths
# cd runs/<id> first and pass --manifest manifest.json
inferencekit bench rounds --manifest runs/<id>/manifest.json --prompts <set.jsonl> --rounds <R> --mode single
# capacity: open loop, seeded; --concurrency repeats; the same --ref-e2e-ms gives every engine the same schedule
inferencekit bench rounds --manifest runs/<id>/manifest.json --prompts <dev-load set.jsonl> --rounds <R_load> --mode load \
--serve-args "--concurrency 1 --concurrency 2 --concurrency 4 --concurrency 8 --concurrency 16 --concurrency 32 \
--concurrency 64 --ref-e2e-ms <ms> --seed 0 --slo-ttft-p95-ms 500 --slo-tpot-p95-ms 50 --gpu-price-usd-h <price>"
# gates: per engine, its server up (launched from the manifest line), then stopped
inferencekit gates run --base-url http://127.0.0.1:8000 --engine <label> --run-dir runs/<id> \
--reference-engine <baseline label> # + --spec-off-url <same model, no speculation> if it speculates
inferencekit report <ids...> --format md
# engines without a server only (engine-timed; never published as such):
inferencekit bench decode --engine cmd --cmd '<argv>' --model <m> --prompt-len 1024 --gen-len 256 --rounds 1 --extend <ev_prev>
inferencekit compare <ev_baseline> <ev_candidate> --metric decode_tok_s # same-kind round records
MCP tools: doctor, measure_bandwidth, roofline, prompts_verify, validate_manifest, bench_rounds, bench_serve, run_gates, report, bench_decode, compare (OpenCode: long steps through the CLI, detached). If bench rounds cannot launch an engine: a fresh server per call, bench serve --rounds 1 --engine-kind <vllm|sglang|llamacpp|trtllm> --label <label> --extend <its previous ev>, in the Williams order yourself (generic sends no exact-length field; the default --rounds passes share one process). Serving method, buckets, SLOs, N*, goodput and cost: references/serving.md.
Record each setting's requested value, where it was set and the value the engine resolved (config or log line; bench rounds writes resolved_config/<label>.r<k>.json, RESOLVED / PARTIAL / UNPROVEN), copy it into the manifest, and read every warning: a silently dropped setting once turned an A/B into an A/A (references/engine-configs.md).
At batch 1 each decode step reads all weights plus the KV cache, so time per token >= bytes per token / measured DRAM bandwidth. inferencekit ceiling bw measures it (quote the large-buffer read plateau, never a figure above the datasheet or a copy test); inferencekit roofline gives bytes per token. Numbers quoted from the early engine are engine-timed (rule 18). Batched, prefill and non-NVIDIA ceilings: references/ceilings.md; worked example: references/worked-example-qwen3-8b.md; hand-off cost: references/launch-cost.md.
bench rounds' <metric>_ratio_to_best = median(engine) / median(best), with a paired bootstrap CI95, read with compare's rule (improved | regressed | within_noise | inconclusive, pre-registered effect e, default 0.02; references/statistics.md, "Reading the result"). A claim about two engines, neither of them the best one, needs its own bench rounds --engines <baseline>,<candidate> run.compare accepts matching decode, single-user serve, clip, image or audio records. Load mode is refused. Media needs separate quality and lifecycle proof.inferencekit gates run, MCP run_gates)Per engine, against its live server plus the run directory: caching, token counts, output length, unique prompts under load, speculative/MTP exactness (--spec-off-url), hidden logprob and temperature probes, rare tokens. A live gate run after the server is gone is NOT RUN, not a pass (references/reward-hacks.md). Video: references/video-checks.md.
The protocol is unchanged; the differences (hardware name via --serve-args "--gpu-name MI300X --gpu-count 1", GPU-only gates on a CPU host, the memory check, a vendor-measured ceiling under hw/ with ceiling bw NOT RUN even if it starts on ROCm) are in hardware.md.
| Engine (label) @ version | Precision W / A / KV / lm_head | Resolved key settings (evidence) | Bucket | TTFT p50 / p95 ms | TPOT p50 / p95 ms | Decode tok/s median [CI95] | % of ceiling | Timer | Evidence |
|---|---|---|---|---|---|---|---|---|---|
| client / engine-timed | ev_... |
| Engine (serving config) | SLO (TTFT p95, TPOT p95) | N* | Goodput req/s at N* | Output tok/s per GPU at N* | $/1M output tokens at N* | Knee | Gates | Evidence |
|---|---|---|---|---|---|---|---|---|
| PASS / FAIL | ev_... |
| Pre-registered claim | Ratio [CI95] (source: bench rounds / compare) | Comparison verdict | Claim verdict | Evidence |
|---|---|---|---|---|
| PASS / FAIL / UNPROVEN / NOT RUN |
N* comes from open-loop runs with each engine's best serving config; closed loops hide overload.N* are observed (cite the record), compare ratios too; ratio_to_best with its CI, % of ceiling, goodput and cost are derived (show the formula); any why is inferred until a profile shows it.bench decode numbers carry "engine-timed" and never sit in a published table next to client-timed ones. Publish losing engines, refuted configurations and NOT RUN buckets too (reporting-perf-claims).references/ceilings.md (opens in a new tab)references/engine-configs.md (opens in a new tab)references/launch-cost.md (opens in a new tab)references/reward-hacks.md (opens in a new tab)references/serving.md (opens in a new tab)references/statistics.md (opens in a new tab)references/video-checks.md (opens in a new tab)references/worked-example-qwen3-8b.md (opens in a new tab)What SKILL.md sets; muted values are Claude Code's defaults
npx claudepluginhub kittenml/inferencekit --plugin inferencekit9 skills in this plugin
/evaluating-quantizationChoose a compressed model format by measuring memory, complete-request speed and task/perceptual quality on the exact target hardware. Use for quantization, lower precision or fitting a model on cheaper hardware. Respect the chosen quality policy and separate model-change permissions./inference-triageRoute inference performance questions for text, image, audio, video and other models to the cheapest useful evidence: latency, throughput, memory, hardware cost or quality. Use when unsure where to start; select tools for NVIDIA, AMD, Apple Silicon or CPU and preserve resource authorization./optimizing-inferenceOptimize a model for faster responses, more requests, less memory or cheaper hardware. Ask simple quality and budget questions, research current implementations, tune the strongest supported baseline, investigate compiler/kernel bottlenecks and prove end-to-end results. Covers text, image, audio and video with modality-specific checks; accepts an intake or written brief./optimizing-kernelsProfile-driven loop for building or patching inference engines and kernels on NVIDIA, AMD, Apple Silicon or CPU. Use after baseline tuning and profiling to close a measured bottleneck with one change, a correctness check and an end-to-end screen. Covers custom engines, fusion, attention, matrix kernels and memory traffic; routes to the hardware's supported tools./profilingFinds where inference time goes and why a kernel is slow on NVIDIA, AMD ROCm, Apple Metal and CPUs, routing to vendor timelines then supported kernel analysis; nsys only or the PyTorch profiler when GPU counters are blocked. Use for "where does the time go", "why is decode/prefill slow", "GPU idle", "launch overhead", "which kernel", "is this kernel memory-bound", "nsys", "ncu", "torch profiler", "profile". Never proves a speedup./proving-correctnessVerify correctness and agreed quality after engine, kernel, precision or model changes. Use before a performance claim and for quick exploration screens. Select exact, task or perceptual checks for text, image, audio, video and other supported tasks; keep missing evidence UNPROVEN.Other plugins' skills for the same job