Write a RunSpec
A RunSpec is YAML or JSON. servtuner stores it exactly as submitted, plus a resolved copy with defaults filled in.
Prerequisites
Section titled “Prerequisites”- A target you can reach. See targets.
- The
servtunerCLI, or a running control plane.
1. Start with the required fields
Section titled “1. Start with the required fields”apiVersion: servtuner.dev/v1kind: RunSpecname: example-runtarget: type: openai-compatible endpoint: http://localhost:18000/v1 model: mock-model tls: { mode: platform }engine: { type: loadgen }workload: streaming: true dataset: type: synthetic input_tokens: { mean: 128 } output_tokens: { mean: 32 }load: stages: - { rate: 10, duration: 60s }target.tls and workload.streaming are required. servtuner never infers either.
2. Shape the workload
Section titled “2. Shape the workload”| Field | Effect |
|---|---|
dataset.input_tokens, output_tokens |
Mean and standard deviation of the synthetic lengths |
dataset.shared_prefix |
Prompts share one of a fixed number of prefixes, to exercise prefix caches |
dataset.padding_bytes |
Extra payload per request |
conversation |
Multi-turn chat with growing history. Chat and loadgen only |
preset |
A named workload instead of dataset and conversation |
seed |
Makes the generated requests repeatable |
3. Shape the load
Section titled “3. Shape the load”Each stage offers a rate for a duration. pacing is constant, poisson, linear or sine. Use poisson when you want random arrivals. Warmup defaults to 30 seconds and stays out of summaries.
Make a stage long enough. Let I be the slowest relevant scrape interval:
stage >= max(10 x I, 60s, requests needed / RPS, 10 x mean E2E)p95 needs 200 requests and p99 needs 1,000. At 5 RPS, a p99 stage therefore needs 200 seconds.
4. Add SLOs and metrics
Section titled “4. Add SLOs and metrics”Set any of ttft_p95, itl_p95, e2e_p95 and max_error_rate. Add prometheus to explain results and size resources. Catalogs follow the target type. Optional ones such as dcgm are collected only when found.
5. Group runs
Section titled “5. Group runs”Set experiment and knobs when you compare configurations. Add labels to filter the runs list.
Verify
Section titled “Verify”servtuner validate --spec run.yamlIt exits 0 when valid and 2 when not, listing every problem. Warnings do not fail it unless you pass --strict.
You can also use Validate in New run. It calls the same rules.
Next steps
Section titled “Next steps”See every field, set SLOs, or use a preset.