Skip to main content

Evaldiff

evaldiff CI PyPI version npm version

CI for LLM prompts. Datasets, eval runs, and regression diffs as a pass/fail gate for your CI — the npm test of 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 --threshold 0.85 → exit code 0/1, 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

# Scaffold a dataset with two example cases
evaldiff init --name my-dataset

# Edit my-dataset.json, then run an eval against your model endpoint
evaldiff run --dataset my-dataset.json \
             --endpoint https://your-openai-compatible/v1 \
             --model your-model \
             --threshold 0.85

# Compare two runs and see regressions
evaldiff diff <run-a-id> <run-b-id>

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/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.2 — API core: auth, datasets, runs (worker + retries), judges, diff + report
  • 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.

Metadata

Release files for evaldiff 0.0.18

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for evaldiff 0.0.18
File Size Uploaded Provenance Actions
evaldiff-0.0.18.tar.gz 110.6 kB Without provenance Details for evaldiff-0.0.18.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for evaldiff 0.0.18
File Interpreter ABI Platform Actions
evaldiff-0.0.18-py3-none-any.whl Python 3 none any Details for evaldiff-0.0.18-py3-none-any.whl

Total release size: 171.0 kB

Release files / evaldiff-0.0.18.tar.gz

Download URL evaldiff-0.0.18.tar.gz
Size 110.6 kB
Tags Source
SHA-256 checksum
How to use checksums
6657cda36700fcd4c64b51dba2f46a0a93369e0bbfeeb7c0ac47ff7ad19ce882
BLAKE2b-256 checksum
How to use checksums
2c5f8ab4a0622751fed4a0195b8e7c8a2c49f1bb2d99617639d3419f78b137dd
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.11.16

Release files / evaldiff-0.0.18-py3-none-any.whl

Download URL evaldiff-0.0.18-py3-none-any.whl
Size 60.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
71dd0955d0bf30a13568c6152e0398881b30d0d34d6453993de6ccc9f84d3cb8
BLAKE2b-256 checksum
How to use checksums
5f00815566471991dcd53492396eeffb3d97a00a330e3e4806c3c407e480d02e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.11.16

Security for evaldiff 0.0.18

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.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page