Skip to main content
What you learn: simulate a stand-in agent, grade it with a one-line judge, read pass@1 with an interval, keep the rows worth training on. Needs: nothing. Takes: sixty seconds.
Running your own model? Your model and your key is the two-line version: the model as a string, the key in the provider’s usual environment variable.

First command: did my prompt rewrite help?

The question most people arrive with. Run the old prompt and the new one on the same questions, on a model on your machine, and get one verdict: the gain, its 95% range over tasks, and PASS only when the range clears zero. --demo runs a scripted model, so it needs nothing installed:
With your prompts, your test set and a local model it is free: no key, no credits.
tasks.jsonl is one {"prompt": ..., "reference": ...} per line, and --reward is any wai.verify class or module:function. The seed (0 unless you pass --seed) fixes every sampling draw and the bootstrap, so a rerun prints the same report. The same check in Python, here on a two-line stand-in so it runs anywhere:
Both prompts draw reply j of a question on the same seed, the eval runs three times a side so the report can measure its own noise (one run reads INCONCLUSIVE), and the two row sets go to wai.compare unchanged: the interval and the verdict are its own. The before-and-after recipe has the null check (the old prompt on both arms reads NO DIFFERENCE).

The loop, offline

No key, no network. seeded_agent is a stand-in agent. It answers honestly most of the time and, on a labeled fraction of rollouts, does one thing wrong on purpose: hedges, flatters, or claims success after a tool failed. Each row records what it did in seeded, so you can check that your judge catches exactly those rows before you trust it on real ones.
1

Write a tool

A tool is a typed function. The signature is the schema, the docstring is the description. One is enough.
2

Simulate

simulator=False writes the customers from templates, so no model is called. mode="rl" with repeats=4 plays every ask four times, which is what pass@k needs.
3

Grade and read the number

Any callable that takes a row and returns a reward is a judge. This one uses the label the stand-in agent left behind.
4

Keep the rows worth training on

select runs the gates: replies that quote the answer key the grader was given, the 20 to 80% difficulty band, unanimous groups, duplicates, truncation, a scan for what the reward is really tracking. Print it and it says what each gate dropped and why. Four of the stand-in’s planted mistakes recite the answer key, and they never reach the training file.
A histogram of tasks by pass rate at k=8: the 20 to 80 percent band is shaded and kept, the all-pass and all-fail bars are grey and dropped as unanimous groups, the bars just outside the band are dropped as too hard or too easyA histogram of tasks by pass rate at k=8: the 20 to 80 percent band is shaded and kept, the all-pass and all-fail bars are grey and dropped as unanimous groups, the bars just outside the band are dropped as too hard or too easyThe warnings are part of the answer. The judge here reads the label the stand-in left behind, and the planted mistakes add words, so shorter replies really are better; on a real judge that line means check whether it grades the job or the word count.
pass@1 is the pass rate over tasks with a bootstrap interval. pass^4 is how often all four rollouts of a task pass. Headroom is pass@4 minus pass@1, the gap an RL update could close.

Your model, your key

Every role in a run is a model behind an endpoint. Say which with a backend object; its repr tells you where the call goes and which key it uses. Set it once for the process, or pass it on the call.
wai.Endpoint("Qwen/Qwen3-4B", url="http://localhost:8000/v1") is any OpenAI-compatible server you run; wai.Ollama("llama3") needs no key. With nothing configured, every role uses the model While hosts, on the key from wai login. The full table is on Connect your agent.

Next

Connect your agent

A callable, an endpoint, a backend object, or the hosted model. Plus traces to aim the run.

Evals

A pass rate with an interval, a table of where the agent fails, and a CI check that turns red when it gets worse.

How it works

How the engine picks situations, plays the customer, and breaks the tools on purpose.

The five calls

simulate, grade, trust the judge, select, push: the run in order.
Last modified on October 1, 2026