Skip to main content
Evaluators are automated tools that assess model outputs within Experiments, Deployments, and Agents. They verify outputs against reference data, enforce compliance criteria, and power Guardrails that block non-compliant generations before they reach users. Two evaluator types are available:

LLM Evaluator

Use a model to judge outputs against any criteria you define in a prompt.

Python Evaluator

Write custom Python code for full flexibility. Use for statistical scoring, regex checks, length validation, or any custom evaluation logic.
HTTP and JSON evaluators are deprecated. Existing HTTP and JSON evaluators continue to work, but cannot be duplicated. Use Python evaluators instead: the requests package is now available for HTTP calls, and pydantic is available for JSON schema validation.

Use Cases

Score model outputs on dimensions like tone, accuracy, or relevance without manual review. Use LLM-as-a-Judge evaluators with custom rubrics, or import pre-built scoring functions from the Hub.
Verify that outputs meet specific format, content, or structural requirements. Use Python evaluators for custom logic such as regex checks, length validation, or structural assertions.
Attach evaluators as guardrails to block generations that fail a pass condition. Input guardrails run before the model; output guardrails run after. A failed guardrail returns HTTP 422 to the caller.
Run evaluators across a full dataset in an Experiment to track quality over time. Compare evaluator scores across runs and prompt variants to catch regressions before deploying changes.

Pre-built Evaluators

Before building one from scratch, browse the Hub for ready-to-use evaluators. Add any of them to a Project with the Add to project button, then use them in Experiments, Deployments, and Agents. The Hub groups its evaluators into three categories:
  • Function Evaluators: deterministic checks such as Contains, Valid JSON, Length Between, and BLEU Score.
  • LLM Evaluators: model-judged checks such as Tone of Voice, Grammar, PII, and Sentiment Classification.
  • RAGAS Evaluators: retrieval-augmented generation metrics such as Faithfulness, Context Precision, and Response Relevancy.

LLM Evaluator

LLM Evaluators use a model to judge outputs against any criteria you define in a prompt.
In a Project or folder, click the button and select LLM Evaluator. Select the model to use for evaluation. It must be enabled in the AI Gateway.
LLM Evaluator settings panel with prompt area, model dropdown set to DeepSeek V3.1, output type tabs, guardrail pass condition, and a playground panel with Editor and Dataset tabs.

The LLM Evaluator settings panel showing the prompt editor, model selector, output types, guardrail configuration, and playground.

Configure Prompt

Your prompt has access to the following string variables:
  • {{log.input}}: the last message sent to the model
  • {{log.output}}: the output response generated by the evaluated model
  • {{log.messages}}: all messages sent to the model, excluding the last message
  • {{log.retrievals}}: Knowledge Base retrievals
  • {{log.reference}}: the reference used to compare output

Model Parameters

The Model field selects which model acts as judge. Any model enabled in the AI Gateway is available. The model choice affects evaluation quality, cost, and latency.

Output and Guardrail Configuration

Select the output type that matches the evaluation criteria. The Guardrail configuration panel is visible directly in the evaluator settings. Set the pass condition for each type:
The model returns a True or False response. Use for binary pass/fail checks.Guardrail: Select True or False. The guardrail passes when the model returns the selected value.
Once configured, the evaluator is available as a guardrail in any Deployment or Agent without any additional toggle.

Examples

Testing

Fill the payload manually. Enter values for messages, input, output, retrievals, and reference. All prompt variables resolve against what you enter.
Studio Playground panel for configuring the LLM payload sent to an LLM evaluator.

Configure the LLM payload that will be sent to the evaluator.

Click Run to execute the evaluator. The result appears in the Response field.
Response field showing the result of an LLM evaluator test run.

An LLM Evaluator test response.

Once created, this evaluator is available as a guardrail in Deployments and Agents. See Evaluators and Guardrails in Deployments and Evaluators and Guardrails in Agents to learn more.

Python Evaluator

Python Evaluators let you write custom Python code for maximum flexibility: from simple validations (regex, length checks) to complex analyses (statistical scoring, custom algorithms).
Python code is limited to 1 MB (1,048,576 bytes) per evaluator: roughly 1 million characters, or about 20,000 lines of typical Python. Larger code returns a Code exceeds maximum size error and does not run.
In a Project or folder, click the button and select Python Evaluator. You are taken to the code editor. Your evaluation function has access to the following fields from the evaluated model’s log:
  • log["input"] <str>: the last message sent to generate the output
  • log["output"] <str>: the generated response from the model
  • log["reference"] <str>: the reference used to compare the output
  • log["messages"] list<str>: all previous messages sent to the model
  • log["retrievals"] list<str>: all Knowledge Base retrievals
