Replay the frozen payload behind a turn, with edits

POST /Platform/lab/replay-llm

Replay the frozen payload behind a turn, with edits.

This is the pre-validation step of the incident workflow: a proposed change is applied to the cached payload before anything is edited live. Use one replay for deterministic, low-risk prompt/config corrections. Use n >= 5 to measure suspected model slip/flakiness, resolve an ambiguous or inconsistent first replay, or gate high-impact behavior. The same operation also supports config probes (models / payload_overrides).

A list of ids runs the same edit across a cohort of real turns, showing that a change moves the target case without disturbing other traffic.

Comparing models ("can this call site / agent / tier switch to M?"): select a cohort (call_site / agent_id / tier + since / per_stratum), pass models=[M] and judge_correctness=true. Every replay is judged against its original (correct / wrong, which is better) and the verdicts are stored as labels; each turn is also replayed on its own original model (baseline) as the noise floor. Read model_report: per model the correct rate with a 95% interval, regressions (original right, replay wrong), fixes, errors, cost per call, latency, and the same per response-shape stratum. Drill into any cell with llm_calls, e.g. replay_run_id=<run_id>, model_resolved=<M>, verdict=wrong. model_report compares models, so it leaves out edited replays; read an edited arm's cost and latency from llm_calls(replay_run_id=<run_id>) and its per-tool rates from summary.tool_counts.

When the validated change is promoted through a changeset, attach the replay as reviewable evidence: pass test_evidence=[{"tool": "lab replay", "ref_id": <replay/llm_request id>, "outcome": "passed"|"failed", "summary": ...}] to entities changeset-open / changeset-refresh.

Safe by construction: caching and tool execution are disabled; integrations are never touched. There is no branch parameter — the payload is frozen, so a branch cannot rebuild instructions; branch-aware validation is what live AgentTests (run_tests) are for.

Costs money: n x models real completions per turn, plus judge and arbiter calls in judge mode, capped at MAX_REPLAYS_PER_RUN across the run (an over-cap request is refused with its planned counts before anything runs). REPLAY_CONCURRENCY turns replay at once, and the run may take up to 30 minutes. In a cohort, a turn whose cached payload was evicted, or whose replay failed, keeps its place in results with failure set (and is listed in selection.missing_ids / selection.failed); match results to turns by llm_request_id. Asynchronous by default: requests completing within ~45s (small cohorts) return their result inline; longer sweeps return HTTP 202 with a pollable async id (GET /Platform/jobs/async/{async_id}). Force either behavior per request with ?async= or Prefer: headers.

Body parameters

Returns

ReplayLLMResponse

Example request

curl -X POST "https://api.hilus.ai/Platform/lab/replay-llm" \
  -H "Authorization: Bearer $HILUS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{}'