Skip to main content
Integrate evaluations into your CI/CD pipeline to catch regressions before they reach production. Run evals on every pull request, gate merges on the results, and report scores back to your team automatically.

GitHub Actions

Use the braintrustdata/eval-action to run evaluations on every pull request:
Set runtime to node, python, or go to match your project. The action automatically posts a comment with results to the pull request, which requires the pull-requests: write permission shown above.

Other CI systems

For other CI systems, use bt eval directly:
Create an API key under Settings > API keys and set it as BRAINTRUST_API_KEY in your CI environment. Use --no-input to suppress prompts and --json for machine-readable output. Use --first N or --sample N to run a non-final smoke test on pull requests and reserve the full run for merges:

Customize pass/fail with reporters

When you run an experiment, Braintrust logs results to your terminal, and bt eval returns a non-zero exit code if any eval throws an exception. Customize this behavior for CI/CD pipelines to precisely define what constitutes a failure or to report results to different systems. Define custom reporters using Reporter(). A reporter has two functions:
Any Reporter included among your evaluated files will be automatically picked up by the bt eval CLI command.
  • If no reporters are defined, the default reporter logs results to the console.
  • If you define one reporter, it’s used for all Eval blocks.
  • If you define multiple Reporters, specify the reporter name as an optional third argument to the eval function.

Next steps