The evaluator can return two response types:
  • Number: return a numeric score
  • Boolean: return a true/false value
Example: compare output size with the reference:
Python
You can define multiple methods within the code editor. The last method is the entry-point for the Evaluator when run.

Environment and Libraries

The Python Evaluator runs in Python 3.12 with the following preloaded libraries:

Guardrail Configuration

Within a Deployment or Agent, use the Python Evaluator as a Guardrail to block generations that don’t meet the custom evaluation logic.Use the Pass condition to define when the guardrail passes:
  • Boolean evaluators: select True or False. The guardrail passes when your function returns the selected value.
  • Number evaluators: enter a score threshold. The guardrail passes when your function’s return value is greater than or equal to the threshold.
Any evaluator created in Orq.ai, whether LLM or Python, can be attached as a guardrail in a Deployment or Agent. Only the Pass condition needs to be set.

Examples

Use the requests package to send the output to an external endpoint and confirm it comes back unchanged. Return True only when the call succeeds and the echoed text matches the output.
Python
Use pydantic to validate that the output is JSON matching the expected damage report schema, including a confidence score between 0 and 1. Return True when it parses and validates, False otherwise.
Python

Testing

Fill the payload manually in the Editor. Enter values for input, output, reference, messages, and retrievals. All log fields resolve against what you enter.
Studio Playground panel for configuring the payload sent to a Python evaluator.

Configure the payload that will be sent to the Python evaluator.

Click Run to execute the evaluator. The result appears in the Response field.
Response field showing the result of a Python evaluator test run.

A Python test response.

Versions

When you are done editing, click Publish to save your changes. You will be prompted to write a commit message and choose a version bump:
Evaluator publish

Publish a new version of your Evaluator.

  • Patch (e.g. v1.0.0 to v1.0.1): small fixes, no behaviour change
  • Minor (e.g. v1.0.0 to v1.1.0): new functionality, backwards compatible
  • Major (e.g. v1.0.0 to v2.0.0): breaking change or significant rework
The Versions tab shows the full history with author and publish timestamp for each version.
Evaluator versions

Evaluator versions.

Each published version has three action buttons:
Reference a specific version by appending @ and the version number: my-evaluator@1.0.1. Reference an environment tag directly: my-evaluator@production. Without a suffix, the latest published version is used.

Restoring a Version

In Compare (see above), click Restore next to an older version to load it into the current working draft. Restore does not publish automatically: the evaluator is loaded into the draft as unpublished changes on the Settings tab, and Publish still needs to be clicked for it to become a real version. Earlier versions are never deleted, so restoring is always reversible.
If there are unpublished changes already, a confirmation dialog asks for confirmation before overwriting them.

List Evaluators

Install the SDK before using the Node.js or Python examples below:
Use the List Evaluators API:

Invoke an Evaluator

Fetch the evaluator ID from the List Evaluators API, then invoke it. Use the View Code button on your evaluator page in the AI Studio to get a pre-filled snippet.
Invoke an Evaluator dialog in AI Studio with Node, Python, and cURL tabs. The Python tab shows an orq.evals.invoke call with id, query, output, reference, messages, and retrievals arguments.

The Invoke an Evaluator dialog provides ready-to-copy Node, Python, and cURL snippets.

Guardrail Error Response

When a guardrail evaluation fails, Orq.ai returns an HTTP 422 Unprocessable Entity. The response body lists every guardrail that did not pass.
When the evaluator fails to execute: If the evaluator itself fails to run (for example, a network error or timeout), the guardrail is silently skipped and the generation proceeds. Monitor skipped guardrail executions through Traces.When an LLM guardrail’s underlying model fails: If the model powering an LLM guardrail is unavailable, Orq.ai fails the entire request for safety. Since the guardrail could not run, there is no way to know whether it would have blocked the generation.

Evaluatorq

Evaluatorq is a dedicated SDK for running evaluations programmatically. It supports parallel job execution, flexible data sources (inline, CSV, Orq datasets), and syncs results to the Orq.ai AI Studio.
Install:
Usage example:
See the Python Evaluatorq and TypeScript Evaluatorq repositories for more.

Cookbook: Running evaluations in parallel with Evaluatorq

Step-by-step walkthrough comparing agent variants with parallel evaluators, including DeepEval and RAGAS integration.

Run Agent Simulation with Evaluatorq

Test agents through realistic multi-turn conversations using AI-generated personas, scenarios, and a judge.