- Compare prompt and model variations using consistent inputs
- Identify regressions before changes reach production
- Measure quality using standardized criteria and judges
- Review aggregate scores and row-level results to understand performance
- Decide whether a variation is ready for rollout
Ways to run offline evaluations
You can run offline evaluations in two ways: in the playground or from code. Both methods use datasets, evaluation criteria, and thresholds, and both record results that you review in LaunchDarkly:- In the playground: Configure and run an evaluation in the LaunchDarkly UI. LaunchDarkly generates the outputs from a config variation. To learn how, read Configure an offline evaluation in the playground.
- From code: Run an evaluation from a script or CI workflow with the AI SDK. Your code generates outputs with your own handler, and LaunchDarkly records the results. To learn how, read Run offline evaluations from code.
| Playground | From code | |
|---|---|---|
| Where you configure it | The LaunchDarkly UI | A script or CI workflow that uses the AI SDK |
| Who generates the outputs | LaunchDarkly, using a config variation and model | Your handler, using your own code and model provider |
| Criteria | Evaluation criteria and judges | Judges and scorers |
| Datasets | Datasets uploaded to LaunchDarkly | Datasets uploaded to LaunchDarkly, or rows defined in your code |
| Where you review results | The Evaluations page | The From code tab on the Evaluations page |
| Best for | Exploring and comparing variations interactively | Repeatable runs, regression checks, and gating a release in CI |
Offline and online evaluations
Offline and online evaluations serve different purposes. Offline evaluations:- Run before deployment
- Use datasets with known inputs and expected outputs
- Evaluate variations in a controlled environment
- Help validate changes before rollout
- Run in production on live user traffic
- Evaluate responses using attached judges
- Score responses continuously
- Help monitor performance after release
How offline evaluations work
Offline evaluations use config variations to generate and evaluate outputs for a dataset. Each row in the dataset represents a single evaluation task. This approach lets you evaluate many inputs at once and understand how a variation performs across a consistent set of scenarios. For each input, LaunchDarkly performs the following actions:- Generates a model output. In evaluations from code, your handler generates the output instead.
- Evaluates the output using selected criteria or judges.
- Records structured results.
Example evaluation result
The following example shows the result for a single dataset row, including a score and reasoning returned by the evaluation criteria or judge.Criteria and thresholds
A criterion is a check that LaunchDarkly applies to each output. In the playground, you select evaluation criteria and judges. In evaluations from code, a criterion is either a judge or a scorer. A scorer is a check that runs locally in your script, such as whether the output contains an expected value. Each criterion has a threshold, which is the score a row must meet to pass that criterion. LaunchDarkly compares each row’s score with the threshold to decide whether the row passed. The run passes when no row fails or returns an error. You set thresholds in different places depending on how you run the evaluation:- In the playground: Set thresholds in the “Acceptance criteria” panel.
- From code: Set thresholds when you configure each criterion. By default, a scorer’s threshold is 1.0, which means a row passes only on a perfect score. A judge’s default threshold is 0.5. To learn more, read How verdicts work.
Configure an offline evaluation in the playground
Configure an offline evaluation in the playground to define the dataset, config variation, model, evaluation criteria, and execution settings such as sampling and runtime limits. Use this configuration to control what inputs are tested and how outputs are evaluated. For example, you can use sampling to test a subset of inputs, run a preview to validate your setup, and define thresholds that reflect your quality standards. To access and configure an offline evaluation:- Navigate to your project.
- Click Agent management > Evaluations in the left sidebar. The “Evaluations” page appears.
- Click Run evaluations.
- Choose From playground.
- Create or open an evaluation in the playground. For detailed steps, read Create and manage evaluations.
- Configure the evaluation, including selecting a dataset and config variation.
- Configure evaluation criteria and thresholds in the Acceptance criteria panel.
- Choose how dataset rows are sampled using the row selection controls.
- (Optional) Run a preview on a subset of rows.
Dataset requirements
Offline evaluations use uploaded datasets as input for config variations. To learn how to prepare and upload datasets, read Datasets. Datasets must be in CSV or JSONL format and can include expected output, variables, and metadata. Use datasets to validate outputs by comparing them to expected results. Dataset schema includes:input: Prompt or request used to generate a model response. Accepts a string or JSON object.expected_output: Optional. Ideal output used for comparison or scoring. Accepts a string or JSON object.variables: Optional. Named placeholders used in prompt templates. These are substituted into message templates. Example:{{variable_name}}metadata: Optional. JSON object of arbitrary key-value data attached to a row for tracking, filtering, or reporting. Metadata is stored alongside results but is not used in generation or evaluation. Example:{"source": "production", "category": "factual"}
Run offline evaluations from code
You can run offline evaluations from your own code or CI workflow with the AI SDK. Each call torun() in the SDK creates an evaluation and runs your handler against every row in a dataset. The SDK scores each output with the judges and scorers you choose, and sends the results to LaunchDarkly.
Running evaluations from code lets you:
- Generate outputs with the same code and model provider your application uses.
- Score outputs with deterministic scorers that you write in code, with LaunchDarkly judges, or with both.
- Use a dataset uploaded to LaunchDarkly, or define dataset rows directly in your code.
- Evaluate the tool calls an agent makes to reach its answer.
- Use the pass or fail result of a run to gate a release in CI.
Run and review evaluations
Run offline evaluations to understand how your config variations perform across a dataset before deciding whether to release changes. When you start an evaluation run, LaunchDarkly processes dataset rows asynchronously. Each row is processed independently to generate outputs, apply evaluation criteria, and record results. Results are available during and after execution. As rows are processed, progress updates continuously so you can monitor evaluation status. Complete evaluation results include:- Status counts for rows
- Aggregate scores per criterion
- Latency and token usage metrics
- Row-level outputs and scores