Create, version, and manage configurable settings for evaluations
Parameters let you create reusable configuration for your evaluations. Define parameters once in Braintrust, then load them across multiple evaluations. This approach enables:
Reusability: Share configurations across multiple evaluations
Centralized management: Update parameters in one place for all evaluations
Version control: Track parameter changes independently of evaluation code
Environment management: Use different parameter values across dev, staging, and production
Parameters require Braintrust TypeScript SDK v2.2.1 or later.
import * as braintrust from "braintrust";import { z } from "zod";const project = braintrust.projects.create({ name: "My Project",});export const evalConfig = project.parameters.create({ name: "Evaluation config", slug: "eval-config", description: "Configuration for model evaluation", schema: { model: z.string().default("gpt-5-mini").describe("Model to evaluate"), max_tokens: z.number().default(1000).describe("Maximum tokens to generate"), system_prompt: z.string().default("You are a helpful assistant.").describe("System prompt to use"), }, metadata: { version: "1.0" },});
Push to Braintrust:
Report incorrect code
Copy
Ask AI
npx braintrust push eval-config.ts
When you create parameters with default values, Braintrust automatically initializes them with those defaults. This means the first version of your parameter will already have the default values set, ready to use in evaluations or modify in the UI.
Define the structure and types of your parameters using Zod (TypeScript). You can combine these building blocks to create any structure your evaluation needs, whether simple flat configurations or complex nested objects. These type definitions ensure your parameters have the correct data types and constraints.Building blocks for creating parameter schemas:
Report incorrect code
Copy
Ask AI
import { z } from "zod";// String with descriptionz.string().describe("Model name")// Number with constraintsz.number().min(0).max(1).describe("Temperature")// Booleanz.boolean().describe("Enable streaming")// Enumz.enum(["gpt-5-mini", "gpt-5-nano", "claude-sonnet-4-5"]).describe("Model")// Arrayz.array(z.string()).describe("Test cases")// Objectz.object({ model: z.string(), temperature: z.number(),}).describe("Model config")// Optional with defaultz.string().default("gpt-5-mini").describe("Model name")
Load parameters in your Eval() function using loadParameters(). Parameters are accessed in your task function via the parameters argument. For TypeScript type inference in your Eval’s task, pass your parameter type as a generic to loadParameters().
For remote evals, parameters automatically become editable controls in the playground UI, letting you modify values without changing code.
When using loadParameters() in remote evals, the playground displays a version selector, letting you experiment with different parameter versions without editing code.