Skip to content

capacity-model schema

capacity_model.json: everything the planner needs from one run, so servtuner plan never reads raw data. Per-stage curves are per replica: the run’s achieved RPS over its ready replicas.

Schema file: schema/json/bundle/capacity-model.schema.json. Generated from servtuner commit 5b46cdad0e5c.

Field Type Required Description
analyzer_version string Yes
run_id string Yes
identity modelIdentity Yes
ready_replicas integer Yes Replicas of the workload under test during the usable stages; 0 when unknown, and then the curves cannot be scaled. ≥ 0
stages array of modelStage Yes
per_replica modelPerReplica No
queueing modelQueueing No
memory modelMemory No
scale_out object Yes Replica counts the model was measured at. Linear scale-out is verified only by runs at two or more counts with per-replica RPS within 10%.
infra_cost infraCost No
token_cost tokenCost No

Token cost of the requests at the SLO-max stage, from the bundled datasheet and the router’s own cost counter. Absent when token_pricing is none. An unpriced model is is_priced false with a reason, never free.

Field Type Required Description
is_priced boolean Yes
reason string No
model string Yes The model the requests named (target.model).
datasheet_key string No The datasheet entry that priced it.
datasheet_fetched_at utcTimestamp No When servtuner run fetched the datasheet that priced it (pricing/token.json): the prices are as of then.
datasheet_source "runspec", "price_book", "bifrost_config", "default" No Where that datasheet came from: pricing/token.json’s url_basis (price_book is the operator’s).
stage_index integer No ≥ 0
method "router_metric", "datasheet", "manual" No router_metric: the router’s own cost counter (Bifrost bifrost_cost_total, LiteLLM litellm_spend_metric_total), authoritative; datasheet: servtuner’s own tokens × base prices; manual: servtuner’s own tokens × the RunSpec’s manual prices.
usd_per_1k_requests number No ≥ 0
usd_per_1m_output_tokens number No ≥ 0
datasheet_usd_per_1k_requests number No servtuner’s calculation, kept as the cross-check when the router’s metric is used. ≥ 0
divergence number No |router − datasheet| ÷ router, when both exist; over 0.05 is reported. ≥ 0
retry_added_usd_per_1k_requests number No Router cost minus the cost of the client’s successful requests: what retries and fallbacks added (rules B4 and L3).
approximations array of string No What the calculation does not model.

Infrastructure cost of one replica at the recommended sizing, from pricing/infra.json. Absent when the run’s infra_pricing source is none; is_priced false, with a reason, when the source has no price for this hardware.

Field Type Required Description
source "static", "aws" Yes
is_priced boolean Yes
reason string No Why there is no price.
usd_per_replica_hour number No ≥ 0
method "gpu", "node_share" No gpu: the replica pays for the GPUs it holds (node price ÷ node GPUs, or the GPU model’s price). node_share: it pays for the larger of its share of the node’s allocatable cores and memory.
basis string No The calculation with its values, for display.
discount number No > 0; ≤ 1
usd_per_1k_requests number No A replica’s hour over the requests it serves in an hour at its SLO-max RPS, per thousand (the infra_cost_per_1k_requests objective). ≥ 0
usd_per_1m_output_tokens number No The same per million output tokens, from the SLO-max stage’s output token rate per replica. ≥ 0
unit_cost_reason string No Why a priced replica has no cost per request or per output token (no SLO-max, no replica count, no output token rate).

What the model is valid for: a plan inherits this scope (Guard rails 3).

Field Type Required Description
target_type targetType Yes
knobs map of knobValue Yes Knob values captured from the target.
hardware_profile_id string No
workload_hash string Yes SHA-256 of the RunSpec’s workload block as canonical JSON, without its seed: runs with the same hash measured the same request mix. pattern ^[0-9a-f]{64}$
workload_preset presetRef No The workload preset the run named, when it named one.
arrival_process pacing Yes
quality_grade qualityGrade Yes

A latency percentile of one stage, seconds; absent when the stage had too few samples for it.

Field Type Required Description
p50 number No ≥ 0
p95 number No ≥ 0
p99 number No ≥ 0
Field Type Required Description
stage_index integer Yes ≥ 0
rps_per_replica number Yes ≥ 0
is_usable boolean Yes Valid and not excluded: only usable stages may be interpolated between.
error_rate number Yes ≥ 0; ≤ 1
ttft_seconds latencyPoint No
e2e_seconds latencyPoint No
itl_seconds latencyPoint No

The recommended resources of one replica at the operating point (recommendations.json), summed over the workload’s containers.

Field Type Required Description
cpu_request_cores number Yes ≥ 0
memory_request_bytes number Yes ≥ 0
cpu_limit_cores number No ≥ 0
memory_limit_bytes number No ≥ 0
gpus integer No ≥ 0
hpa_cpu_utilization_percent number No ≥ 0

The operating stage’s queueing inputs, for re-sizing C and B at a planned load.

Field Type Required Description
w_mean_seconds number Yes > 0
w_p99_seconds number Yes > 0
cv number Yes ≥ 0

The router’s working set against requests in flight per replica, WS = baseline + m × L, with the request size it was measured at.

Field Type Required Description
baseline_bytes number Yes ≥ 0
bytes_per_in_flight number Yes > 0
stages integer Yes Usable stages the line was fitted through. ≥ 2
request_bytes_mean number No Mean request body size over the usable stages; absent when the engine reported none. > 0
queue_size integer No The recommended B for the router, held in memory beside C. ≥ 0
limit_headroom number No The sizing policy’s limit headroom h_lim, applied to the working set before it is compared with the memory limit. ≥ 0