valite
Docs navigation

Docs/Guides/Testing New Models

Testing New Models

Replay your captured traffic against candidates offline — prove iso-quality before anything touches production.

Replay, not live experiments

When a new model ships, you want to know: would it hold up on my traffic, and what would it save? valite answers this by re-sending your captured request bodies to the candidate — your workflow is never re-run and your users are never exposed. Sampling is deterministic (seeded), so a replay is reproducible.

Only callsites shortlisted by triage are replayed; quality anchors are excluded by construction. Cross-provider replays (e.g. OpenAI traffic against a Claude model) are translated automatically, except for tool-calling requests, which stay same-provider.

Replay spends real money

Replay calls candidate models at your expense, so the job is budget-gated: without an explicit budget (or confirm: true) it fails fast and returns a cost projection plus a suggested budget instead of running.

How candidates are scored

Each candidate is measured per callsite on four axes:

Compliance — for schema-strict callsites (JSON mode, tool calls), does the output actually parse and validate? For prose, is it non-empty? Quality — a pairwise comparison against your captured baseline output (see the judge below). Latency and cost per call — measured directly, with live pricing pulled from provider catalogs and cached for six hours. Models without published pricing are flagged, never silently treated as free.

Deterministic graders can replace or supplement the judge per workflow: json_valid, nonempty, or regex:<pattern> — and you can plug in your own eval command that scores runs however you like.

The judge is a screen, never the gate

Quality comparison uses a blinded pairwise LLM judge: model names are hidden, both response orders are tried, and the two votes must agree — if they don't, the verdict degrades to a tie. Verdicts are A, B, TIE, or BAD(both unusable). The judge must come from a different model family than both the incumbent and the candidate; valite warns if it doesn't. With no judge configured, a token-overlap F1 score is used as a proxy instead.

Judge scores screen candidates in or out of the shortlist. The gate — the thing that decides whether a routed configuration is acceptable — is always your own metric via the quality bar.

A/A calibration

Before trusting the judge on your traffic, run the calibrate job. It regenerates sampled calls with your own incumbent model and has the judge compare captured vs. fresh — the true difference is zero by construction, so any preference the judge shows is bias. Calibration passes when arm deviation stays within 0.25 and position-swap agreement is at least 0.5; fewer than 10 judged pairs marks the result underpowered.

The quality bar

The bar job freezes a non-inferiority bar from your baseline runs: bar = mean − k·σ of your own run-level scores (default k = 1.0). A candidate configuration passes when the 95% bootstrap confidence interval on its score difference stays within that margin. The job flags saturated metrics (zero variance), high variance, and underpowered baselines — and requires 5 complete runs before it will freeze anything.

Run a replay

1

Check readiness

shell
curl https://gateway.valite.ai/valite/api/workflows/support-triage \
  -H "x-valite-admin-secret: $VALITE_ADMIN_SECRET" \
  -H "x-valite-account-id: <org-id>"

The readiness block tells you whether enough complete runs are logged.

2

Run the pipeline up to replay

Each stage is a POST that returns a job; poll /valite/api/jobs/<id> until it reports succeeded before starting the next stage. Direct curls need the control-plane headers (see Authentication) — or trigger each stage from the workflow's dashboard page instead. Note that calibrate regenerates calls with your incumbent model, so it needs a budget like replay does:

shell
base=https://gateway.valite.ai/valite/api/workflows/support-triage/jobs
auth=(-H "x-valite-admin-secret: $VALITE_ADMIN_SECRET"
      -H "x-valite-account-id: <org-id>" -H "Content-Type: application/json")

curl -X POST "$base/profile" "${auth[@]}" -d '{}'
curl -X POST "$base/triage" "${auth[@]}" -d '{}'
curl -X POST "$base/bar" "${auth[@]}" -d '{}'
curl -X POST "$base/calibrate" "${auth[@]}" -d '{"budget": 2.00}'
3

Replay against candidates

shell
curl -X POST \
  https://gateway.valite.ai/valite/api/workflows/support-triage/jobs/replay \
  -H "x-valite-admin-secret: $VALITE_ADMIN_SECRET" \
  -H "x-valite-account-id: <org-id>" -H "Content-Type: application/json" \
  -d '{"models": ["gpt-4o-mini", "claude-haiku-4-5"], "budget": 5.00}'

The result reports actual spend, per-candidate compliance, quality, latency, and cost per call. From there, plan a route.