Learn how to automatically evaluate your LLM calls using custom evaluators
Online evaluators provide a powerful way to automatically assess and score your LLM calls as they come. Once registered, evaluators run automatically whenever a span matches their registered path, immediately attaching evaluation scores based on how you define to score them.
The core concept:
Custom Evaluators: You define your own evaluator logic by writing Python functions that analyze the outputs of your LLM calls. These can range from simple checks to sophisticated analysis. It should always return number.
Span Path Registration: Each evaluator is registered to a specific span path - a unique identifier that corresponds to a particular LLM function or call location in your code.
Automatic Execution: Once registered, evaluators run automatically whenever a span matches their registered path. The evaluator score is immediately attached to the span.
There are two main approaches to generating evaluator scores in Laminar:
Create custom Python functions that run automatically on our platform. These evaluators:
Create scores programmatically using our SDK or REST API. This approach:
Both approaches result in the same evaluator scores being attached to your spans, visible in the Laminar dashboard for analysis and monitoring.