Use any LangChain-compatible model as an evaluation judge for metric scoring
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:
Mode
How it works
Best for
Structured output
Binds the output schema to the model, constraining generation with response_format
Models that support structured outputs (GPT-4o, Gemini)
Regex extraction
Embeds JSON schema in the prompt, extracts from markdown code blocks
Any model, including open-source
Configuration
You configure the judge through the metric’s constructor parameters:
from langchain_openai import ChatOpenAIfrom gaussia.metrics.context import Contextmodel = ChatOpenAI(model="gpt-4o-mini", temperature=0)# Structured output mode (recommended for supported models)results = Context.run( MyRetriever, model=model, use_structured_output=True, strict=True,)# Regex extraction mode (works with any model)results = Context.run( MyRetriever, model=model, use_structured_output=False, bos_json_clause="```json", eos_json_clause="```",)
Parameters
Parameter
Default
Description
model
required
Any LangChain BaseChatModel instance
use_structured_output
False
Use schema-validated structured output
strict
True
Enforce strict schema validation
bos_json_clause
```json
Opening marker for JSON extraction (regex mode only)
eos_json_clause
```
Closing marker for JSON extraction (regex mode only)
Choosing how the schema is bound
Judging needs no tools, so the default strategy asks for the schema through response_format
and declares none. This matters on self-hosted OpenAI-compatible servers: vLLM rejects a
request that carries an empty tools array with HTTP 400.Metrics use that default. A custom metric built on Judge directly can inject the other
strategy, for a provider that exposes structured output only through tool calling:
Never leave the route to the provider’s own default. Bound without naming it, a model served
behind the HuggingFace router ignored the schema entirely and generated prose until it hit forty
thousand completion tokens — so the request failed on length, which reads as a model failure and
is a binding failure. Both strategies above worked on that same provider once named. This is why the
strategy is a parameter rather than a detail, and why every model-driven component of Roast Me takes
one too.
Both strategies request include_raw, so a bound runnable answers with a mapping carrying the message
itself beside the parsed value. parsed(answer, Schema) from the same module is the other half of that
contract: it returns the instance, or None when the provider answered off-format. None is a thing
that happens, and what it costs belongs to the caller — a generator can re-ask, a reading of one
passage can contribute nothing, and a gate that must return a number has neither option.
Compatible models
The Judge works with any LangChain-compatible chat model:
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.
{"docsConfig":{"theme":"mint","$schema":"https://mintlify.com/docs.json","name":"Gaussia","colors":{"primary":"#ab412d","light":"#ab412d","dark":"#c8a787"},"logo":{"light":"https://mintcdn.com/gaussia/CZVeB8hHuruPThWl/logo/light.svg?fit=max\u0026auto=format\u0026n=CZVeB8hHuruPThWl\u0026q=85\u0026s=e2b4ba81f7f9b67bc117ae242b72c75f","dark":"https://mintcdn.com/gaussia/CZVeB8hHuruPThWl/logo/dark.svg?fit=max\u0026auto=format\u0026n=CZVeB8hHuruPThWl\u0026q=85\u0026s=37c353b3251f1fbc27e228e835558b59"},"favicon":"https://mintcdn.com/gaussia/CZVeB8hHuruPThWl/favicon.svg?fit=max\u0026auto=format\u0026n=CZVeB8hHuruPThWl\u0026q=85\u0026s=b580e9b5e6c8b704305a088d6ed52353","background":{},"navbar":{"links":[{"href":"https://github.com/gaussia-labs/papers/discussions","label":"Community"}],"primary":{"type":"button","label":"GitHub","href":"https://github.com/gaussia-labs"}},"footer":{"socials":{"github":"https://github.com/gaussia-labs"}},"styling":{"latex":false},"navigation":{"global":{"anchors":[{"anchor":"GitHub","icon":"github","href":"https://github.com/gaussia-labs"},{"anchor":"Papers","icon":"book-open-cover","href":"https://github.com/gaussia-labs/papers"}]},"pages":[]}},"deployment":{"deploymentMetadataValue":{"subdomain":"gaussia","hasAudioNarration":false,"actualSubdomain":"gaussia","customDomains":["docs.gaussia.ai"],"gitSource":{"type":"github","owner":"gaussia-labs","repo":"docs","deployBranch":"main","contentDirectory":"","isPrivate":false,"mountPath":"","label":""},"entitlements":{},"buildId":"6aa0221f77a57591606296e3","clientVersion":"0.0.4271","searchFilterCounts":[{"language":"default","tag":"Python SDK","count":22},{"language":"default","tag":"Boltzmann SDK","count":17},{"language":"default","tag":"Core concepts","count":15},{"language":"default","tag":"Getting started","count":11},{"language":"default","tag":"Metrics","count":10},{"language":"default","tag":"TypeScript SDK","count":10},{"language":"default","tag":"Guides","count":8},{"language":"default","tag":"Advanced","count":4},{"language":"default","tag":"Overview","count":2},{"language":"default","tag":"Prompt optimization","count":2}]},"assistantConfig":{"enableAskAiButton":false,"enableStarterQuestions":false,"enableContextualStarterQuestions":false,"enableAskAiSearchBar":true},"basePath":"","hasChatPermissions":false,"hasWebMcpPermissions":false,"toggles":[{"name":"kill-isr","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"custom-rbac-roles","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"agent-mintlify-slack","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"agent-integrations-settings","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"rbac-expansion","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automations-pr-grouping","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"custom-prefix","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"analytics-v7","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"user-flows-analytics","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"no-publish-flow","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-onboarding","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"snapshot-serving-live","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"stripTemperatureMiddleware","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"support-platform-pylon-zendesk","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"snapshot-serving","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"instant-rollback","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"granular-notifications-server","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"granular-notifications","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automations-fable","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"fixed-ai-action-pricing","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"site-roles","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automation-resolve-merge-conflict","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"scoped-publishing","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"mintql","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"page-level-analytics","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"editor-version-history-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"billing-page-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"full-page-search","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workspace-projects","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"assistant-v5","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"fork-pr-previews","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"revalidation-jwt","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-sso-scim","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"hobby-abuse-scan","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"dashboard-inbox","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-signup","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"turbopuffer-dual-write","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-enabled","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"approve-review-flow","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"editor-metadata","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"sso-setup-deadline-banner","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"turbopuffer-serve","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"live-agents","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"starter-pricing","enabled":true,"variant":{"name":"control","enabled":true,"payload":{"type":"string","value":"control"},"feature_enabled":true},"impressionData":false},{"name":"llms-txt-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"wildcard-email-auth","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false}],"googleFontsInlined":false},"customCss":[]}
{"page":{"pagePath":"sdks/python/concepts/llm-judge","slug":"/sdks/python/concepts/llm-judge","pageMetadata":{"title":"LLM judge","description":"Use any LangChain-compatible model as an evaluation judge for metric scoring","href":"/sdks/python/concepts/llm-judge"},"description":{"compiledSource":"\"use strict\";\nconst {jsx: _jsx} = arguments[0];\nconst {useMDXComponents: _provideComponents} = arguments[0];\nfunction _createMdxContent(props) {\n const _components = {\n p: \"p\",\n ..._provideComponents(),\n ...props.components\n };\n return _jsx(_components.p, {\n children: \"Use any LangChain-compatible model as an evaluation judge for metric scoring\"\n });\n}\nfunction MDXContent(props = {}) {\n const {wrapper: MDXLayout} = {\n ..._provideComponents(),\n ...props.components\n };\n return MDXLayout ? _jsx(MDXLayout, {\n ...props,\n children: _jsx(_createMdxContent, {\n ...props\n })\n }) : _createMdxContent(props);\n}\nreturn {\n default: MDXContent\n};\n","frontmatter":{},"scope":{}},"pageType":"default","mdx":{"mdxSource":{"compiledSource":"\"use strict\";const{Fragment:_Fragment,jsx:_jsx,jsxs:_jsxs}=arguments[0];const{useMDXComponents:_provideComponents}=arguments[0];function _createMdxContent(props){const _components={code:`code`,em:`em`,p:`p`,pre:`pre`,span:`span`,strong:`strong`,tbody:`tbody`,td:`td`,th:`th`,thead:`thead`,tr:`tr`,..._provideComponents(),...props.components},{CodeBlock,Heading,Table,Tip,Warning}=_components;if(!CodeBlock)_missingMdxReference(`CodeBlock`,true);if(!Heading)_missingMdxReference(`Heading`,true);if(!Table)_missingMdxReference(`Table`,true);if(!Tip)_missingMdxReference(`Tip`,true);if(!Warning)_missingMdxReference(`Warning`,true);return _jsxs(_Fragment,{children:[_jsx(Heading,{level:`2`,id:`overview`,children:`Overview`}),`\n`,_jsxs(_components.p,{children:[`Several Gaussia metrics (Context, Conversational, BestOf, Agentic) use an `,_jsx(_components.strong,{children:`LLM-as-a-Judge`}),` pattern to evaluate AI responses. The `,_jsx(_components.code,{children:`Judge`}),` class handles prompt rendering, model invocation, and response parsing.`]}),`\n`,_jsx(Heading,{level:`2`,id:`how-it-works`,children:`How it works`}),`\n`,_jsxs(_components.p,{children:[`The `,_jsx(_components.code,{children:`Judge`}),` supports two evaluation modes:`]}),`\n`,_jsxs(Table,{children:[_jsx(_components.thead,{children:_jsxs(_components.tr,{children:[_jsx(_components.th,{children:`Mode`}),_jsx(_components.th,{children:`How it works`}),_jsx(_components.th,{children:`Best for`})]})}),_jsxs(_components.tbody,{children:[_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.strong,{children:`Structured output`})}),_jsxs(_components.td,{children:[`Binds the output schema to the model, constraining generation with `,_jsx(_components.code,{children:`response_format`})]}),_jsx(_components.td,{children:`Models that support structured outputs (GPT-4o, Gemini)`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.strong,{children:`Regex extraction`})}),_jsx(_components.td,{children:`Embeds JSON schema in the prompt, extracts from markdown code blocks`}),_jsx(_components.td,{children:`Any model, including open-source`})]})]})]}),`\n`,_jsx(Heading,{level:`2`,id:`configuration`,children:`Configuration`}),`\n`,_jsx(_components.p,{children:`You configure the judge through the metric’s constructor parameters:`}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`21`,language:`python`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`python`,children:_jsxs(_components.code,{language:`python`,numberOfLines:`21`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`from`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` langchain_openai `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`import`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` ChatOpenAI`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`from`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` gaussia.metrics.context `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`import`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` Context`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`model `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` ChatOpenAI(`}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:`model`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"gpt-4o-mini\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:`temperature`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:`0`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`)`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:`# Structured output mode (recommended for supported models)`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`results `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` Context.run(`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` MyRetriever,`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:` model`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`model,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:` use_structured_output`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:`True`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:` strict`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:`True`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`)`})}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:`# Regex extraction mode (works with any model)`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`results `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` Context.run(`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` MyRetriever,`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:` model`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`model,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:` use_structured_output`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:`False`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:` bos_json_clause`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:'\"```json\"'}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:` eos_json_clause`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:'\"```\"'}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`)`})}),`\n`]})})}),`\n`,_jsx(Heading,{level:`3`,id:`parameters`,children:`Parameters`}),`\n`,_jsxs(Table,{children:[_jsx(_components.thead,{children:_jsxs(_components.tr,{children:[_jsx(_components.th,{children:`Parameter`}),_jsx(_components.th,{children:`Default`}),_jsx(_components.th,{children:`Description`})]})}),_jsxs(_components.tbody,{children:[_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`model`})}),_jsx(_components.td,{children:_jsx(_components.em,{children:`required`})}),_jsxs(_components.td,{children:[`Any LangChain `,_jsx(_components.code,{children:`BaseChatModel`}),` instance`]})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`use_structured_output`})}),_jsx(_components.td,{children:_jsx(_components.code,{children:`False`})}),_jsx(_components.td,{children:`Use schema-validated structured output`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`strict`})}),_jsx(_components.td,{children:_jsx(_components.code,{children:`True`})}),_jsx(_components.td,{children:`Enforce strict schema validation`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`bos_json_clause`})}),_jsx(_components.td,{children:_jsx(_components.code,{children:\"```json\"})}),_jsx(_components.td,{children:`Opening marker for JSON extraction (regex mode only)`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`eos_json_clause`})}),_jsx(_components.td,{children:_jsx(_components.code,{children:\"```\"})}),_jsx(_components.td,{children:`Closing marker for JSON extraction (regex mode only)`})]})]})]}),`\n`,_jsx(Heading,{level:`3`,id:`choosing-how-the-schema-is-bound`,children:`Choosing how the schema is bound`}),`\n`,_jsxs(_components.p,{children:[`Judging needs no tools, so the default strategy asks for the schema through `,_jsx(_components.code,{children:`response_format`}),`\nand declares none. This matters on self-hosted OpenAI-compatible servers: vLLM rejects a\nrequest that carries an empty `,_jsx(_components.code,{children:`tools`}),` array with HTTP 400.`]}),`\n`,_jsxs(_components.p,{children:[`Metrics use that default. A custom metric built on `,_jsx(_components.code,{children:`Judge`}),` directly can inject the other\nstrategy, for a provider that exposes structured output only through tool calling:`]}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`4`,language:`python`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`python`,children:_jsxs(_components.code,{language:`python`,numberOfLines:`4`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`from`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` gaussia.llm.judge `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`import`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` Judge`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`from`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` gaussia.llm.structured `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`import`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` ToolCallingOutput`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`judge `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` Judge(`}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:`model`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`model, `}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:`use_structured_output`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:`True`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:`structured_output`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`ToolCallingOutput())`})]}),`\n`]})})}),`\n`,_jsx(Warning,{children:_jsxs(_components.p,{children:[_jsx(_components.strong,{children:`Never leave the route to the provider’s own default.`}),` Bound without naming it, a model served\nbehind the HuggingFace router ignored the schema entirely and generated prose until it hit forty\nthousand completion tokens — so the request failed on `,_jsx(_components.strong,{children:`length`}),`, which reads as a model failure and\nis a binding failure. Both strategies above worked on that same provider once named. This is why the\nstrategy is a parameter rather than a detail, and why every model-driven component of Roast Me takes\none too.`]})}),`\n`,_jsxs(_components.p,{children:[`Both strategies request `,_jsx(_components.code,{children:`include_raw`}),`, so a bound runnable answers with a mapping carrying the message\nitself beside the parsed value. `,_jsx(_components.code,{children:`parsed(answer, Schema)`}),` from the same module is the other half of that\ncontract: it returns the instance, or `,_jsx(_components.code,{children:`None`}),` when the provider answered off-format. `,_jsx(_components.code,{children:`None`}),` is a thing\nthat happens, and what it costs belongs to the caller — a generator can re-ask, a reading of one\npassage can contribute nothing, and a gate that must return a number has neither option.`]}),`\n`,_jsx(Heading,{level:`2`,id:`compatible-models`,children:`Compatible models`}),`\n`,_jsxs(_components.p,{children:[`The `,_jsx(_components.code,{children:`Judge`}),` works with any LangChain-compatible chat model:`]}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`15`,language:`python`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`python`,children:_jsxs(_components.code,{language:`python`,numberOfLines:`15`,children:[_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:`# OpenAI`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`from`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` langchain_openai `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`import`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` ChatOpenAI`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`model `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` ChatOpenAI(`}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:`model`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"gpt-4o-mini\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`)`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:`# Anthropic`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`from`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` langchain_anthropic `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`import`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` ChatAnthropic`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`model `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` ChatAnthropic(`}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:`model`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"claude-sonnet-4-20250514\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`)`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:`# Groq`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`from`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` langchain_groq `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`import`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` ChatGroq`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`model `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` ChatGroq(`}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:`model`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"llama-3.3-70b-versatile\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`)`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:`# Google`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`from`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` langchain_google_genai `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`import`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` ChatGoogleGenerativeAI`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`model `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` ChatGoogleGenerativeAI(`}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:`model`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"gemini-2.0-flash\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`)`})]}),`\n`]})})}),`\n`,_jsx(Heading,{level:`2`,id:`reasoning-extraction`,children:`Reasoning extraction`}),`\n`,_jsx(_components.p,{children:`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).`}),`\n`,_jsxs(_components.p,{children:[`The reasoning is returned as the first element of the tuple from `,_jsx(_components.code,{children:`judge.check()`}),` and is used internally for logging and debugging.`]}),`\n`,_jsx(Tip,{children:_jsxs(_components.p,{children:[`For best results with `,_jsx(_components.code,{children:`use_structured_output=True`}),`, use models that natively support structured outputs like GPT-4o or Gemini. For open-source models, `,_jsx(_components.code,{children:`use_structured_output=False`}),` with regex extraction is more reliable.`]})})]})}function MDXContent(props={}){const{wrapper:MDXLayout}={..._provideComponents(),...props.components};return MDXLayout?_jsx(MDXLayout,{...props,children:_jsx(_createMdxContent,{...props})}):_createMdxContent(props)}return{default:MDXContent};function _missingMdxReference(id,component){throw new Error(`Expected `+(component?`component`:`object`)+\" `\"+id+\"` to be defined: you likely forgot to import, pass, or provide it.\")}","frontmatter":{},"scope":{"config":{},"pageMetadata":{"title":"LLM judge","description":"Use any LangChain-compatible model as an evaluation judge for metric scoring","href":"/sdks/python/concepts/llm-judge"}}},"mdxSourceWithNoJs":null},"mdxExtracts":{"tableOfContents":[{"title":"Overview","slug":"overview","depth":2,"children":[]},{"title":"How it works","slug":"how-it-works","depth":2,"children":[]},{"title":"Configuration","slug":"configuration","depth":2,"children":[{"title":"Parameters","slug":"parameters","depth":3,"children":[]},{"title":"Choosing how the schema is bound","slug":"choosing-how-the-schema-is-bound","depth":3,"children":[]}]},{"title":"Compatible models","slug":"compatible-models","depth":2,"children":[]},{"title":"Reasoning extraction","slug":"reasoning-extraction","depth":2,"children":[]}],"codeExamples":{}},"jsLinks":[],"subdomain":"gaussia","siteName":"Gaussia","title":"LLM judge - Gaussia","navMaps":{"firstHrefInVersion":{},"firstHrefInLanguage":{}},"lastModified":"2026-08-21T18:15:56.852Z","originalFileLocation":"sdks/python/concepts/llm-judge.mdx"},"headHtml":"\u003cscript data-mint-head>(function(){var d=document.documentElement,p=null;if(!p){try{p=localStorage.getItem(\"isDarkMode\")}catch(e){}if(p==='true')p='dark';else if(p==='false')p='light';if(p!=='light'\u0026\u0026p!=='dark'\u0026\u0026p!=='system')p=\"system\"}var r=p==='system'?(matchMedia(\"(prefers-color-scheme: dark)\").matches?'dark':'light'):p;d.classList.remove(r==='dark'?'light':'dark');d.classList.add(r);d.setAttribute(\"data-theme-preference\",p)})();\u003c/script>\u003cmeta data-mint-head name=\"description\" content=\"Use any LangChain-compatible model as an evaluation judge for metric scoring\">\u003cmeta data-mint-head name=\"application-name\" content=\"Gaussia\">\u003cmeta data-mint-head name=\"generator\" content=\"Mintlify\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"192x192\" href=\"/mintlify-assets/_mintlify/favicons/gaussia/-WJyuiBgtvuMxfVY/_generated/favicon/android-chrome-192x192.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"apple-touch-icon\" type=\"image/png\" sizes=\"180x180\" href=\"/mintlify-assets/_mintlify/favicons/gaussia/-WJyuiBgtvuMxfVY/_generated/favicon/apple-touch-icon.png\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/mintlify-assets/_mintlify/favicons/gaussia/-WJyuiBgtvuMxfVY/_generated/favicon/favicon-16x16.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"32x32\" href=\"/mintlify-assets/_mintlify/favicons/gaussia/-WJyuiBgtvuMxfVY/_generated/favicon/favicon-32x32.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"shortcut icon\" type=\"image/x-icon\" href=\"/mintlify-assets/_mintlify/favicons/gaussia/-WJyuiBgtvuMxfVY/_generated/favicon/favicon.ico\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"192x192\" href=\"/mintlify-assets/_mintlify/favicons/gaussia/-WJyuiBgtvuMxfVY/_generated/favicon-dark/android-chrome-192x192.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/mintlify-assets/_mintlify/favicons/gaussia/-WJyuiBgtvuMxfVY/_generated/favicon-dark/favicon-16x16.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"32x32\" href=\"/mintlify-assets/_mintlify/favicons/gaussia/-WJyuiBgtvuMxfVY/_generated/favicon-dark/favicon-32x32.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"shortcut icon\" type=\"image/x-icon\" href=\"/mintlify-assets/_mintlify/favicons/gaussia/-WJyuiBgtvuMxfVY/_generated/favicon-dark/favicon.ico\" media=\"(prefers-color-scheme: dark)\">\u003cmeta data-mint-head property=\"og:title\" content=\"LLM judge - Gaussia\">\u003cmeta data-mint-head property=\"og:description\" content=\"Use any LangChain-compatible model as an evaluation judge for metric scoring\">\u003cmeta data-mint-head property=\"og:site_name\" content=\"Gaussia\">\u003cmeta data-mint-head property=\"og:url\" content=\"https://docs.gaussia.ai/sdks/python/concepts/llm-judge\">\u003cmeta data-mint-head property=\"og:type\" content=\"website\">\u003cmeta data-mint-head property=\"og:image\" content=\"https://gaussia.mintlify.site/_mintlify/api/og/v2?division=Core+concepts\u0026amp;title=LLM+judge\u0026amp;description=Use+any+LangChain-compatible+model+as+an+evaluation+judge+for+metric+scoring\u0026amp;theme=07d275a40277b2b7b3255262\u0026amp;signature=c62bac50c941b3564fbe72ded93317f7dbe3fae8df62843280ead1ff31bf284c\">\u003cmeta data-mint-head property=\"og:image:width\" content=\"1200\">\u003cmeta data-mint-head property=\"og:image:height\" content=\"630\">\u003cmeta data-mint-head name=\"twitter:card\" content=\"summary_large_image\">\u003cmeta data-mint-head name=\"twitter:title\" content=\"LLM judge - Gaussia\">\u003cmeta data-mint-head name=\"twitter:description\" content=\"Use any LangChain-compatible model as an evaluation judge for metric scoring\">\u003cmeta data-mint-head name=\"twitter:image\" content=\"https://gaussia.mintlify.site/_mintlify/api/og/v2?division=Core+concepts\u0026amp;title=LLM+judge\u0026amp;description=Use+any+LangChain-compatible+model+as+an+evaluation+judge+for+metric+scoring\u0026amp;theme=07d275a40277b2b7b3255262\u0026amp;signature=c62bac50c941b3564fbe72ded93317f7dbe3fae8df62843280ead1ff31bf284c\">\u003cmeta data-mint-head name=\"twitter:image:width\" content=\"1200\">\u003cmeta data-mint-head name=\"twitter:image:height\" content=\"630\">\u003cmeta data-mint-head name=\"msapplication-config\" content=\"/mintlify-assets/_mintlify/favicons/gaussia/-WJyuiBgtvuMxfVY/_generated/favicon/browserconfig.xml\">\u003cmeta data-mint-head name=\"apple-mobile-web-app-title\" content=\"Gaussia\">\u003cmeta data-mint-head name=\"msapplication-TileColor\" content=\"#ab412d\">\u003clink data-mint-head rel=\"canonical\" href=\"https://docs.gaussia.ai/sdks/python/concepts/llm-judge\">\u003clink data-mint-head rel=\"alternate\" type=\"application/xml\" href=\"/sitemap.xml\">\u003clink data-mint-head rel=\"alternate\" type=\"text/markdown\" href=\"/sdks/python/concepts/llm-judge.md\">\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@graph\":[{\"@type\":\"Organization\",\"@id\":\"https://docs.gaussia.ai/#organization\",\"name\":\"Gaussia\",\"url\":\"https://docs.gaussia.ai\",\"logo\":{\"@type\":\"ImageObject\",\"url\":\"https://mintcdn.com/gaussia/CZVeB8hHuruPThWl/logo/light.svg?fit=max\u0026auto=format\u0026n=CZVeB8hHuruPThWl\u0026q=85\u0026s=e2b4ba81f7f9b67bc117ae242b72c75f\"}},{\"@type\":\"WebSite\",\"@id\":\"https://docs.gaussia.ai#website\",\"name\":\"Gaussia\",\"url\":\"https://docs.gaussia.ai\",\"publisher\":{\"@id\":\"https://docs.gaussia.ai/#organization\"}},{\"@type\":\"WebPage\",\"@id\":\"https://docs.gaussia.ai/sdks/python/concepts/llm-judge#webpage\",\"url\":\"https://docs.gaussia.ai/sdks/python/concepts/llm-judge\",\"name\":\"LLM judge\",\"description\":\"Use any LangChain-compatible model as an evaluation judge for metric scoring\",\"dateModified\":\"2026-08-21T18:15:56.852Z\",\"isPartOf\":{\"@id\":\"https://docs.gaussia.ai#website\"},\"breadcrumb\":{\"@id\":\"https://docs.gaussia.ai/sdks/python/concepts/llm-judge#breadcrumb\"}},{\"@type\":\"BreadcrumbList\",\"@id\":\"https://docs.gaussia.ai/sdks/python/concepts/llm-judge#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Core concepts\",\"item\":\"https://docs.gaussia.ai/sdks/python/concepts/architecture\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"LLM judge\",\"item\":\"https://docs.gaussia.ai/sdks/python/concepts/llm-judge\"}]},{\"@type\":[\"Article\",\"TechArticle\"],\"@id\":\"https://docs.gaussia.ai/sdks/python/concepts/llm-judge#article\",\"headline\":\"LLM judge\",\"name\":\"LLM judge\",\"description\":\"Use any LangChain-compatible model as an evaluation judge for metric scoring\",\"url\":\"https://docs.gaussia.ai/sdks/python/concepts/llm-judge\",\"mainEntityOfPage\":{\"@id\":\"https://docs.gaussia.ai/sdks/python/concepts/llm-judge#webpage\"},\"dateModified\":\"2026-08-21T18:15:56.852Z\",\"publisher\":{\"@id\":\"https://docs.gaussia.ai/#organization\"},\"isPartOf\":{\"@id\":\"https://docs.gaussia.ai#website\"}}]}\u003c/script>\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@type\":\"WebSite\",\"name\":\"Gaussia\",\"publisher\":{\"@type\":\"Organization\",\"name\":\"Gaussia\"},\"provider\":{\"@type\":\"Organization\",\"name\":\"Mintlify\",\"url\":\"https://mintlify.com\"}}\u003c/script>","agentPointerHref":"/sdks/python/concepts/llm-judge.md","siteName":"Gaussia","nav":{"global":{"anchors":[{"anchor":"GitHub","icon":"github","href":"https://github.com/gaussia-labs"},{"anchor":"Papers","icon":"book-open-cover","href":"https://github.com/gaussia-labs/papers"}]},"tabs":[{"tab":"Overview","pages":[{"title":"Overview","href":""}]},{"tab":"Python SDK","groups":[{"group":"Getting started","pages":[{"title":"Introduction","href":"/sdks/python"},{"title":"Installation","href":"/sdks/python/installation"},{"title":"Quickstart","href":"/sdks/python/quickstart"}]},{"group":"Core concepts","pages":[{"title":"Architecture","href":"/sdks/python/concepts/architecture"},{"title":"Retriever","href":"/sdks/python/concepts/retriever"},{"title":"Datasets and batches","href":"/sdks/python/concepts/datasets"},{"title":"Statistical modes","description":"Choose between frequentist point estimates and Bayesian credible intervals for metric aggregation","href":"/sdks/python/concepts/statistical-modes"},{"title":"LLM judge","href":"/sdks/python/concepts/llm-judge"}]},{"group":"Metrics","pages":[{"title":"Metrics Overview","description":"Overview of all available metrics in Gaussia","href":"/sdks/python/metrics/overview"},{"title":"Context","href":"/sdks/python/metrics/context"},{"title":"Conversational","href":"/sdks/python/metrics/conversational"},{"title":"Toxicity","href":"/sdks/python/metrics/toxicity"},{"title":"Bias","href":"/sdks/python/metrics/bias"},{"title":"Humanity","href":"/sdks/python/metrics/humanity"},{"title":"BestOf","href":"/sdks/python/metrics/best-of"},{"title":"Agentic","href":"/sdks/python/metrics/agentic"},{"title":"Vision","href":"/sdks/python/metrics/vision"},{"title":"Regulatory","href":"/sdks/python/metrics/regulatory"}]},{"group":"Integrations","pages":[{"title":"Evalhub","href":"/sdks/python/integrations/evalhub"}]},{"group":"Advanced","pages":[{"title":"Generators","href":"/sdks/python/advanced/generators"},{"title":"Prompt optimizer","href":"/sdks/python/advanced/prompt-optimizer"},{"title":"Explainability","href":"/sdks/python/advanced/explainability"},{"title":"Roast Me","href":"/sdks/python/advanced/roastme"}]}]},{"tab":"TypeScript SDK","pages":[{"title":"TypeScript SDK","href":"/sdks/typescript"}]},{"tab":"Boltzmann SDK","pages":[{"title":"Boltzmann SDK","href":"/sdks/boltzmann"}]}]},"basePath":"","title":"LLM judge - Gaussia","deploymentId":"dpl_Em2U4NQQ2N2DE3HPbPUJVZLnAtvc","buildId":"dpl_Em2U4NQQ2N2DE3HPbPUJVZLnAtvc","dynamics":[],"chunks":[]}