Skip to main content

Overview

Several Gaussia metrics (Context, Conversational, BestOf, Agentic) use an LLM-as-a-Judge pattern to evaluate AI responses. The Judge class handles prompt rendering, model invocation, and response parsing.

How it works

The Judge supports two evaluation modes:

Configuration

You configure the judge through the metric’s constructor parameters:

Parameters

Compatible models

The Judge works with any LangChain-compatible chat model:

Reasoning extraction

When available, the Judge automatically extracts reasoning content from the model’s response. This is supported by models that provide chain-of-thought reasoning (e.g., OpenAI’s reasoning models, Anthropic’s extended thinking). The reasoning is returned as the first element of the tuple from judge.check() and is used internally for logging and debugging.
For best results with use_structured_output=True, use models that natively support structured outputs like GPT-4o or Gemini. For open-source models, use_structured_output=False with regex extraction is more reliable.