evaldiff 0.0.1__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- evaldiff-0.0.1/LICENSE +21 -0
- evaldiff-0.0.1/PKG-INFO +100 -0
- evaldiff-0.0.1/README.md +76 -0
- evaldiff-0.0.1/evaldiff_cli/__init__.py +1 -0
- evaldiff-0.0.1/evaldiff_cli/main.py +63 -0
- evaldiff-0.0.1/pyproject.toml +40 -0
- evaldiff-0.0.1/tests/test_cli.py +38 -0
evaldiff-0.0.1/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Peter Hedman
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
evaldiff-0.0.1/PKG-INFO
ADDED
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
Metadata-Version: 2.5
|
|
2
|
+
Name: evaldiff
|
|
3
|
+
Version: 0.0.1
|
|
4
|
+
Summary: CI for LLM prompts: datasets, eval runs, and regression diffs as a pass/fail gate.
|
|
5
|
+
Project-URL: Homepage, https://evaldiff.io
|
|
6
|
+
Project-URL: Repository, https://github.com/evaldiff/evaldiff
|
|
7
|
+
Author-email: Peter Hedman <peter.mejl@gmail.com>
|
|
8
|
+
License: MIT
|
|
9
|
+
License-File: LICENSE
|
|
10
|
+
Keywords: ci,eval,evals,llm,prompts,regression,testing
|
|
11
|
+
Classifier: Development Status :: 3 - Alpha
|
|
12
|
+
Classifier: Intended Audience :: Developers
|
|
13
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
14
|
+
Classifier: Programming Language :: Python :: 3
|
|
15
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
16
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
17
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
18
|
+
Classifier: Topic :: Software Development :: Quality Assurance
|
|
19
|
+
Requires-Python: >=3.10
|
|
20
|
+
Requires-Dist: httpx>=0.27
|
|
21
|
+
Requires-Dist: rich>=13.7
|
|
22
|
+
Requires-Dist: typer>=0.12
|
|
23
|
+
Description-Content-Type: text/markdown
|
|
24
|
+
|
|
25
|
+
# Evaldiff
|
|
26
|
+
|
|
27
|
+
> **CI for LLM prompts.** Datasets, eval runs, and regression diffs as a
|
|
28
|
+
> pass/fail gate for your CI — the `npm test` of prompts.
|
|
29
|
+
|
|
30
|
+
Evaldiff scores your LLM output against a dataset of expected answers and
|
|
31
|
+
rubric criteria, then gives you a green/red gate you can wire straight into
|
|
32
|
+
GitHub Actions. When a model change or prompt edit regresses a case, the diff
|
|
33
|
+
tells you exactly which one.
|
|
34
|
+
|
|
35
|
+
## Why
|
|
36
|
+
|
|
37
|
+
You already know how to test normal software. LLM output is non-deterministic,
|
|
38
|
+
so "it worked yesterday, why not today?" is a daily problem. Evaldiff sells the
|
|
39
|
+
**green checkmark** — not "AI testing" as an abstract service.
|
|
40
|
+
|
|
41
|
+
- **Dataset** — a JSON file of `{input, expected, rubric?}` cases.
|
|
42
|
+
- **Run** — score a (dataset, model, prompt) combination; per-case score,
|
|
43
|
+
pass/fail vs. a threshold, latency, tokens, cost.
|
|
44
|
+
- **Diff** — `run A vs B`: regressions highlighted, side by side.
|
|
45
|
+
- **Gate** — `evaldiff run --threshold 0.85` → exit code `0`/`1`, drops straight
|
|
46
|
+
into GitHub Actions.
|
|
47
|
+
|
|
48
|
+
## Install
|
|
49
|
+
|
|
50
|
+
```bash
|
|
51
|
+
pip install evaldiff
|
|
52
|
+
evaldiff --version
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
## Quickstart
|
|
56
|
+
|
|
57
|
+
```bash
|
|
58
|
+
# Scaffold a dataset with two example cases
|
|
59
|
+
evaldiff init my-dataset
|
|
60
|
+
|
|
61
|
+
# Edit my-dataset.json, then run an eval against your model endpoint
|
|
62
|
+
evaldiff run --dataset my-dataset.json \
|
|
63
|
+
--endpoint https://your-openai-compatible/v1 \
|
|
64
|
+
--model your-model \
|
|
65
|
+
--threshold 0.85
|
|
66
|
+
|
|
67
|
+
# Compare two runs and see regressions
|
|
68
|
+
evaldiff diff <run-a-id> <run-b-id>
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
## Dataset format
|
|
72
|
+
|
|
73
|
+
```json
|
|
74
|
+
[
|
|
75
|
+
{
|
|
76
|
+
"input": "Refund policy for a returned item",
|
|
77
|
+
"expected": "You can return any item within 30 days for a full refund.",
|
|
78
|
+
"rubric": ["mentions the 30-day window", "mentions full refund"],
|
|
79
|
+
"tags": ["support"]
|
|
80
|
+
}
|
|
81
|
+
]
|
|
82
|
+
```
|
|
83
|
+
|
|
84
|
+
`rubric` is optional — a list of criteria a judge model scores 0/1 against.
|
|
85
|
+
Without it, evaldiff falls back to semantic / exact similarity vs. `expected`.
|
|
86
|
+
|
|
87
|
+
## Supported endpoints (v0)
|
|
88
|
+
|
|
89
|
+
- Any **OpenAI-compatible** `/chat/completions` endpoint (BYO key)
|
|
90
|
+
- OpenAI
|
|
91
|
+
- Anthropic
|
|
92
|
+
|
|
93
|
+
Everything else: bring your own adapter. Scope is the moat.
|
|
94
|
+
|
|
95
|
+
## Status
|
|
96
|
+
|
|
97
|
+
**v0.0.1 — name reservation.** The hosted API, judge, and runner land in the
|
|
98
|
+
coming days. This release exists to lock the `evaldiff` name on PyPI.
|
|
99
|
+
|
|
100
|
+
MIT licensed.
|
evaldiff-0.0.1/README.md
ADDED
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
# Evaldiff
|
|
2
|
+
|
|
3
|
+
> **CI for LLM prompts.** Datasets, eval runs, and regression diffs as a
|
|
4
|
+
> pass/fail gate for your CI — the `npm test` of prompts.
|
|
5
|
+
|
|
6
|
+
Evaldiff scores your LLM output against a dataset of expected answers and
|
|
7
|
+
rubric criteria, then gives you a green/red gate you can wire straight into
|
|
8
|
+
GitHub Actions. When a model change or prompt edit regresses a case, the diff
|
|
9
|
+
tells you exactly which one.
|
|
10
|
+
|
|
11
|
+
## Why
|
|
12
|
+
|
|
13
|
+
You already know how to test normal software. LLM output is non-deterministic,
|
|
14
|
+
so "it worked yesterday, why not today?" is a daily problem. Evaldiff sells the
|
|
15
|
+
**green checkmark** — not "AI testing" as an abstract service.
|
|
16
|
+
|
|
17
|
+
- **Dataset** — a JSON file of `{input, expected, rubric?}` cases.
|
|
18
|
+
- **Run** — score a (dataset, model, prompt) combination; per-case score,
|
|
19
|
+
pass/fail vs. a threshold, latency, tokens, cost.
|
|
20
|
+
- **Diff** — `run A vs B`: regressions highlighted, side by side.
|
|
21
|
+
- **Gate** — `evaldiff run --threshold 0.85` → exit code `0`/`1`, drops straight
|
|
22
|
+
into GitHub Actions.
|
|
23
|
+
|
|
24
|
+
## Install
|
|
25
|
+
|
|
26
|
+
```bash
|
|
27
|
+
pip install evaldiff
|
|
28
|
+
evaldiff --version
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
## Quickstart
|
|
32
|
+
|
|
33
|
+
```bash
|
|
34
|
+
# Scaffold a dataset with two example cases
|
|
35
|
+
evaldiff init my-dataset
|
|
36
|
+
|
|
37
|
+
# Edit my-dataset.json, then run an eval against your model endpoint
|
|
38
|
+
evaldiff run --dataset my-dataset.json \
|
|
39
|
+
--endpoint https://your-openai-compatible/v1 \
|
|
40
|
+
--model your-model \
|
|
41
|
+
--threshold 0.85
|
|
42
|
+
|
|
43
|
+
# Compare two runs and see regressions
|
|
44
|
+
evaldiff diff <run-a-id> <run-b-id>
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
## Dataset format
|
|
48
|
+
|
|
49
|
+
```json
|
|
50
|
+
[
|
|
51
|
+
{
|
|
52
|
+
"input": "Refund policy for a returned item",
|
|
53
|
+
"expected": "You can return any item within 30 days for a full refund.",
|
|
54
|
+
"rubric": ["mentions the 30-day window", "mentions full refund"],
|
|
55
|
+
"tags": ["support"]
|
|
56
|
+
}
|
|
57
|
+
]
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
`rubric` is optional — a list of criteria a judge model scores 0/1 against.
|
|
61
|
+
Without it, evaldiff falls back to semantic / exact similarity vs. `expected`.
|
|
62
|
+
|
|
63
|
+
## Supported endpoints (v0)
|
|
64
|
+
|
|
65
|
+
- Any **OpenAI-compatible** `/chat/completions` endpoint (BYO key)
|
|
66
|
+
- OpenAI
|
|
67
|
+
- Anthropic
|
|
68
|
+
|
|
69
|
+
Everything else: bring your own adapter. Scope is the moat.
|
|
70
|
+
|
|
71
|
+
## Status
|
|
72
|
+
|
|
73
|
+
**v0.0.1 — name reservation.** The hosted API, judge, and runner land in the
|
|
74
|
+
coming days. This release exists to lock the `evaldiff` name on PyPI.
|
|
75
|
+
|
|
76
|
+
MIT licensed.
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"""evaldiff_cli package."""
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
"""evaldiff — CI for LLM prompts.
|
|
2
|
+
|
|
3
|
+
Stubs a small, self-serve evaluation gate: datasets, runs, and
|
|
4
|
+
regression diffs exposed as a pass/fail gate for CI.
|
|
5
|
+
"""
|
|
6
|
+
from __future__ import annotations
|
|
7
|
+
|
|
8
|
+
import typer
|
|
9
|
+
from rich.console import Console
|
|
10
|
+
|
|
11
|
+
__version__ = "0.0.1"
|
|
12
|
+
|
|
13
|
+
app = typer.Typer(
|
|
14
|
+
name="evaldiff",
|
|
15
|
+
help="CI for LLM prompts: datasets, eval runs, regression diffs.",
|
|
16
|
+
no_args_is_help=True,
|
|
17
|
+
)
|
|
18
|
+
console = Console()
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
@app.command()
|
|
22
|
+
def version() -> None:
|
|
23
|
+
"""Print the evaldiff version."""
|
|
24
|
+
console.print(f"evaldiff {__version__}")
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
@app.command()
|
|
28
|
+
def init(
|
|
29
|
+
name: str = typer.Option("my-dataset", help="Dataset name"),
|
|
30
|
+
) -> None:
|
|
31
|
+
"""Scaffold a dataset JSON file in the current directory."""
|
|
32
|
+
import json
|
|
33
|
+
import pathlib
|
|
34
|
+
|
|
35
|
+
path = pathlib.Path(f"{name}.json")
|
|
36
|
+
if path.exists():
|
|
37
|
+
console.print(f"[yellow]{path} already exists, leaving untouched.[/yellow]")
|
|
38
|
+
raise typer.Exit(0)
|
|
39
|
+
sample = [
|
|
40
|
+
{
|
|
41
|
+
"input": "Refund policy for a returned item",
|
|
42
|
+
"expected": "You can return any item within 30 days for a full refund.",
|
|
43
|
+
"rubric": ["mentions the 30-day window", "mentions full refund"],
|
|
44
|
+
"tags": ["support"],
|
|
45
|
+
},
|
|
46
|
+
{
|
|
47
|
+
"input": "How do I reset my password?",
|
|
48
|
+
"expected": "Go to Settings → Security → Reset password and follow the email link.",
|
|
49
|
+
"rubric": ["mentions Settings", "mentions Security"],
|
|
50
|
+
"tags": ["support"],
|
|
51
|
+
},
|
|
52
|
+
]
|
|
53
|
+
path.write_text(json.dumps(sample, indent=2) + "\n")
|
|
54
|
+
console.print(f"[green]Wrote[/green] {path} with {len(sample)} example cases.")
|
|
55
|
+
console.print("Edit it, then run [bold]evaldiff run[/bold].")
|
|
56
|
+
|
|
57
|
+
|
|
58
|
+
def main() -> None:
|
|
59
|
+
app()
|
|
60
|
+
|
|
61
|
+
|
|
62
|
+
if __name__ == "__main__":
|
|
63
|
+
main()
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
[build-system]
|
|
2
|
+
requires = ["hatchling"]
|
|
3
|
+
build-backend = "hatchling.build"
|
|
4
|
+
|
|
5
|
+
[project]
|
|
6
|
+
name = "evaldiff"
|
|
7
|
+
version = "0.0.1"
|
|
8
|
+
description = "CI for LLM prompts: datasets, eval runs, and regression diffs as a pass/fail gate."
|
|
9
|
+
readme = "README.md"
|
|
10
|
+
requires-python = ">=3.10"
|
|
11
|
+
license = { text = "MIT" }
|
|
12
|
+
authors = [
|
|
13
|
+
{ name = "Peter Hedman", email = "peter.mejl@gmail.com" }
|
|
14
|
+
]
|
|
15
|
+
keywords = ["llm", "evals", "eval", "testing", "ci", "prompts", "regression"]
|
|
16
|
+
classifiers = [
|
|
17
|
+
"Development Status :: 3 - Alpha",
|
|
18
|
+
"Intended Audience :: Developers",
|
|
19
|
+
"License :: OSI Approved :: MIT License",
|
|
20
|
+
"Programming Language :: Python :: 3",
|
|
21
|
+
"Programming Language :: Python :: 3.10",
|
|
22
|
+
"Programming Language :: Python :: 3.11",
|
|
23
|
+
"Programming Language :: Python :: 3.12",
|
|
24
|
+
"Topic :: Software Development :: Quality Assurance",
|
|
25
|
+
]
|
|
26
|
+
dependencies = [
|
|
27
|
+
"httpx>=0.27",
|
|
28
|
+
"typer>=0.12",
|
|
29
|
+
"rich>=13.7",
|
|
30
|
+
]
|
|
31
|
+
|
|
32
|
+
[project.scripts]
|
|
33
|
+
evaldiff = "evaldiff_cli.main:app"
|
|
34
|
+
|
|
35
|
+
[project.urls]
|
|
36
|
+
Homepage = "https://evaldiff.io"
|
|
37
|
+
Repository = "https://github.com/evaldiff/evaldiff"
|
|
38
|
+
|
|
39
|
+
[tool.hatch.build.targets.wheel]
|
|
40
|
+
packages = ["evaldiff_cli"]
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
"""Tests for the evaldiff CLI stub."""
|
|
2
|
+
from __future__ import annotations
|
|
3
|
+
|
|
4
|
+
import json
|
|
5
|
+
import pathlib
|
|
6
|
+
|
|
7
|
+
from typer.testing import CliRunner
|
|
8
|
+
|
|
9
|
+
from evaldiff_cli.main import app
|
|
10
|
+
|
|
11
|
+
runner = CliRunner()
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
def test_version_command() -> None:
|
|
15
|
+
result = runner.invoke(app, ["version"])
|
|
16
|
+
assert result.exit_code == 0
|
|
17
|
+
assert "evaldiff" in result.output
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
def test_init_writes_valid_json(tmp_path: pathlib.Path, monkeypatch) -> None:
|
|
21
|
+
monkeypatch.chdir(tmp_path)
|
|
22
|
+
result = runner.invoke(app, ["init", "--name", "my-dataset"])
|
|
23
|
+
assert result.exit_code == 0
|
|
24
|
+
path = tmp_path / "my-dataset.json"
|
|
25
|
+
assert path.exists()
|
|
26
|
+
data = json.loads(path.read_text())
|
|
27
|
+
assert isinstance(data, list) and len(data) == 2
|
|
28
|
+
assert "input" in data[0] and "expected" in data[0] and "rubric" in data[0]
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
def test_init_is_idempotent(tmp_path: pathlib.Path, monkeypatch) -> None:
|
|
32
|
+
monkeypatch.chdir(tmp_path)
|
|
33
|
+
first = runner.invoke(app, ["init", "--name", "my-dataset"])
|
|
34
|
+
second = runner.invoke(app, ["init", "--name", "my-dataset"])
|
|
35
|
+
assert first.exit_code == 0
|
|
36
|
+
assert second.exit_code == 0
|
|
37
|
+
data = json.loads((tmp_path / "my-dataset.json").read_text())
|
|
38
|
+
assert len(data) == 2
|