Skip to content

CLI

servtuner is one Go binary. It runs as a Kubernetes Job or as a local process with the same command line.

Generated from servtuner commit 5b46cdad0e5c.

These apply to servtuner run. Other commands use the codes named in their help.

Code Meaning
0 Succeeded
1 The run failed
2 Invalid RunSpec or flags
3 Target unreachable
4 The bundle could not be written. Wins when several apply.

Recompute analysis.json from a bundle’s raw files.

Recomputes analysis.json (the data quality gate, per-stage client statistics with bootstrap confidence intervals, and the capacity model) from the bundle's raw files only, and writes it into the bundle. The result is validated against its schema before it is written, and running it twice gives the same bytes. Exits 0 on success, 1 when the analysis cannot be computed, 2 for a bad argument or an invalid RunSpec, and 4 when analysis.json cannot be written.
Usage:
servtuner analyze <bundle> [flags]
Flags:
-h, --help help for analyze

Read a booted vLLM’s KV capacity and print a boot result.

Reads vllm:cache_config_info from the target's /metrics through the TLS and credential code a run uses, and prints a tuningBootResult (boot-results.schema.json) with num_gpu_blocks and c_kv = num_gpu_blocks x block_size / tokens_per_request. The tuning loop feeds it to servtuner propose . Exits 1 when the target cannot be read or serves no cache config, 2 for an invalid request.
Usage:
servtuner boot-probe --input <boot-probe-request.json> [flags]
Flags:
-h, --help help for boot-probe
--input string the probe request (boot-probe-request.schema.json)
--secrets-dir string directory where the Secrets the target names are, one subdirectory per Secret (default: $SERVTUNER_SECRETS_DIR, else /etc/servtuner/secrets)

Check that a run could reach, authenticate to and observe a target.

Runs the target checks against the request's target with the TLS, credential and Prometheus code a run uses: resolve, connect, tls, auth, model, generate (only when the request asks), metrics, gpu_metrics and workload. Secrets are read from --secrets-dir as servtuner run reads them. Writes check-target-result.json to standard output. Exits 0 whenever the checks ran, whatever they found, and 2 for a bad argument or an invalid request.
Usage:
servtuner check-target --input <check-target-request.json> [flags]
Flags:
-h, --help help for check-target
--input string the check request (check-target-request.schema.json)
--kubeconfig string kubeconfig for reading a workload target's pods (default: in-cluster config; none means that check is a warning)
--secrets-dir string directory where the Secrets the target names are, one subdirectory per Secret (default: $SERVTUNER_SECRETS_DIR, else /etc/servtuner/secrets)

Compare analysed runs: configurations, objectives with intervals, the winner and the Pareto set.

The experiment comparison. Runs with identical declared knobs are repeats of one configuration. Every objective is estimated per configuration, with a Student t interval across repeats or a bootstrap over the pooled request records, and a configuration wins only when its interval clears the runner-up's (with single samples, by more than twice the 5% noise floor). Runs that measured different workloads, ladders or SLOs are not comparable and nothing wins. The bundles must have been analysed. --objective defaults to slo_rps_per_gpu for vllm, slo_rps_per_core for routers and slo_max_rps otherwise. Writes comparison.json to --out, or to standard output. Exits 0 on success, 2 for a bad argument or an invalid document, and 1 when the comparison cannot be computed.
Usage:
servtuner compare --bundles <bundle>,<bundle>... [--objective NAME] [flags]
Flags:
--bundles strings analysed bundle directories
-h, --help help for compare
--objective string the primary objective (comparison.schema.json objectiveName)
--out string where to write comparison.json (default: standard output)

Generate the autocompletion script for the specified shell.

Generate the autocompletion script for servtuner for the specified shell.
See each sub-command's help for details on how to use the generated script.
Usage:
servtuner completion [command]
Available Commands:
bash Generate the autocompletion script for bash
fish Generate the autocompletion script for fish
powershell Generate the autocompletion script for powershell
zsh Generate the autocompletion script for zsh
Flags:
-h, --help help for completion
Use "servtuner completion [command] --help" for more information about a command.

