Skip to content

braintrustdata/braintrust-sdk-dotnet

Repository files navigation

Braintrust C# Tracing & Eval SDK

CI NuGet

Overview

This library provides tools for evaluating and tracing AI applications in Braintrust. Use it to:

  • Evaluate your AI models with custom test cases and scoring functions
  • Trace LLM calls and monitor AI application performance with OpenTelemetry
  • Integrate seamlessly with OpenAI, Anthropic, and other LLM providers

This SDK is currently in BETA status and APIs may change.

Installation

The SDK is split into packages by LLM provider integration. Install the core package plus any provider integrations you need.

Core package

dotnet add package Braintrust.Sdk

OpenAI integration

dotnet add package Braintrust.Sdk.OpenAI

Anthropic integration

dotnet add package Braintrust.Sdk.Anthropic

Or add to your .csproj file

<ItemGroup>
  <PackageReference Include="Braintrust.Sdk" Version="version goes here" />
  <PackageReference Include="Braintrust.Sdk.OpenAI" Version="version goes here" />   <!-- optional -->
  <PackageReference Include="Braintrust.Sdk.Anthropic" Version="version goes here" /> <!-- optional -->
</ItemGroup>

Running Examples

Setup

Install the dotnet 8 framework

List All Examples

ls -l examples/
# >>> outputs
 EvalExample/
 OpenAIInstrumentation/
 SimpleOpenTelemetry/
 ... # rest of the examples

Run An Example

dotnet run --project examples/SimpleOpenTelemetry

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Packages