LLM-as-a-judge requires that your application already sends traces to OpenLIT. If you haven’t set up tracing yet, see the tracing guide first.
How it works
When a trace arrives in OpenLIT, the evaluation engine extracts the LLM prompt and response, then sends them to a judge LLM with a structured scoring prompt. The judge returns a JSON object containing a numeric score (0–1), a classification, an explanation, and a pass/fail verdict. OpenLIT stores this result alongside the original trace so you can view it in the trace detail panel and query it in dashboards. The full evaluation loop is:- Your application sends a trace to OpenLIT (via the SDK or OpenTelemetry)
- OpenLIT samples the trace according to your configured frequency
- The judge LLM scores the response across the enabled evaluation criteria
- Results are stored and surface in the trace detail view
Supported evaluation criteria
LLM-as-a-judge can evaluate responses across three categories. Each category is broken into specific classification types that the judge LLM uses when reporting results.- Hallucination
- Bias
- Toxicity
Detects when an LLM response contradicts or diverges from the provided context.
Configure LLM-as-a-judge
1
Open the Evaluations page
In the OpenLIT UI, navigate to Evaluations in the left sidebar. This page lists all configured evaluation rules and shows recent evaluation results.
2
Create a new evaluation rule
Click Create rule. Configure the following settings:
- Name — a descriptive label for this evaluation rule
- Judge model — the LLM provider and model to use as the judge (e.g.,
openai / gpt-4o-mini) - API key — the API key for the judge LLM provider
- Evaluation criteria — select one or more of: Hallucination, Bias, Toxicity, or All
- Threshold score — the cutoff score (0–1) above which a response is marked as failing. Defaults to
0.5 - Sampling rate — the percentage of traces to evaluate. Lower rates reduce costs on high-volume applications
3
Enable the rule
Toggle the rule to Active. OpenLIT will begin evaluating incoming traces according to the configured sampling rate.
View evaluation results
Evaluation results appear in two places in the OpenLIT UI: Trace detail panel — open any trace and scroll to the Evaluations section to see the score, verdict, classification, and explanation for each evaluation that ran against that trace. Evaluations dashboard — the main Evaluations page shows aggregate evaluation results across all traces, including score distributions, verdict breakdowns, and trends over time. You can filter by evaluation type, time range, and model.Evaluation result fields
Every evaluation result contains the following fields:Programmatic evaluations
Run evaluators directly in your Python code for CI/CD quality gates
Tracing
Set up automatic LLM tracing as a prerequisite for LLM-as-a-judge
