Skip to main content
Deterministic evaluators run in milliseconds with no API calls. Use them as a first pass — if an output fails a string check, there’s no need to send it to a judge.

NotEmpty

Passes if the output is non-empty after stripping whitespace. When to use: As the first guard in any eval suite — there’s no point running other evaluators on an empty string.

ExactMatch

Passes if the output exactly matches expected_output (stripped). Case-insensitive by default. When to use: Classification outputs, yes/no questions, or any task where the valid answer is one of a small fixed set.
Requires expected_output on the EvalCase.

Contains

Passes if the output contains all required substrings. Score is the fraction found. When to use: When the output must include certain keywords, section headers, or phrases — but you don’t care about exact wording.

RegexMatch

Passes if the output matches a regex pattern anywhere in the text. When to use: Structured format checks — phone numbers, dates, citation patterns, JSON keys, code blocks.

JSONSchemaEval

Passes if the output is valid JSON that conforms to a JSON Schema. When to use: Structured output tasks where the model must return well-typed JSON (e.g. API response generation, extraction pipelines).

WordCount

Passes if the word count is within [min_words, max_words]. When to use: Enforcing response length — summaries that must be concise, reports that must have a minimum length.

Latency

Passes if response latency is under max_ms milliseconds. Requires latency_ms to be passed to evaluate() — the suite handles this automatically. When to use: SLA enforcement in production — catching regressions where a model or pipeline exceeds your latency budget.
Score degrades linearly above the limit rather than hard-failing.

MaxLatency

Alias for Latency. Passes if response latency is under max_ms milliseconds. When to use: Use whichever name reads better in your suite. MaxLatency emphasizes the upper bound; Latency reads more naturally inline.
Score degrades linearly above the limit rather than hard-failing.

BLEU

BLEU-n score between output and expected_output. Pure Python, no dependencies. When to use: Translation evaluation, constrained generation where phrasing matters, or any task with a canonical reference output.
Score of 1.0 = perfect match. Includes brevity penalty.

ROUGE

ROUGE-L F1 score (longest common subsequence) between output and expected_output. When to use: Summarization tasks where recall of key content matters more than exact wording.
Score of 1.0 = perfect recall and precision on LCS.

StartsWith

Passes if output starts with the given prefix. Case-insensitive by default. When to use: Enforcing response format conventions — code blocks that must open with a fence, structured outputs that must begin with a specific token.

Combining evaluators

Evaluators are independent — all run and each contributes its own score and pass/fail.