Skip to main content
Simulations are how you make evidence for a proposed fix — run a candidate change against a curated dataset, measure the outcome delta, and (if it looks good) promote it into the improvement queue for a human to approve. Authenticated by PAT simulate scope. Simulations are paid — they run LLM calls against your dataset and bill against your workspace LLM keys.

Budget is required

A budget is required on every run (no default — a runaway spend would be silent). Two shapes:
  • budgetUsd: <n> — hard USD cap.
  • budgetMinutes: <n> + confirmUsdCeiling: <n> — time cap, plus an expected-cost ceiling the SDK confirms before starting.
The SDK has no human in the loop, so a bare budgetMinutes (with no cost ceiling) is refused — you’d have no way to abort a runaway.

Verbs

Simulations are long-running: run returns a roundId immediately and you poll for progress.

estimate

No LLM calls. Server returns projected cost and duration for the config you’d pass to run. Use this to gate — “if the projection exceeds $X, don’t run.”

run(lineageId, opts)

Kicks off a simulation. lineageId identifies which change lineage you’re testing. Returns { roundId } immediately.

get(roundId)

Full round state — progress, per-case verdicts, aggregate delta, provider errors if any. Poll until done.

remaining(roundId)

Just the count of remaining cases. Lighter than get — right for a progress bar.

requery(roundId)

Re-rank the same case results with a different scoring config. Free — no new LLM calls, just a re-scoring pass on the stored outputs. Use this to see how sensitive the “did this help?” answer is to your scoring choice.

promote(roundId)

Take a completed round and file it as an improvement proposal. It then flows into the improvement queue for a human to approve — the simulation is evidence, approval is what ships.

Common patterns

Estimate → gate → run

Poll with a progress bar

Time budget with confirmation

If you only care about wall time, pair budgetMinutes with a cost ceiling the SDK checks against estimate before starting:

Where simulations sit in the loop

The SDK surfaces simulations (the evidence generator) and improvements (the decision queue). Making the initial improvement candidates from clusters is what the loop’s internals do — not an SDK verb. Once a candidate exists, you can re-simulate it here to refresh the evidence, then promote back into the queue.