Help about any command.

Help provides help for any command in the application.
Simply type servtuner help [path to command] for full details.
Usage:
servtuner help [command] [flags]
Flags:
-h, --help help for help

Print every vLLM flag as a knob, with vLLM’s own description and limits, as JSON.

Prints the knob catalog embedded in this binary as one KnobCatalog document: every vllm serve flag with its label, kind, default, choices and limits, read from vLLM's source at the pinned version, marking the knobs servtuner captures and tunes. The api serves it at GET /knobs, so the catalog has one source.
Usage:
servtuner knobs [flags]
Flags:
-h, --help help for knobs

Run vLLM for servtuner’s tuning loop on a host outside Kubernetes.

Serves the launcher API: servtuner's deployer starts, stops and inspects `vllm serve` here with the flags a tuning session chooses ("Hosts outside Kubernetes"). Settings come from flags, over a YAML config file (--config, $SERVTUNER_LAUNCHER_CONFIG, $XDG_CONFIG_HOME/servtuner/launcher.yaml, then /etc/servtuner/launcher.yaml; deploy/launcher/README.md). Every request needs the bearer token in the token file. vLLM's own API key, if any, is read from the API key file and given as VLLM_API_KEY, never sent over the network. Under systemd, the files default to the unit's LoadCredential= launcher-token and vllm-api-key. The TLS mode is required and never inferred: platform serves plain HTTP, tls serves the certificate and key files.
Usage:
servtuner launcher [--config FILE] [--listen ADDR --token-file FILE --tls-mode platform|tls] [flags]
Flags:
--api-key-file string file holding vLLM's --api-key value, given to vLLM as VLLM_API_KEY (api_key_file)
--config string YAML config file (default: $SERVTUNER_LAUNCHER_CONFIG, $XDG_CONFIG_HOME/servtuner/launcher.yaml, /etc/servtuner/launcher.yaml)
-h, --help help for launcher
--listen string address to serve the launcher API on (listen) (default ":9123")
--log-dir string directory for vllm.log (log_dir) (default "servtuner-launcher")
--tls-cert-file string server certificate, tls mode (tls_cert_file)
--tls-key-file string server key, tls mode (tls_key_file)
--tls-mode string platform (plain HTTP) or tls; required (tls_mode)
--token-file string file holding the bearer token every request must carry (token_file)
--vllm string the vllm executable (vllm) (default "vllm")

Plan replicas, HPA and totals for a traffic level from measured capacity models.

Plans each capacity model against the request: the per-replica SLO-max at the requested SLO, interpolated only between measured stages, then replicas, HPA, totals, queue concurrency and sensitivity, with the request's overrides applied. --payload-models adds runs of a tier's configuration at other request sizes, which only fit its memory per in-flight request m(s). Writes plan.json to --out, or to standard output; --out-dir writes plan.json, patches/plan-values.yaml and plan.md there instead. It reads only the given files. Exits 0 on success, 2 for a bad argument or an invalid document, and 1 when the plan cannot be computed.
Usage:
servtuner plan --input <plan-request.json> --models <capacity_model.json>... [flags]
Flags:
-h, --help help for plan
--input string the plan request (plan-request.schema.json)
--models strings capacity_model.json files, one per tier
--out string where to write plan.json (default: standard output)
--out-dir string write plan.json, patches/plan-values.yaml and plan.md into this directory
--payload-models strings capacity_model.json files of a payload-size series, for m(s)

Print the workload presets built into this bench, as JSON.

Prints every workload preset embedded in this binary as a JSON array of WorkloadPreset documents, sorted by name and version. The api serves them at GET /workload-presets, so the catalog has one source.
Usage:
servtuner presets [flags]
Flags:
-h, --help help for presets

Choose the next configuration of a tuning session, or say the search is done.

