Skip to main content

Reference-based metrics

These compare the model’s output against a known-good ideal answer in the dataset.
Measures word overlap between the response and the reference. Best for summarisation and open-ended generation tasks where phrasing can vary.
CLI: --metric rouge
N-gram precision with brevity penalty. More common in machine translation evals.
CLI: --metric bleu
Binary score — 1.0 if the response matches the ideal exactly, 0.0 otherwise. Useful for classification, short answers, and code generation with deterministic output.
CLI: --metric exact

LLM-as-judge

Uses a separate model to evaluate response quality on configurable criteria. Works with or without a reference answer.
The judge scores on a 1–5 scale (normalized to 0.0–1.0) and returns its reasoning alongside the score.

Custom criteria

Custom prompt template

For full control over the judge prompt, pass a .md file with these placeholders: {criteria}, {conversation}, {response}, {ideal_section}.
examples/judge_prompt.md in the repo is a copy of the default template to start from.

CLI

Custom metrics

Pass any Python function that takes (response, ideal=None, messages=None, **kwargs) and returns a float or a dict with a "score" key.
Return a dict to include reasoning:

CLI

Point at a Python file and name the function:
See examples/custom_metrics.py for three ready-to-use examples.

Combining metrics

All metrics run on every sample. Results are reported per-metric in separate comparison tables.