Offline Evals

Run offline evals in Statsig Agent Experimentation to grade every version of an AI Config against a dataset, compare versions with a baseline, and catch regressions before you ship.

An offline eval grades AI output for every row of a fixed dataset of test cases, before any user sees that output. Statsig scores each row with the graders you choose, then reports each grader's score and an overall score for the run. Use offline evals to compare AI Config versions and catch regressions before you promote a version to Live. To grade a sample of live production traffic instead, use online evals. To try a few prompts side by side without grading, use the Playground.

Choose where to run an offline eval

Agent Experimentation runs offline evals in two places. Choose the one that matches the outputs you want to grade:

This page covers evals from an AI Config. For grade-only runs on stored outputs, go to Evals. To run an eval from your own code with Eval(), go to the Node AI SDK.

Set up an eval on an AI Config

Every version of an AI Config shares one set of graders and one dataset, so each version's eval grades the same test cases in the same way. Set both on the AI Config's Setup tab, in the Eval Setup group. You need an AI Config with at least one version. To create one, go to AI Configs.

Add graders

  1. Go to Agent Experimentation > AI Configs and open the AI Config.
  2. On the Setup tab, go to the Graders section of the Eval Setup group.
  3. Click Add grader, then choose one option:
    • A grader from the list: Click its name. The list shows the graders in your company's catalog.
    • Create new grader: Choose a grader type, define the grader in the Create New Grader drawer, and click Add Grader.
  4. Click Save.

An AI Config's eval runs at most 10 graders. Graders that you create from an AI Config join your company's catalog. For grader types and how to define them, go to Graders.

Each grader appears as a card. To change a saved grader's definition, click the card's edit icon, which opens the grader's page. The card's menu sets the grader's role in this AI Config:

  • Set as Primary: Use this grader's score as each run's overall score. For details, go to What is a primary grader.
  • Set as Critical Grader: Fail the run when this grader's score for the run is 0. For details, go to What is a critical grader.
  • Clone Grader: Add a copy of the grader to this AI Config.
  • Remove Grader: Remove the grader from this AI Config.

Add a dataset

  1. On the AI Config's Setup tab, go to the Dataset section of the Eval Setup group.
  2. Click Select a Dataset, then choose one option:
    • Upload Dataset: Upload a CSV file as a local dataset for this AI Config.
    • Browse from Existing Datasets: Pick a global dataset.
    • AI Dataset Generation: Generate test cases from a description.
  3. Click Save.

The button then shows the dataset name with its row count. A local dataset shows as "Custom dataset." For dataset limits, row editing, and the differences between global and local datasets, go to Add a dataset to an AI Config.

Each dataset column is a variable that the version's prompt can reference by name, such as {{question}}. For each row, Statsig fills the variables with the row's values before it calls the model. When a column holds JSON, {{column}} inserts the whole value, and a dotted path such as {{column.items.0.name}} inserts one field. Graders can reference columns too, such as {{expected}}.

An eval from an AI Config generates its own output for each row, so its dataset doesn't need an output column.

Run an offline eval

  1. In the AI Config's header, click Run Eval.
  2. In the Start Evaluation dialog, select the versions to evaluate. Statsig selects every version by default and lists the Live version first.
  3. Click Start Evaluation.

Statsig starts one run for each selected version and opens the AI Config's Evals tab on the first run. While a run is in progress, the tab shows how many rows are complete. A run can take a few minutes. To stop a version's run, select the version on the Setup tab and click Stop Evaluation in the header.

To evaluate one version, select it in the Version section of the Setup tab, open the version's menu, and click Start Evaluation.

If the AI Config has unsaved changes, you can't select the version you're editing. When you start an eval on other versions, Statsig asks you to discard the unsaved changes first. To include the edited version, save your changes before you click Run Eval.

Model calls and Included Credits

For each row, Statsig calls the version's model provider to generate the output. A version with a custom workflow calls your workflow endpoint instead. LLM as a Judge graders call the provider set in each grader's Evaluation Model. Statsig charges these model calls to your Included Credits unless your company has its own API key for the provider. For details, go to Credits and API keys.

