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 matchesexpected_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.
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 undermax_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.
MaxLatency
Alias forLatency. 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.
BLEU
BLEU-n score between output andexpected_output. Pure Python, no dependencies.
When to use: Translation evaluation, constrained generation where phrasing matters, or any task with a canonical reference output.
ROUGE
ROUGE-L F1 score (longest common subsequence) between output andexpected_output.
When to use: Summarization tasks where recall of key content matters more than exact wording.

