Braintrust Python SDKs

August 12, 2026 ยท View on GitHub

Braintrust

Braintrust Python SDKs

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 braintrust SDK package in ./py
  • Built-in integrations under py/src/braintrust/integrations and related compatibility packages under ./integrations
  • Self-contained uv-project examples for every integration in ./examples
  • Tests and local development tooling for Python SDK development

Quickstart

Install the main SDK and scorer package:

# uv
uv add braintrust autoevals
# pip
pip install braintrust autoevals

Create 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

Packages

PackagePurposePyPIDocs
braintrustCore Python SDK for logging, tracing, evals, CLI workflows, and built-in integrations.PyPI - braintrustpy/README.md

Integrations included in braintrust

IntegrationAuto-instrumentedMin version
OpenAIYesopenai>=1.71.0
AnthropicYesanthropic>=0.48.0
CohereYescohere>=5.0.0
MistralYesmistralai>=1.12.4
LiteLLMYeslitellm>=1.74.0
OpenRouterYesopenrouter>=0.6.0
Vercel AI SDK for PythonYesai>=0.4.0
Google GenAIYesgoogle-genai>=1.30.0
Bedrock RuntimeYesboto3>=1.34.116
HuggingFace HubYeshuggingface-hub>=0.32.0
Hugging Face TransformersYestransformers>=4.42.0
Google ADKYesgoogle-adk>=1.14.1
Pydantic AIYespydantic_ai>=1.10.0
LangChainYeslangchain-core>=0.3.28
LlamaIndexYesllama-index-core>=0.13.0
InstructorYesinstructor>=1.11.0
DSPyYesdspy>=2.6.0
OpenAI AgentsYesopenai-agents>=0.0.19
Claude Agent SDKYesclaude_agent_sdk>=0.1.10
Cursor SDKYescursor-sdk>=1.0.25
AutoGenYesautogen-agentchat>=0.7.0
CrewAIYescrewai>=1.13.0
StrandsYesstrands-agents>=1.20.0
AgnoYesagno>=2.1.0
AgentScopeYesagentscope>=1.0.0
LiveKit AgentsYeslivekit-agents>=1.3.1
PipecatYespipecat-ai>=1.3.0
TemporalYestemporalio>=1.19.0
HarborNo (Harbor plugin)harbor>=0.16.0
pytest pluginNopytest>=8

Documentation

License

Apache-2.0