Braintrust is a platform for evaluating and shipping AI products. Learn more at braintrust.dev and in the docs.
This repository contains Braintrust's Python SDKs and integrations, including:
- The main
braintrustSDK package in./py - Built-in integrations under
py/src/braintrust/integrationsand related compatibility packages under./integrations - Examples, tests, and local development tooling for Python SDK development
Install the main SDK and scorer package:
# uv
uv add braintrust autoevals
# pip
pip install braintrust autoevalsCreate tutorial_eval.py:
from autoevals import LevenshteinScorer
from braintrust import Eval
Eval(
"Say Hi Bot",
data=lambda: [
{"input": "Foo", "expected": "Hi Foo"},
{"input": "Bar", "expected": "Hello Bar"},
],
task=lambda input: "Hi " + input,
scores=[LevenshteinScorer],
)Run it:
BRAINTRUST_API_KEY=<YOUR_API_KEY> braintrust eval tutorial_eval.py| Package | Purpose | PyPI | Docs |
|---|---|---|---|
braintrust |
Core Python SDK for logging, tracing, evals, CLI workflows, and built-in integrations. | py/README.md |
- Python SDK docs: https://www.braintrust.dev/docs/reference/sdks/python
- Release notes: https://www.braintrust.dev/docs/reference/release-notes
Apache-2.0
