braintrust
SDK for integrating Braintrust
What it is and what it does
Braintrust is an SDK that integrates AI applications with a hosted evaluation and tracing platform. It lets you define evaluation tasks with input data, a task function, and scoring functions, then run those evaluations against the Braintrust backend to log results, trace execution, and compare model outputs against expected behavior. The core workflow involves wrapping your AI task in an Eval object, defining how to score correctness, and running the evaluation via CLI or programmatically.
The package depends on 10 runtime libraries including requests for HTTP communication, jsonschema for validation, tqdm for progress display, and sseclient-py for streaming responses. It supports optional integrations for OpenAI agents, OpenTelemetry, and Temporal workflows via extras. The SDK requires Python 3.10 and an API key to authenticate with the Braintrust service.
Use it for:
- Run automated evaluations of LLM outputs against expected results and custom scoring functions.
- Trace execution paths and log intermediate steps of AI applications for debugging and analysis.
- Compare multiple model versions or prompts by running the same evaluation suite against each.
- Monitor AI application behavior in production by instrumenting with Braintrust logging.
- Integrate evaluation workflows into CI/CD pipelines using the CLI or programmatic API.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Braintrust is a Python SDK for logging, tracing, and evaluating AI applications, providing tools to instrument and assess model behavior against defined metrics.
Yes, if you are building or evaluating AI applications and want structured logging and evaluation infrastructure. The package is actively maintained, has low install friction, uses a permissive license, and carries no known vulnerabilities. The main constraint is the requirement for Python 3.10+ and a Braintrust API key; if you don't need hosted evaluation or tracing, a lighter alternative may suffice.
Install
braintrust on PyPI
pip
pip install braintrustuv
uv add braintrustpoetry
poetry add braintrustInstalling braintrust
Before you install
Low friction install with a pure-wheel distribution. Active maintenance with a release 3 days old and commits current as of 2026-08-14. Requires Python 3.10 or later.
License in practice
MIT license is permissive; you can use, modify, and distribute this package with minimal restrictions, provided you include the license notice.
Quickstart
pip install braintrust
from braintrust import Eval
def is_equal(expected, output):
return expected == output
Eval(
"Say Hi Bot",
data=lambda: [{"input": "Foo", "expected": "Hi Foo"}],
task=lambda input: "Hi " + input,
scores=[is_equal],
)
Requires Python 3.10 or later. Requires BRAINTRUST_API_KEY environment variable to connect to the Braintrust service.
Verify before relying
- Whether the 10 runtime dependencies (requests, chevron, tqdm, etc.) introduce any transitive vulnerabilities or breaking changes.
- Performance characteristics and scalability limits for large-scale evaluation runs.
- Whether optional extras (cli, openai-agents, otel, temporal) are stable or experimental.
Package facts
| License | MIT (permissive) |
| Python support | supports the current Python release (>=3.10.0) |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | 10 — requests, chevron, tqdm, exceptiongroup, jsonschema, packaging, sseclient-py, python-slugify, typing_extensions, wrapt |
| Maintenance | actively maintained — 3 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 7,783,477/month — #1,695 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: braintrust-0.33.0-py3-none-any.whl
Tags
More Artificial Intelligence packages
LiteLLM provides a unified Python interface to…
permissive · top 100 on PyPI
huggingface-hubClient library and CLI tool for downloading,…
permissive · top 100 on PyPI
langchainLangChain provides a framework for building…
permissive · top 1,000 on PyPI
hf-xethf-xet provides chunk-based deduplication and…
permissive · top 1,000 on PyPI
tokenizersTokenizers converts raw text into token…
permissive · top 1,000 on PyPI
transformersTransformers provides a unified framework for…
permissive · top 1,000 on PyPI
braintrust-apiProvides a Python client library for the…
permissive · top 15,000 on PyPI
braintrust-coreProvides shared core dependencies for packages…
unclear · top 5,000 on PyPI
braintrust-langchainProvides a LangChain callback handler to log…
permissive · top 5,000 on PyPI
anima-pythonanima-python provides a command-line interface…
unclear · top 15,000 on PyPI
mlflow-tracingInstrument GenAI applications with distributed…
permissive · top 1,000 on PyPI
arizeArize is a Python client library for…
permissive · top 5,000 on PyPI
openinference-instrumentation-openai-agentsAuto-instruments OpenAI Agents SDK to emit…
permissive · top 5,000 on PyPI
langfuseLangfuse is a Python SDK for observability,…
permissive · top 1,000 on PyPI
opikOpik is an open-source LLM observability and…
permissive · top 5,000 on PyPI
mlflowMLflow is an open-source platform for managing…
permissive · top 1,000 on PyPI