Evaluations allow you to automatically assess the quality and characteristics of your AI outputs. By integrating evaluators into your workflows, you can monitor for issues, gather metrics, and ensure your AI-generated content meets your standards.
Overview
Basalt’s evaluation system works by attaching evaluators to your traces and generations. These evaluators run automatically when generations complete, analyzing the input and output to produce objective metrics about the content.Evaluations help you answer questions like: “Is this content factually accurate?”, “Does it contain harmful content?”, “Is it relevant to the original query?”, or any other quality metrics important to your application.
Creating Evaluators
To use evaluations in Basalt, you’ll need to create your own evaluators through the Basalt application interface. These evaluators can be designed to measure specific aspects of your AI-generated content that are important to your use case.Evaluators are created and managed through the Basalt app. Once created, they can be referenced in your code by their slug.
Adding Evaluators to Traces
You can add evaluators at the trace level to have them automatically apply to all generations within that trace:Adding Evaluators to Generations
For more targeted evaluation, you can add evaluators directly to specific generations:Adding Evaluators to Logs
For more targeted evaluation, you can add evaluators directly to specific log:Evaluation Configuration
TheevaluationConfig parameter gives you control over how evaluations are applied:
Sample Rate
ThesampleRate parameter controls how often evaluations are run:
Sample rates allow you to balance evaluation coverage with cost efficiency. For example:
Sampling is applied at the trace level. When a trace is selected for evaluation, all evaluators assigned to that trace and its generations will run. This ensures you get complete evaluation data for the sampled traces rather than patchy data across all traces.
Example: Multi-Faceted Evaluation
Here’s an example of using multiple evaluators to comprehensively assess content:sampleRate setting