Private evals and promotion
Benchmark every candidate against the model in production on your private evals, and promote it only on a statistically significant win.
Define private evals
A suite is a held-out set of prompts from your own traffic, plus graders that score what matters to your business rather than public leaderboards. A suite holds up to 500 examples and 10 graders.
import rsi
suite = client.evals.create_suite(
name="support-private-v3",
prompts=[
{"prompt": "Where is my order #4512?", "reference": "tracking link"},
{"messages": conversation, "reference": "refund issued"},
],
graders=[
"contains",
rsi.Judge("resolution", "Resolves the customer's issue without asking them to repeat details."),
rsi.Judge("policy", "Follows the refund policy and never promises what it can't do."),
],
)Each example is a prompt string, a list of chat messages, or a dict with prompt or messages and an optional reference (the expected answer).
| Grader | Scores |
|---|---|
"exact_match" | 1 if the answer equals the reference (case and spacing ignored), else 0 |
"contains" | 1 if the answer contains the reference (case ignored), else 0 |
"json_valid" | 1 if the answer parses as JSON, else 0 |
rsi.Judge(name, rubric, model=None) | A model reads the rubric, the conversation, the reference and the answer, and scores 0 to 1. The judge defaults to the baseline's base model. |
exact_match and contains need a reference on every example.
Run a candidate against production
Each run answers every prompt with the candidate and with the baseline, using the same messages and the same decoding (temperature 0 by default), so the comparison is fair. The candidate and baseline can each be a checkpoint, a deployment, a live model or a base model.
run = client.evals.run(
candidate=checkpoint,
baseline=deployment,
suite=suite,
)
print(run.metrics, run.significant_win)Answers and judge calls are billed as inference tokens, the same as chat_complete.
Read the result
run.metricsmaps each grader to the candidate's and baseline's mean scores, the difference and a p-value.significant_winis true only if the candidate is better with statistical significance (p < 0.05, paired permutation test) on at least one grader, and significantly worse on none.client.evals.get_run(run.id, include_examples=True)returns every answer and score side by side.
for name, m in run.metrics.items():
print(f"{name}: {m.baseline:.2f} -> {m.candidate:.2f} (p={m.p_value:.3f})")Promote
Promotion swaps the checkpoint behind the same endpoint, so your apps keep working without changes.
if run.significant_win:
client.promote(deployment.id, checkpoint=checkpoint)Dedicated deployments are enabled per account during the preview. Without one, compare against an
earlier checkpoint or the base model: baseline=previous_checkpoint, or the base model's name.
Close the loop
Production traces and feedback become the next training set. Retrain on them, check each candidate against your evals and promote the winners to ship improvements on a regular cadence.