Evaldiff
CI for LLM prompts. Datasets, eval runs, and regression diffs as a pass/fail gate for your CI — the
npm testof prompts.
Evaldiff scores your LLM output against a dataset of expected answers and rubric criteria, then gives you a green/red gate you can wire straight into GitHub Actions. When a model change or prompt edit regresses a case, the diff tells you exactly which one.
Why
You already know how to test normal software. LLM output is non-deterministic, so "it worked yesterday, why not today?" is a daily problem. Evaldiff sells the green checkmark — not "AI testing" as an abstract service.
- Dataset — a JSON file of
{input, expected, rubric?}cases. - Run — score a (dataset, model, prompt) combination; per-case score, pass/fail vs. a threshold, latency, tokens, cost.
- Diff —
run A vs B: regressions highlighted, side by side. - Gate —
evaldiff run/evaldiff diffexit0= pass,1= regression/failure,2= operational error (auth, deadline, incomplete run). Incomplete runs never exit 0. Drops straight into GitHub Actions.
Install
Python CLI (recommended):
pip install evaldiff
evaldiff --version
npm (placeholder + future GitHub Action):
npm i -g @evaldiff/evaldiff
Quickstart
# 1) Get a key (self-serve account; shown once)
evaldiff signup --email you@example.com
export EVALDIFF_API_KEY=eval_...
# 2) Scaffold a dataset with two example cases
evaldiff init --name my-dataset
# 3) Gate it: upload, run, poll to completion, exit 0/1/2
# NOTE: each `--dataset FILE` upload creates a NEW dataset — remember the
# printed dataset id so the next run can target the same one.
evaldiff run --dataset my-dataset.json \
--endpoint https://your-openai-compatible/v1 \
--model your-model \
--model-key $YOUR_MODEL_KEY \
--threshold 0.85
# → "uploaded dataset my-dataset (2 cases) → id 42"
# 4) Gate a change against the SAME dataset (this keeps runs comparable)
evaldiff run --dataset-id 42 \
--endpoint https://your-openai-compatible/v1 \
--model your-model \
--model-key $YOUR_MODEL_KEY \
--threshold 0.85
# 5) Compare the two runs; exit 1 on any regression
# (diff rejects runs on different datasets)
evaldiff diff --base <runA-id> --new <runB-id>
# Reports with per-case evidence (input / expected / actual / judge)
evaldiff run ... --report report --format both # report.json + report.md
Env: EVALDIFF_API_KEY (your evaldiff key), EVALDIFF_BASE_URL
(default https://api.evaldiff.io), EVALDIFF_MODEL_API_KEY (key for the
model endpoint, equivalent to --model-key).
Gate exit codes (stable contract)
| code | meaning |
|---|---|
0 |
PASS — run finished with all cases passing / no regressions |
1 |
FAIL — run finished with failures / regressions present |
2 |
ERROR — auth, network, deadline, run failed, incomplete run, invalid comparison |
A deadline or a failed run is an operational error (2), never a pass (0).
Dataset format
[
{
"input": "Refund policy for a returned item",
"expected": "You can return any item within 30 days for a full refund.",
"rubric": ["mentions the 30-day window", "mentions full refund"],
"tags": ["support"]
}
]
rubric is optional — a list of criteria a judge model scores 0/1 against.
Without it, evaldiff falls back to exact / contains matching against expected.
API (v0.0.2)
The core is a small FastAPI service (pip install evaldiff includes it):
evaldiff-server # uvicorn on :8000, SQLite by default
| Endpoint | Purpose |
|---|---|
POST /v1/auth/signup |
Self-serve account + API key (eval_…), 1k free cases/month |
POST /v1/datasets |
Create a dataset from inline cases |
GET /v1/datasets/{id} |
Dataset detail |
POST /v1/runs |
Score a dataset against an OpenAI-compatible endpoint (async job) |
GET /v1/runs/{id} |
Run status: queued → running → done/failed |
GET /v1/runs/{id}/cases |
Per-case output, score, pass/fail, tokens, error |
GET /v1/datasets/{id}/cases |
Dataset cases (input/expected/rubric) for reports |
GET /v1/runs/{id}/cases/{seq}/output |
One case's evidence: actual output + judge verdict |
GET /v1/runs/{id}/diff?compare={other_id} |
Regression diff (JSON) |
GET /v1/runs/{id}/report.md?compare={other_id} |
The same as a markdown report |
GET /v1/usage |
Quota / usage for the key |
Auth is a bearer eval_… key on every /v1/* call. Quota is per-account,
per calendar month; failed runs are free.
Supported endpoints (v0)
Any OpenAI-compatible /chat/completions endpoint (BYO key): OpenAI,
Groq, Together, Ollama, vLLM, LM Studio. Everything else: bring your own adapter.
Status
0.0.21— fixes: reports work with normal datasets (API assignsseq; CLI falls back to list position), file-based workflow stays comparable (quickstart + hints for--dataset-id), creation requests are no longer auto-retried on 5xx/transport errors (no duplicate runs/quota), OPERATIONS.md RPO aligned to the shipped daily backup schedule0.0.20— CLI gate:evaldiff run+evaldiff diffwith stable exit codes (0/1/2), per-case evidence endpoints, JSON/Markdown reports, LocalStorage for evidence without S30.0.19— bounded responses, secret-key enforcement, deadlines + fair queueing- Next: GitHub Action (
@evaldiff/action), web diff view, usage-based billing
Production credentials
Local development defaults to plaintext model-credential storage unless
EVALDIFF_SECRET_KEY is configured. Set EVALDIFF_PRODUCTION=true in production;
startup then requires a valid Fernet key and encrypted, readable stored
credentials. The bundled Compose deployment enforces this mode.
Follow the upgrade guide
for key provisioning, the offline python -m api.migrate_secrets command,
backup restoration, and rotation. The deployment image builds the checked-out
source; use the full repository checkout when deploying.
Running tests from source
Install the test dependencies before running the suite:
pip install -e '.[test]'
pytest -q
For PostgreSQL coverage, also install psycopg[binary]>=3.1 and set
EVALDIFF_TEST_POSTGRES_URL to a disposable PostgreSQL database. See
the qualification runbook for the isolated
PostgreSQL runner and staging scenarios.
Metadata
Release files for evaldiff 0.0.21
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 |
|---|---|---|---|---|
| evaldiff-0.0.21.tar.gz | 193.0 kB | Without provenance | Details for evaldiff-0.0.21.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| evaldiff-0.0.21-py3-none-any.whl | Python 3 | none | any | Details for evaldiff-0.0.21-py3-none-any.whl |
Total release size: 271.0 kB
Release files / evaldiff-0.0.21.tar.gz
| Download URL | evaldiff-0.0.21.tar.gz |
|---|---|
| Size | 193.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
680821c51bb047466d8de172f2bd3495b6dec48695af6004710ea3ff3b3b2bb0
|
|
BLAKE2b-256 checksum How to use checksums |
fe1565a499ad21df27bcb24244144b73c3296f12caa7917ea9c7467f0bb8afc7
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.14.7
|
Release files / evaldiff-0.0.21-py3-none-any.whl
| Download URL | evaldiff-0.0.21-py3-none-any.whl |
|---|---|
| Size | 78.1 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
d6312d0fc9245ce00c47a3ea17b6d30d623a3e1a385e95c89de90e9b4e2dee07
|
|
BLAKE2b-256 checksum How to use checksums |
44de7246f39fd621cf8096660f06767c100447e867c1e681c6e6d1fb5b4926c4
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.14.7
|
Security for evaldiff 0.0.21
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.