Setup
To use Baseten models, configure your Baseten API key in Braintrust.- Get a Baseten API key from the Baseten console.
- Add the Baseten API key as an organization or project AI provider.
- Optional: Set API base URL if your models are served from a custom Baseten deployment endpoint (for example, a dedicated deployment). If you leave this blank, Braintrust uses the default Baseten endpoint.
- Set the Baseten API key and your Braintrust API key as environment variables.
.env
API keys are stored as one-way cryptographic hashes, never in plaintext.
Use Baseten with Braintrust gateway
The Braintrust gateway allows you to access Baseten models through a unified interface. Use any supported provider’s SDK to call Baseten models. Install thebraintrust and openai packages.
Trace logs with Baseten
Trace your Baseten LLM calls for observability and monitoring. When using the Braintrust gateway, API calls are automatically logged to the specified project.Evaluate with Baseten
Evaluations distill the non-deterministic outputs of Baseten models into an effective feedback loop that enables you to ship more reliable, higher quality products. BraintrustEval is a simple function composed of a dataset of user inputs, a task, and a set of scorers. To learn more about evaluations, check out the Experiments guide.