The tuning loop's choice of what to run next. It reads the search space, the boot-probe results (--infeasible: boots that failed, and those that worked with their c_kv) and the session's analysed bundles, and writes the next configurations to boot or run, each with its ladder and a rationale, or a done verdict. Tiers run in order (feasibility, structural, scheduler, fine_tuning), then the best configurations are confirmed with the full ladder and repeats. It is pure: it reads files, writes JSON, and gives byte-identical output for the same inputs. The session's budget is the caller's. Writes to --out, or to standard output. Exits 0 on success, 2 for a bad argument or an invalid space, and 1 when no proposal can be computed.
Usage:
servtuner propose --space space.yaml [--bundles <bundle>,<bundle>...] [--infeasible <file>] [--out proposal.json] [flags]
Flags:
--bundles strings analysed bundle directories of the session so far
-h, --help help for propose
--infeasible string boot-probe results (YAML or JSON)
--out string where to write the proposal (default: standard output)
--space string the search space (YAML or JSON)

Execute one run and write its bundle.

Executes one run end to end and writes the run bundle into --out. With --api-url, status events are POSTed to the api (--api-tls-mode is then required; it is never inferred).
Usage:
servtuner run --spec <path> --out <bundle dir> [flags]
Flags:
--api-tls-mode string transport mode of the api hop: mtls or platform (required with --api-url)
--api-url string api base URL for status events
-h, --help help for run
--kubeconfig string kubeconfig for the read-only target snapshot (default: in-cluster config; no cluster means the Kubernetes part is skipped)
--object-store-ca-file string extra CA bundle the object store's certificate is verified against (mtls only)
--object-store-cert-file string client certificate for the object store (mtls only)
--object-store-key-file string client key for the object store (mtls only)
--object-store-tls-mode string transport mode of the object-store hop with an s3:// --out: mtls or platform (required then; never inferred)
--offline no internet access: never fetch the public token-price datasheet and refuse AWS Price List prices; recorded in environment.json
--out string bundle directory, or s3://<bucket>/<prefix> (default: <data dir>/runs/<run id>)
--run-id string run id, a ULID (default: a fresh one)
--run-token-file string file holding the per-run bearer token
--secrets-dir string directory where the Secrets named by the RunSpec are mounted, one subdirectory per Secret (default: $SERVTUNER_SECRETS_DIR, else /etc/servtuner/secrets)
--shard-index int this process's shard of a RunSpec with engine.shards N: 0 (the default) leads and writes the bundle; 1..N-1 send their share of the load and hand their rows to the leader through --out
--spec string path to the RunSpec (YAML or JSON)
--tls-ca-file string extra CA bundle the api's certificate is verified against, added to the system pool (mtls only)
--tls-cert-file string client certificate for the api hop (mtls only)
--tls-key-file string client key for the api hop (mtls only)

Print the starting search spaces built into this bench, as JSON.

Prints every starting search space embedded in this binary (schema/search-spaces) as a JSON array of SearchSpaceTemplate documents, sorted by name and version. The api serves them at GET /search-spaces for New session, so the catalog has one source.
Usage:
servtuner spaces [flags]
Flags:
-h, --help help for spaces

Check a RunSpec: schema, transport mode rules and stage lengths.

Checks a RunSpec (YAML or JSON) against the schema, the transport rules (mtls needs https://, platform needs http://) and the minimum stage length. Exits 0 when valid and 2 when not, listing every problem. Stage-length findings are warnings unless --strict is given.
Usage:
servtuner validate --spec <path> [flags]
Flags:
-h, --help help for validate
--json print {"valid", "errors", "warnings"} as JSON on standard output (the api reads it); the exit code is unchanged
--spec string path to the RunSpec (YAML or JSON)
--strict treat warnings as errors

Print the vLLM container args for a knob set, as JSON.

Reads a JSON object of vLLM knobs (vllm.max_num_seqs: 256, ...) and prints the container args that set them, as a JSON array, through the same table that captures knobs from a pod's args, so the args always capture back as the same knobs. The api's deployer uses it for managed targets. Exits 2 listing every knob it cannot spell.
Usage:
servtuner vllm-args --knobs <knobs.json> [flags]
Flags:
-h, --help help for vllm-args
--knobs string path to a JSON object of vLLM knobs