Braintrust

Tools & Infrastructure 💻 TypeScript ⚖️ Apache-2.0 🟢 Actively maintained
27 stars

Braintrust is a platform for evaluating and shipping AI products. This repository contains the JavaScript/TypeScript SDKs and integrations for logging, tracing, evals, and CLI, enabling developers to build and evaluate AI applications.

✨ Key features

  • Core SDK for logging, tracing, evals, and CLI
  • Browser integration with AsyncLocalStorage polyfill
  • OpenTelemetry span processor and compatibility helpers
  • Temporal client/worker plugin and workflow interceptors
  • Autoeval scorers for automated evaluation
  • CLI tool 'bt' for running evals

🎯 Use cases

  • Run automated evals on AI tasks with custom scorers
  • Log and trace AI model interactions for debugging
  • Integrate Braintrust tracing into LangChain or OpenAI Agents
  • Use OpenTelemetry to export traces to Braintrust
  • Trace workflows in Temporal applications

📦 Installation

🧰 Requirements: Requires Node.js and npm; an API key (BRAINTRUST_API_KEY) is needed for running evals.

npm install braintrust autoevals

🚀 Usage

Create tutorial.eval.ts:

import { Eval } from "braintrust";
import { LevenshteinScorer } from "autoevals";

Eval("Say Hi Bot", {
  data: () => [
    { input: "Foo", expected: "Hi Foo" },
    { input: "Bar", expected: "Hello Bar" },
  ],
  task: (input) => "Hi " + input,
  scores: [LevenshteinScorer],
});

Run it:

BRAINTRUST_API_KEY=<YOUR_API_KEY> npx braintrust eval tutorial.eval.ts

⚠️ Good to know

Some integration packages are deprecated; the repository was renamed from braintrust-sdk to braintrust-sdk-javascript after Python SDK split.

❓ FAQ

How do I install the Braintrust SDK?

Run npm install braintrust autoevals to install the main SDK and autoeval scorers.

What is the bt CLI?

The bt CLI is installed alongside braintrust and can be used with npx bt or pnpm exec bt. It is used for running evals and other tasks.

Are the LangChain and OpenAI Agents integrations deprecated?

Yes, @braintrust/langchain-js and @braintrust/openai-agents are deprecated; use the integrations in the main braintrust package instead.

What is the license for this repository?

The repository is licensed under Apache-2.0.

📊 Repository

Stars★ 27
Forks🍴 12
Open issues🐛 86
Last commit🕒 Sep 4, 2026
Created📅 Jul 2023
Language💻 TypeScript
License⚖️ Apache-2.0

🤖 Overview, features, install steps and FAQ were generated from the project's README on Sep 4, 2026. Always check the original source before running commands.