Why Run Eval is disabled

Hover over the disabled button to see the reason:

Review results on the Evals tab

The AI Config's Evals tab shows offline eval results for one version at a time. At the top of the tab, choose Single version or Compare, then choose a version and a run. Statsig numbers each version's runs in order, such as Run #1 and Run #2.

Review a single run

With Single version selected, the Evals tab shows these results for the chosen run:

  • Model, Score, and Prompt cards: The model that the run used, the run's overall score, and the prompt messages that the run used. The overall score is the primary grader's score for the run, from 0 to 1. Click the Prompt card to read the full messages.
  • Offline graders chart: Each grader's score for the run, which is the mean of its row scores. A score above 0.66 counts as a pass.
  • Results table: One row for each dataset row, with the output, the latency, and each grader's score. Filter the table with Search rows, and use Columns to show or hide dataset columns. To export the table, click the Download results as CSV icon.

Click a row in the results table to open Row Details. The drawer shows the row's dataset values, the output, the latency, and a card for each grader with its score. For LLM as a Judge graders, the card lists the judge's reasoning steps.

Compare two versions

To compare two versions' runs, click Compare. Choose the version and run to compare. Then, after "relative to," choose the baseline version and run. The baseline is the Live version's latest finished run by default.

The comparison shows:

  • Model, Score, and Prompts cards for both runs.
  • An Offline graders chart that rates the compared run against the baseline run for each grader: Better, Worse, or No significant change.
  • A results table with both runs' outputs and scores for each row. Row Details shows the two runs side by side.

Statsig compares two runs only when both runs have finished, both have a primary grader score, and both used the same dataset version. Otherwise, the tab explains what's missing, for example "Both runs must use the same dataset version." Each upload, generated dataset, or edit to the AI Config's dataset starts a new dataset version. After you change the dataset, run the eval again on both versions before you compare them.

Stale runs and critical grader failures

Two indicators on the Evals tab mean that a run's score needs attention:

  • Stale: This chip appears when the version changed after the run. The run's results reflect the earlier version. To grade the current version, run the eval again.
  • Critical grader failure: The banner "This eval run failed due to the critical grader" appears, with the grader's name, when a critical grader's score for the run is 0. The run's overall score is then 0. For details, go to What is a critical grader.

Rows that fail to generate

If Statsig can't generate a row's output, for example because the model provider or workflow endpoint returns an error, the results table shows the error in place of the output. The row's graders show "Not graded," and its latency shows N/A. Statsig leaves the row out of grader scores, the run's overall score, version comparisons, and the scores in the CSV download.

A grader error is different from a failed row. If a grader fails on a row, such as a Python grader that raises an exception, the row scores 0 for that grader. For details, go to Write a Python grader.

Find offline eval traces in AI Traces

Each row of an offline eval run produces one trace in AI Traces:

  • The root span has the AI Config's name. Its child span, named chat and the model name, such as chat gpt-5-mini, records the model call that generated the output. A version with a custom workflow has no child span, because your workflow endpoint makes its own model calls. To show your endpoint's spans under the root span, go to Join a workflow eval's trace.
  • Both spans set statsig.environment to eval, and the Service column shows statsig-offline-evals.
  • The root span records the run, dataset, and row in statsig.eval.run_id, statsig.eval.dataset_id, and statsig.eval.dataset_row_id.
  • When a row fails to generate, its spans have an error status.

AI Traces hides eval spans by default. To show them, remove eval from the default environment filter in the search bar. For details, go to Environments.

Click a span to open the trace drawer. The Graders tab shows each grader's score for the row, with the judge's reasoning for LLM as a Judge graders.

Statsig keeps offline eval scores out of the online grader results on the AI Config's Traces tab, so dataset runs don't change the scores for your production traffic.

Was this helpful?

For AI agents: a documentation index is available at /llms.txt. Append .md to any page URL for markdown, or send Accept: text/markdown.

On this page