EvalGate
Local-first regression testing and release decisions for AI applications.
You changed a prompt, model, tool or retrieval step. Your eval pipeline produced scores for the old version and the new one. EvalGate answers three questions:
- What changed?
- What got worse?
- Is this version acceptable to release?
It compares a baseline run against a candidate run case by case and applies your release policy. It returns an explainable PASS / FAIL / INVALID, with exit codes 0 / 1 / 2 for CI. It runs fully offline, with no LLM API key, account or database.
$ evalgate compare evals/baseline evals/candidate --policy evalgate.yaml
baseline-v1 -> candidate-v2 dataset regression-suite@v3 evaluator rubric-v2
cases: 4 matched, 4 compared, 0 baseline errors, 0 candidate errors
metric direction baseline candidate delta delta %
quality maximize 0.8 0.865 +0.065 +8.12%
...
FAIL checks.required.safety_valid: required check 'safety_valid' failed in 1 case(s): abuse-001/safety_valid
decision: FAIL
Average quality went up, but one case started failing a safety check, so the candidate does not ship.
Install
pip install evalgate-ai
The package is published as evalgate-ai. It imports as evalgate, and the command is evalgate. Requires Python 3.11 or newer.
Quickstart
1. Write each run as a directory. Use run.json for identity and cases.jsonl with one JSON object per test case:
{"schema_version": "1.0", "run_id": "candidate-v2", "dataset_id": "regression-suite",
"dataset_version": "v3", "evaluator_version": "rubric-v2"}
{"case_id": "refund-001", "status": "ok", "scores": {"quality": 0.91},
"checks": {"safety_valid": true}, "metrics": {"latency_ms": 3000, "cost_usd": 0.012},
"metadata": {"category": "billing"}}
If the pipeline failed on a case, record "status": "error" instead of inventing scores. Or let the Python SDK below write these files for you.
2. Create a policy:
evalgate init # writes a commented evalgate.yaml
version: 1
metrics:
quality:
path: scores.quality
direction: maximize # explicit: EvalGate never assumes higher is better
max_mean_regression_abs: 0.02
latency:
path: metrics.latency_ms
direction: minimize
max_mean_regression_pct: 10
checks:
required: [safety_valid] # must pass in every candidate case
max_new_failures: 0 # nothing that passed before may fail now
3. Compare:
evalgate validate evals/candidate
evalgate compare evals/baseline evals/candidate --policy evalgate.yaml \
--json report.json --report report.html
--reportwrites one standalone HTML file: no scripts and no external assets.--jsonwrites a stable, documented report: see report format.--markdown report.mdwrites a short summary for a pull request comment or a CI job summary: see CI integration.- No report contains raw prompts or outputs.
Repeated runs
LLM outputs vary from run to run. To measure that noise, evaluate each case several times: add "repeat": 0, 1, … to each line of cases.jsonl, set "schema_version": "1.1", and optionally declare "repeats": 3 in run.json. In the SDK, use EvalRun(..., repeats=3) and run.record(case_id, repeat=i, ...).
- How repeats are combined per case: metrics are averaged, a check passes only if it passes in every repeat, and any errored repeat makes the case an error. Means, intervals and rules then run on cases, so 3 repeats × 100 cases is still 100 cases, never 300.
- Fail closed: a missing or duplicated repeat makes the result INVALID.
- Report: shows how much each metric varies between repeats within a case, and each check's pass rate.
Importing from other tools
Already have results from another tool as CSV, JSON or JSONL? Describe the columns once in a mapping file and convert:
evalgate import results.csv --mapping mapping.yaml --out evals/candidate --run-id candidate-v2
Bad records are all reported, and nothing is written unless every record converts. Unmapped columns, such as prompts and outputs, are never copied. See importing.
Using promptfoo? Import its -o results.json directly, no mapping needed:
evalgate import results.json --from promptfoo --out evals/candidate \
--dataset support-suite --dataset-version v3 --evaluator-version pf-asserts-1
See promptfoo. DeepEval test run files work the same way with --from deepeval: see DeepEval. For Langfuse experiments, write the run from your experiment script: see Langfuse.
Python SDK
from evalgate import EvalRun, compare
with EvalRun(
"candidate", dataset="support-suite", dataset_version="v3", evaluator_version="rubric-v2"
) as run: # writes evals/candidate/
for case in dataset:
try:
output = execute_agent(case)
except Exception as exc:
run.record_error(case["id"], repr(exc)) # never invent scores
continue
run.record(
case["id"],
scores={"quality": judge(output)},
checks={"safety_valid": is_safe(output)},
metrics={"latency_ms": 1234},
)
report = compare("evals/baseline", "evals/candidate", policy="evalgate.yaml")
print(report.summary())
report.to_json("report.json")
report.to_html("report.html")
- Validation: values are checked as you record them. Duplicate
case_ids raise an error. - Crash safety:
run.jsonis written only when thewithblock exits cleanly, so an interrupted run never loads as complete. - Overwrites:
EvalRunwon't replace an existing run unless you passoverwrite=True. Even then, the old run is replaced only when the new one finishes cleanly. - Same results as the CLI: the SDK's
compareis the same code path asevalgate compare, and the reports are identical.
How decisions are made
-
INVALID (exit 2): a trustworthy decision is impossible. Causes:
- missing or duplicate cases
- a dataset or evaluator version mismatch
- missing metrics or checks
- malformed files
- a percent threshold on a metric whose baseline mean is 0
Invalid input never produces a PASS.
-
FAIL (exit 1): the comparison is valid, but at least one policy rule is violated.
-
PASS (exit 0): the comparison is valid and every rule holds.
Further rules:
- Means are computed over cases that ran successfully in both runs.
- With fewer than 30 such cases, the report warns that differences may be noise. Set
comparison.min_compared_casesto turn a too-small sample into INVALID. - Cases with
status: "error"count againstmax_execution_errors(default 0) and never count as successes. - Every metric declares its direction and at least one threshold.
- The policy is strict. Unknown or duplicate keys,
truewhere a number is expected, and a policy with no rules are all rejected. - Each metric's mean change comes with a confidence interval (95% by default,
statistics.confidence). A rule whose interval spans its threshold is reported as inconclusive. Withstatistics: {require_conclusive: true}, an inconclusive pass becomes a FAIL. Statistics can tighten a decision, never loosen it. - Each check also reports how many cases newly fail and newly pass, with a one-sided exact McNemar p-value. With
checks.fail_on_significant_regression: true, a significant increase in failures is a FAIL. Combine it with another rule, because with only a few flips the test can never reach significance. That's useful when checks flip noisily andmax_new_failures: 0is too strict. - A metric can also set
max_category_regression_abs/_pct: the same limit applied to eachmetadata.categoryon its own, so a regression confined to one category fails even when the overall mean improves. - How the intervals, tests and limits work, and what they can't tell you: statistics.
- There is no weighted overall score. Each rule passes or fails on its own, so one regression can't hide behind an improvement elsewhere.
Use in CI
Exit codes make EvalGate a drop-in CI step. See CI integration for a GitHub Actions example.
Examples
examples/ has runnable scenarios:
- a safety regression hidden by better averages
- a quality gain that blows the cost and latency budget
- an SDK eval loop with a timed-out case
Status and scope
Version 0.6.0 (alpha). See the changelog. EvalGate compares results your pipeline already produced. It does not run your application, call LLM judges, or host datasets.
Not yet included:
- dedicated adapters for tools other than promptfoo and DeepEval; the generic importer covers their CSV/JSON exports
Planned work is in the spec.
Contributing
See CONTRIBUTING.md.
License
MIT
Metadata
Release files for evalgate-ai 0.6.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| evalgate_ai-0.6.0.tar.gz | 107.0 kB | Without provenance | Details for evalgate_ai-0.6.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| evalgate_ai-0.6.0-py3-none-any.whl | Python 3 | none | any | Details for evalgate_ai-0.6.0-py3-none-any.whl |
Total release size: 161.7 kB
Release files / evalgate_ai-0.6.0.tar.gz
| Download URL | evalgate_ai-0.6.0.tar.gz |
|---|---|
| Size | 107.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
19af16394a7225d7479b778340a2c2d426e9a693ab48b186dafd6a17c380d7ec
|
|
BLAKE2b-256 checksum How to use checksums |
93d2eb7746437a02e98816102e71651a2cd124b06fb280dc513ee0029a8df309
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.14.2
|
Release files / evalgate_ai-0.6.0-py3-none-any.whl
| Download URL | evalgate_ai-0.6.0-py3-none-any.whl |
|---|---|
| Size | 54.7 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
82aa33dbaa389246b4dbe36f5b42948dac00651e4fce639241dbc23a7dc22873
|
|
BLAKE2b-256 checksum How to use checksums |
6c573b1f590641c4b9c24d45ce48e329cb2aaf36ff4651a2348e164df2c6aebb
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.14.2
|
Security for evalgate-ai 0.6.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.