judgeproof 0.1.0__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.
- judgeproof-0.1.0/.gitignore +15 -0
- judgeproof-0.1.0/CHANGELOG.md +18 -0
- judgeproof-0.1.0/LICENSE +21 -0
- judgeproof-0.1.0/PKG-INFO +224 -0
- judgeproof-0.1.0/README.md +195 -0
- judgeproof-0.1.0/examples/README.md +10 -0
- judgeproof-0.1.0/examples/five-tools/README.md +18 -0
- judgeproof-0.1.0/examples/mt-bench/README.md +27 -0
- judgeproof-0.1.0/examples/real-judge/LICENSE +21 -0
- judgeproof-0.1.0/examples/real-judge/README.md +28 -0
- judgeproof-0.1.0/pyproject.toml +57 -0
- judgeproof-0.1.0/src/judgeproof/__init__.py +4 -0
- judgeproof-0.1.0/src/judgeproof/__main__.py +6 -0
- judgeproof-0.1.0/src/judgeproof/agreement.py +222 -0
- judgeproof-0.1.0/src/judgeproof/capture.py +265 -0
- judgeproof-0.1.0/src/judgeproof/cli.py +119 -0
- judgeproof-0.1.0/src/judgeproof/input_check.py +284 -0
- judgeproof-0.1.0/src/judgeproof/labels_needed.py +140 -0
- judgeproof-0.1.0/src/judgeproof/position_bias.py +121 -0
- judgeproof-0.1.0/tests/__init__.py +0 -0
- judgeproof-0.1.0/tests/conftest.py +29 -0
- judgeproof-0.1.0/tests/fixtures/captures/deepeval-testcase/0001-chat_completions.meta.json +10 -0
- judgeproof-0.1.0/tests/fixtures/captures/deepeval-testcase/0001-chat_completions.prompt.txt +96 -0
- judgeproof-0.1.0/tests/fixtures/captures/deepeval-testcase/0001-chat_completions.request.json +1 -0
- judgeproof-0.1.0/tests/fixtures/captures/deepeval-testcase/0002-chat_completions.meta.json +10 -0
- judgeproof-0.1.0/tests/fixtures/captures/deepeval-testcase/0002-chat_completions.prompt.txt +26 -0
- judgeproof-0.1.0/tests/fixtures/captures/deepeval-testcase/0002-chat_completions.request.json +1 -0
- judgeproof-0.1.0/tests/fixtures/captures/deepeval-trace/0003-chat_completions.meta.json +10 -0
- judgeproof-0.1.0/tests/fixtures/captures/deepeval-trace/0003-chat_completions.prompt.txt +187 -0
- judgeproof-0.1.0/tests/fixtures/captures/deepeval-trace/0003-chat_completions.request.json +1 -0
- judgeproof-0.1.0/tests/fixtures/captures/deepeval-trace/0004-chat_completions.meta.json +10 -0
- judgeproof-0.1.0/tests/fixtures/captures/deepeval-trace/0004-chat_completions.prompt.txt +26 -0
- judgeproof-0.1.0/tests/fixtures/captures/deepeval-trace/0004-chat_completions.request.json +1 -0
- judgeproof-0.1.0/tests/fixtures/captures/inspect-default/0005-chat_completions.meta.json +10 -0
- judgeproof-0.1.0/tests/fixtures/captures/inspect-default/0005-chat_completions.prompt.txt +32 -0
- judgeproof-0.1.0/tests/fixtures/captures/inspect-default/0005-chat_completions.request.json +1 -0
- judgeproof-0.1.0/tests/fixtures/captures/inspect-history/0006-chat_completions.meta.json +10 -0
- judgeproof-0.1.0/tests/fixtures/captures/inspect-history/0006-chat_completions.prompt.txt +116 -0
- judgeproof-0.1.0/tests/fixtures/captures/inspect-history/0006-chat_completions.request.json +1 -0
- judgeproof-0.1.0/tests/fixtures/captures/opik-task-completion/0007-chat_completions.meta.json +10 -0
- judgeproof-0.1.0/tests/fixtures/captures/opik-task-completion/0007-chat_completions.prompt.txt +17 -0
- judgeproof-0.1.0/tests/fixtures/captures/opik-task-completion/0007-chat_completions.request.json +1 -0
- judgeproof-0.1.0/tests/fixtures/captures/opik-task-completion/0008-chat_completions.meta.json +10 -0
- judgeproof-0.1.0/tests/fixtures/captures/opik-task-completion/0008-chat_completions.prompt.txt +77 -0
- judgeproof-0.1.0/tests/fixtures/captures/opik-task-completion/0008-chat_completions.request.json +1 -0
- judgeproof-0.1.0/tests/fixtures/captures/opik-trajectory/0009-chat_completions.meta.json +10 -0
- judgeproof-0.1.0/tests/fixtures/captures/opik-trajectory/0009-chat_completions.prompt.txt +110 -0
- judgeproof-0.1.0/tests/fixtures/captures/opik-trajectory/0009-chat_completions.request.json +1 -0
- judgeproof-0.1.0/tests/fixtures/captures/phoenix-tool-invocation/0011-chat_completions.meta.json +10 -0
- judgeproof-0.1.0/tests/fixtures/captures/phoenix-tool-invocation/0011-chat_completions.prompt.txt +104 -0
- judgeproof-0.1.0/tests/fixtures/captures/phoenix-tool-invocation/0011-chat_completions.request.json +1 -0
- judgeproof-0.1.0/tests/fixtures/captures/phoenix-tool-response/0012-chat_completions.meta.json +10 -0
- judgeproof-0.1.0/tests/fixtures/captures/phoenix-tool-response/0012-chat_completions.prompt.txt +144 -0
- judgeproof-0.1.0/tests/fixtures/captures/phoenix-tool-response/0012-chat_completions.request.json +1 -0
- judgeproof-0.1.0/tests/fixtures/captures/phoenix-tool-selection/0010-chat_completions.meta.json +10 -0
- judgeproof-0.1.0/tests/fixtures/captures/phoenix-tool-selection/0010-chat_completions.prompt.txt +87 -0
- judgeproof-0.1.0/tests/fixtures/captures/phoenix-tool-selection/0010-chat_completions.request.json +1 -0
- judgeproof-0.1.0/tests/fixtures/captures/promptfoo-goal-success/0014-chat_completions.meta.json +10 -0
- judgeproof-0.1.0/tests/fixtures/captures/promptfoo-goal-success/0014-chat_completions.prompt.txt +93 -0
- judgeproof-0.1.0/tests/fixtures/captures/promptfoo-goal-success/0014-chat_completions.request.json +1 -0
- judgeproof-0.1.0/tests/fixtures/captures/promptfoo-llm-rubric/0013-chat_completions.meta.json +10 -0
- judgeproof-0.1.0/tests/fixtures/captures/promptfoo-llm-rubric/0013-chat_completions.prompt.txt +20 -0
- judgeproof-0.1.0/tests/fixtures/captures/promptfoo-llm-rubric/0013-chat_completions.request.json +1 -0
- judgeproof-0.1.0/tests/fixtures/mtbench_binary.csv +985 -0
- judgeproof-0.1.0/tests/fixtures/mtbench_stronger_weaker.csv +985 -0
- judgeproof-0.1.0/tests/fixtures/routes.json +68 -0
- judgeproof-0.1.0/tests/fixtures/spec.json +8 -0
- judgeproof-0.1.0/tests/fixtures/support_run.json +130 -0
- judgeproof-0.1.0/tests/test_agreement.py +84 -0
- judgeproof-0.1.0/tests/test_capture.py +67 -0
- judgeproof-0.1.0/tests/test_cli.py +18 -0
- judgeproof-0.1.0/tests/test_input_check.py +92 -0
- judgeproof-0.1.0/tests/test_labels_needed.py +62 -0
- judgeproof-0.1.0/tests/test_position_bias.py +52 -0
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
.venv/
|
|
2
|
+
.venvs/
|
|
3
|
+
__pycache__/
|
|
4
|
+
*.egg-info/
|
|
5
|
+
dist/
|
|
6
|
+
build/
|
|
7
|
+
.pytest_cache/
|
|
8
|
+
.ruff_cache/
|
|
9
|
+
captures/
|
|
10
|
+
!tests/fixtures/captures/
|
|
11
|
+
!examples/five-tools/captures/
|
|
12
|
+
examples/mt-bench/data/
|
|
13
|
+
examples/five-tools/work/
|
|
14
|
+
examples/five-tools/tools/promptfoo/node_modules/
|
|
15
|
+
.DS_Store
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
All notable changes are listed here. The format follows [Keep a Changelog](https://keepachangelog.com/en/1.1.0/), and versions follow [Semantic Versioning](https://semver.org/).
|
|
4
|
+
|
|
5
|
+
## [0.1.0] - 2026-12-01
|
|
6
|
+
|
|
7
|
+
First release.
|
|
8
|
+
|
|
9
|
+
### Added
|
|
10
|
+
- `judgeproof agreement`: judge vs human labels. Agreement and Cohen's kappa with an item-level bootstrap 95% CI, the confusion matrix, per-label precision and recall, the always-majority baseline, and per-group reports. `--min-kappa` and `--min-recall` turn it into a CI gate.
|
|
11
|
+
- `judgeproof labels-needed`: kappa CI width against the number of labels, simulated from a pilot set or from an expected kappa and label balance. It also gives the labels needed for a target width.
|
|
12
|
+
- `judgeproof input check` / `input verify`: did the judge see the user message, tool names, arguments, tool results and final reply? It flags blank steps, supports a criteria spec, and records SHA-256 manifests so you can verify the bytes sent. It implements the four input-assurance obligations of Xia et al. (arXiv 2611.02676).
|
|
13
|
+
- `judgeproof position-bias`: flip rate and first-position preference for pairwise judges, with an optional `--max-flip-rate` gate.
|
|
14
|
+
- `judgeproof capture`: a local, recording, OpenAI-compatible fake judge for dry runs.
|
|
15
|
+
- A GitHub Action (`woqsi/judgeproof@v0`) and an example workflow.
|
|
16
|
+
- Examples: the MT-Bench judge-agreement reproduction, the five-tool judge-input experiment (DeepEval, Inspect, promptfoo, Opik, Phoenix), and the real-judge follow-up (does hiding the tool calls change a real judge's grade?).
|
|
17
|
+
|
|
18
|
+
[0.1.0]: https://github.com/woqsi/judgeproof/releases/tag/v0.1.0
|
judgeproof-0.1.0/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Woq
|
|
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.
|
|
@@ -0,0 +1,224 @@
|
|
|
1
|
+
Metadata-Version: 2.5
|
|
2
|
+
Name: judgeproof
|
|
3
|
+
Version: 0.1.0
|
|
4
|
+
Summary: Checks for your evals: prove your LLM judge agrees with your humans and sees what it needs, and fail CI when it doesn't.
|
|
5
|
+
Project-URL: Homepage, https://github.com/woqsi/judgeproof
|
|
6
|
+
Project-URL: Source, https://github.com/woqsi/judgeproof
|
|
7
|
+
Project-URL: Issues, https://github.com/woqsi/judgeproof/issues
|
|
8
|
+
Project-URL: Changelog, https://github.com/woqsi/judgeproof/blob/main/CHANGELOG.md
|
|
9
|
+
Author-email: Woq <hello@woq.si>
|
|
10
|
+
License-Expression: MIT
|
|
11
|
+
License-File: LICENSE
|
|
12
|
+
Keywords: agents,ci,cohen-kappa,evals,evaluation,llm,llm-as-a-judge
|
|
13
|
+
Classifier: Development Status :: 3 - Alpha
|
|
14
|
+
Classifier: Environment :: Console
|
|
15
|
+
Classifier: Intended Audience :: Developers
|
|
16
|
+
Classifier: Intended Audience :: Science/Research
|
|
17
|
+
Classifier: Operating System :: OS Independent
|
|
18
|
+
Classifier: Programming Language :: Python :: 3
|
|
19
|
+
Classifier: Programming Language :: Python :: 3 :: Only
|
|
20
|
+
Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
|
|
21
|
+
Classifier: Topic :: Software Development :: Quality Assurance
|
|
22
|
+
Classifier: Topic :: Software Development :: Testing
|
|
23
|
+
Requires-Python: >=3.10
|
|
24
|
+
Requires-Dist: numpy>=1.24
|
|
25
|
+
Provides-Extra: dev
|
|
26
|
+
Requires-Dist: pytest>=8; extra == 'dev'
|
|
27
|
+
Requires-Dist: ruff>=0.6; extra == 'dev'
|
|
28
|
+
Description-Content-Type: text/markdown
|
|
29
|
+
|
|
30
|
+
# judgeproof
|
|
31
|
+
|
|
32
|
+
**Checks for your evals.** Prove your LLM judge agrees with your humans and sees what it needs, and fail CI when it doesn't.
|
|
33
|
+
|
|
34
|
+
[](https://github.com/woqsi/judgeproof/actions/workflows/ci.yml)
|
|
35
|
+
[](https://pypi.org/project/judgeproof/)
|
|
36
|
+
[](https://github.com/woqsi/judgeproof/blob/main/LICENSE)
|
|
37
|
+
|
|
38
|
+
Most eval tools help you *write* evals. judgeproof checks whether you can trust the judge that scores them.
|
|
39
|
+
|
|
40
|
+
- **Agreement.** Point it at a CSV of human and judge labels. You get agreement and Cohen's kappa with confidence intervals, plus per-label recall, so a judge that never catches the rare failure can't hide behind 87% accuracy.
|
|
41
|
+
- **Input.** Point it at an agent run and at what the judge actually received. It tells you whether the judge saw the tool calls, arguments and results it was asked to grade.
|
|
42
|
+
|
|
43
|
+
Every check exits non-zero when it fails, so it can gate a pull request. judgeproof works alongside DeepEval, Inspect, promptfoo, Opik, Phoenix, Langfuse and the rest; it doesn't replace them.
|
|
44
|
+
|
|
45
|
+
```bash
|
|
46
|
+
pip install judgeproof
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
Python 3.10+. The only dependency is numpy.
|
|
50
|
+
|
|
51
|
+
## Why
|
|
52
|
+
|
|
53
|
+
What we found when we tested this ourselves (full write-ups in [`examples/`](https://github.com/woqsi/judgeproof/tree/main/examples/)):
|
|
54
|
+
|
|
55
|
+
- **High agreement can hide a judge that misses what matters.** On 984 MT-Bench items, GPT-4 agreed with expert raters 87.4% of the time. When the question became "did the weaker model win?", a judge that *always* said "no" scored 85.0%. GPT-4 caught only 29% of the upsets the experts saw. Kappa and per-label recall show this; raw agreement doesn't. ([examples/mt-bench](https://github.com/woqsi/judgeproof/tree/main/examples/mt-bench/))
|
|
56
|
+
- **Your judge may never see the tool calls.** We sent one agent run through five popular eval tools' agent-judging features. In three of eleven routes, the judge was asked whether the agent's promise matched the policy it looked up, without ever being shown that policy. ([examples/five-tools](https://github.com/woqsi/judgeproof/tree/main/examples/five-tools/))
|
|
57
|
+
- **And it changes the grade.** We had a real OpenAI judge grade 40 support-bot runs through Inspect, with and without the tool calls. Without them, it failed every correct reply that promised a credit, because it couldn't check the policy, and turning reasoning on made it pass more wrong replies (23 of 72, up from 10). With the tool calls but reasoning off, the small judge still passed about a third of wrong credit offers; with reasoning on it passed none. ([examples/real-judge](https://github.com/woqsi/judgeproof/tree/main/examples/real-judge/))
|
|
58
|
+
|
|
59
|
+
## Quick start
|
|
60
|
+
|
|
61
|
+
### 1. Does the judge agree with your humans?
|
|
62
|
+
|
|
63
|
+
Give it a CSV with one row per labeled example. Labels can be any strings: pass/fail, 1–5, good/ok/bad.
|
|
64
|
+
|
|
65
|
+
```csv
|
|
66
|
+
id,human,judge
|
|
67
|
+
t-001,pass,pass
|
|
68
|
+
t-002,fail,pass
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
```bash
|
|
72
|
+
judgeproof agreement labels.csv
|
|
73
|
+
```
|
|
74
|
+
|
|
75
|
+
```
|
|
76
|
+
== all rows ==
|
|
77
|
+
rows: 984 (distinct ids: 984)
|
|
78
|
+
agreement: 87.4% (95% CI 85.2% to 89.4%)
|
|
79
|
+
Cohen's kappa: 0.352 (95% CI 0.266 to 0.437)
|
|
80
|
+
a judge that always says 'stronger': agreement 85.0%, kappa 0
|
|
81
|
+
|
|
82
|
+
confusion matrix (rows: human, columns: judge)
|
|
83
|
+
stronger weaker
|
|
84
|
+
stronger 817 19
|
|
85
|
+
weaker 105 43
|
|
86
|
+
|
|
87
|
+
per label: precision = when the judge says it, how often the human agrees;
|
|
88
|
+
recall = when the human says it, how often the judge agrees
|
|
89
|
+
stronger precision 88.6% recall 97.7% (human 836, judge 922)
|
|
90
|
+
weaker precision 69.4% recall 29.1% (human 148, judge 62)
|
|
91
|
+
```
|
|
92
|
+
|
|
93
|
+
To gate CI, add thresholds. This fails (exit 1) when the lower end of kappa's CI is under 0.6, or when the judge catches under 80% of the failures your humans found:
|
|
94
|
+
|
|
95
|
+
```bash
|
|
96
|
+
judgeproof agreement labels.csv --min-kappa 0.6 --min-recall fail=0.8
|
|
97
|
+
```
|
|
98
|
+
|
|
99
|
+
Other options: `--group category` repeats the report per group, and `--json report.json` saves everything.
|
|
100
|
+
|
|
101
|
+
### 2. How many labels do you need?
|
|
102
|
+
|
|
103
|
+
With too few labels, kappa's confidence interval is too wide to tell a good judge from a bad one. Plan before you label:
|
|
104
|
+
|
|
105
|
+
```bash
|
|
106
|
+
judgeproof labels-needed --kappa 0.75 --minority 0.46 # balanced labels
|
|
107
|
+
judgeproof labels-needed --kappa 0.35 --minority 0.15 # a rare failure label
|
|
108
|
+
judgeproof labels-needed --pilot labels.csv # from the labels you already have
|
|
109
|
+
```
|
|
110
|
+
|
|
111
|
+
```
|
|
112
|
+
labels median 95% CI width on kappa (middle half of runs)
|
|
113
|
+
100 0.26 (0.25 to 0.28)
|
|
114
|
+
200 0.18 (0.17 to 0.20)
|
|
115
|
+
400 0.13 (0.12 to 0.13)
|
|
116
|
+
|
|
117
|
+
for a CI width of 0.20 (+/- 0.10): about 170 labels (width ~= 2.60 / sqrt(n))
|
|
118
|
+
```
|
|
119
|
+
|
|
120
|
+
The rare-label case needs about 700 labels for the same width.
|
|
121
|
+
|
|
122
|
+
### 3. Did the judge see what it grades?
|
|
123
|
+
|
|
124
|
+
You need two files:
|
|
125
|
+
|
|
126
|
+
- **The agent run**, as OpenAI-style chat messages, the format most agent frameworks export.
|
|
127
|
+
- **What the judge received.** This is the request body your judge was sent (`.json`), or its rendered prompt (`.txt`).
|
|
128
|
+
|
|
129
|
+
```bash
|
|
130
|
+
judgeproof input check --run run.json --packet judge_request.json
|
|
131
|
+
```
|
|
132
|
+
|
|
133
|
+
```
|
|
134
|
+
Obligation 1: required content survives rendering (1 judge packet(s))
|
|
135
|
+
[PASS] user message (step 1): present
|
|
136
|
+
[FAIL] tool name 'lookup_order' (step 2): missing: 'lookup_order'
|
|
137
|
+
[FAIL] arguments of 'lookup_order' (step 2): missing: 'ACCT-90517'
|
|
138
|
+
[FAIL] result of 'lookup_order' (step 3): 9% of it
|
|
139
|
+
...
|
|
140
|
+
[FAIL] blank step: step 2: assistant step with only tool calls reached the judge with none of them
|
|
141
|
+
Obligation 3: a failed check blocks later use
|
|
142
|
+
BLOCK: 7 check(s) failed; exit 1 so the pipeline stops before using the judge
|
|
143
|
+
```
|
|
144
|
+
|
|
145
|
+
**No request log?** Do a dry run with `judgeproof capture`. It's a local fake judge that speaks the OpenAI API, saves every request it gets, and answers "pass". Point your eval tool's judge base URL at it:
|
|
146
|
+
|
|
147
|
+
```bash
|
|
148
|
+
judgeproof capture --port 8765 --out captures # then use http://127.0.0.1:8765/my-tool/v1 as the judge's base URL
|
|
149
|
+
judgeproof input check --run run.json --packet captures/my-tool/0001-chat_completions.request.json
|
|
150
|
+
```
|
|
151
|
+
|
|
152
|
+
The checks follow the four input-assurance obligations in Xia et al., [*Does the Judge See What the Evaluation Requires?*](https://arxiv.org/abs/2611.02676) (2026):
|
|
153
|
+
|
|
154
|
+
| Obligation | Command |
|
|
155
|
+
|---|---|
|
|
156
|
+
| 1. Required content survives rendering | `input check` |
|
|
157
|
+
| 2. Each check covers what its criterion needs | `input check --spec spec.json` ([example](https://github.com/woqsi/judgeproof/blob/main/examples/five-tools/checker/example/spec.json)) |
|
|
158
|
+
| 3. A failed check blocks later use | exit code 1 |
|
|
159
|
+
| 4. The judge reads the same bytes that were checked | `input check --manifest m.json`, then `input verify --manifest m.json --packet sent.json` |
|
|
160
|
+
|
|
161
|
+
### 4. Does a pairwise judge prefer whichever answer comes first?
|
|
162
|
+
|
|
163
|
+
Run your pairwise judge twice per item, swapping the order. Record the winner by name (A, B or tie) both times:
|
|
164
|
+
|
|
165
|
+
```csv
|
|
166
|
+
id,verdict_ab,verdict_ba
|
|
167
|
+
q1,A,A
|
|
168
|
+
q2,A,B
|
|
169
|
+
```
|
|
170
|
+
|
|
171
|
+
```bash
|
|
172
|
+
judgeproof position-bias swaps.csv --max-flip-rate 0.1
|
|
173
|
+
```
|
|
174
|
+
|
|
175
|
+
This prints the flip rate with a CI, and how often the judge picked the answer shown first (50% means no preference). On MT-Bench, GPT-4's verdict changed on 15.8% of items when the answers swapped.
|
|
176
|
+
|
|
177
|
+
## In CI
|
|
178
|
+
|
|
179
|
+
Use the GitHub Action. It fails the step whenever judgeproof exits non-zero:
|
|
180
|
+
|
|
181
|
+
```yaml
|
|
182
|
+
- uses: woqsi/judgeproof@v0
|
|
183
|
+
with:
|
|
184
|
+
args: agreement evals/labels.csv --min-kappa 0.6 --min-recall fail=0.8
|
|
185
|
+
```
|
|
186
|
+
|
|
187
|
+
A full workflow is in [`examples/ci/judgeproof.yml`](https://github.com/woqsi/judgeproof/blob/main/examples/ci/judgeproof.yml). On any other CI, run `pip install judgeproof` and call the CLI. Exit codes:
|
|
188
|
+
|
|
189
|
+
| Code | Meaning |
|
|
190
|
+
|---|---|
|
|
191
|
+
| 0 | Passed |
|
|
192
|
+
| 1 | A check failed |
|
|
193
|
+
| 2 | Bad input |
|
|
194
|
+
|
|
195
|
+
## What it can't do
|
|
196
|
+
|
|
197
|
+
- **`input check` searches for text.** It can tell that the judge was shown the policy. It can't tell whether the judge understood it.
|
|
198
|
+
- **Agreement is only as good as your labels.** One labeler per item is noisier than a majority vote. Expect your numbers to sit closer to the per-vote figures in [examples/mt-bench](https://github.com/woqsi/judgeproof/blob/main/examples/mt-bench/RESULTS.md).
|
|
199
|
+
- **Small samples with a rare label give optimistic CIs.** Below about 100 labels with a label rarer than about 20%, a 95% CI covers the truth less often than 95% of the time. `labels-needed` warns you.
|
|
200
|
+
|
|
201
|
+
## Examples
|
|
202
|
+
|
|
203
|
+
| Folder | What it is |
|
|
204
|
+
|---|---|
|
|
205
|
+
| [`examples/mt-bench`](https://github.com/woqsi/judgeproof/tree/main/examples/mt-bench/) | A reproduction of the MT-Bench judge-agreement study: 12 of 12 published cells reproduced, the accuracy trap, labels needed, and position bias. The data is hash-checked, and one script rebuilds every number |
|
|
206
|
+
| [`examples/five-tools`](https://github.com/woqsi/judgeproof/tree/main/examples/five-tools/) | One agent run sent through DeepEval, Inspect, promptfoo, Opik and Phoenix, with the exact judge requests each tool sent. They double as ready-made fixtures for `input check` |
|
|
207
|
+
| [`examples/real-judge`](https://github.com/woqsi/judgeproof/tree/main/examples/real-judge/) | The follow-up: 40 agent runs graded by a real OpenAI judge, with and without the tool calls and with reasoning off and on, to see whether hiding them changes the grade |
|
|
208
|
+
| [`examples/ci`](https://github.com/woqsi/judgeproof/tree/main/examples/ci/) | A GitHub Actions workflow that gates on judge checks |
|
|
209
|
+
|
|
210
|
+
## Roadmap
|
|
211
|
+
|
|
212
|
+
We add checks as we test them. Planned next:
|
|
213
|
+
|
|
214
|
+
- captures from Langfuse and Braintrust
|
|
215
|
+
- judge drift between model versions
|
|
216
|
+
- more agent-run formats, such as OpenTelemetry GenAI spans
|
|
217
|
+
|
|
218
|
+
Ideas and bug reports are welcome in [issues](https://github.com/woqsi/judgeproof/issues).
|
|
219
|
+
|
|
220
|
+
## About
|
|
221
|
+
|
|
222
|
+
judgeproof is built and maintained by [Woq](https://woq.si), which helps AI teams build evals they can trust. MIT licensed.
|
|
223
|
+
|
|
224
|
+
If you use the MT-Bench example, cite the data: Zheng et al. 2023, *Judging LLM-as-a-Judge with MT-Bench and Chatbot Arena* (CC-BY-4.0).
|
|
@@ -0,0 +1,195 @@
|
|
|
1
|
+
# judgeproof
|
|
2
|
+
|
|
3
|
+
**Checks for your evals.** Prove your LLM judge agrees with your humans and sees what it needs, and fail CI when it doesn't.
|
|
4
|
+
|
|
5
|
+
[](https://github.com/woqsi/judgeproof/actions/workflows/ci.yml)
|
|
6
|
+
[](https://pypi.org/project/judgeproof/)
|
|
7
|
+
[](https://github.com/woqsi/judgeproof/blob/main/LICENSE)
|
|
8
|
+
|
|
9
|
+
Most eval tools help you *write* evals. judgeproof checks whether you can trust the judge that scores them.
|
|
10
|
+
|
|
11
|
+
- **Agreement.** Point it at a CSV of human and judge labels. You get agreement and Cohen's kappa with confidence intervals, plus per-label recall, so a judge that never catches the rare failure can't hide behind 87% accuracy.
|
|
12
|
+
- **Input.** Point it at an agent run and at what the judge actually received. It tells you whether the judge saw the tool calls, arguments and results it was asked to grade.
|
|
13
|
+
|
|
14
|
+
Every check exits non-zero when it fails, so it can gate a pull request. judgeproof works alongside DeepEval, Inspect, promptfoo, Opik, Phoenix, Langfuse and the rest; it doesn't replace them.
|
|
15
|
+
|
|
16
|
+
```bash
|
|
17
|
+
pip install judgeproof
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
Python 3.10+. The only dependency is numpy.
|
|
21
|
+
|
|
22
|
+
## Why
|
|
23
|
+
|
|
24
|
+
What we found when we tested this ourselves (full write-ups in [`examples/`](https://github.com/woqsi/judgeproof/tree/main/examples/)):
|
|
25
|
+
|
|
26
|
+
- **High agreement can hide a judge that misses what matters.** On 984 MT-Bench items, GPT-4 agreed with expert raters 87.4% of the time. When the question became "did the weaker model win?", a judge that *always* said "no" scored 85.0%. GPT-4 caught only 29% of the upsets the experts saw. Kappa and per-label recall show this; raw agreement doesn't. ([examples/mt-bench](https://github.com/woqsi/judgeproof/tree/main/examples/mt-bench/))
|
|
27
|
+
- **Your judge may never see the tool calls.** We sent one agent run through five popular eval tools' agent-judging features. In three of eleven routes, the judge was asked whether the agent's promise matched the policy it looked up, without ever being shown that policy. ([examples/five-tools](https://github.com/woqsi/judgeproof/tree/main/examples/five-tools/))
|
|
28
|
+
- **And it changes the grade.** We had a real OpenAI judge grade 40 support-bot runs through Inspect, with and without the tool calls. Without them, it failed every correct reply that promised a credit, because it couldn't check the policy, and turning reasoning on made it pass more wrong replies (23 of 72, up from 10). With the tool calls but reasoning off, the small judge still passed about a third of wrong credit offers; with reasoning on it passed none. ([examples/real-judge](https://github.com/woqsi/judgeproof/tree/main/examples/real-judge/))
|
|
29
|
+
|
|
30
|
+
## Quick start
|
|
31
|
+
|
|
32
|
+
### 1. Does the judge agree with your humans?
|
|
33
|
+
|
|
34
|
+
Give it a CSV with one row per labeled example. Labels can be any strings: pass/fail, 1–5, good/ok/bad.
|
|
35
|
+
|
|
36
|
+
```csv
|
|
37
|
+
id,human,judge
|
|
38
|
+
t-001,pass,pass
|
|
39
|
+
t-002,fail,pass
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
```bash
|
|
43
|
+
judgeproof agreement labels.csv
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
```
|
|
47
|
+
== all rows ==
|
|
48
|
+
rows: 984 (distinct ids: 984)
|
|
49
|
+
agreement: 87.4% (95% CI 85.2% to 89.4%)
|
|
50
|
+
Cohen's kappa: 0.352 (95% CI 0.266 to 0.437)
|
|
51
|
+
a judge that always says 'stronger': agreement 85.0%, kappa 0
|
|
52
|
+
|
|
53
|
+
confusion matrix (rows: human, columns: judge)
|
|
54
|
+
stronger weaker
|
|
55
|
+
stronger 817 19
|
|
56
|
+
weaker 105 43
|
|
57
|
+
|
|
58
|
+
per label: precision = when the judge says it, how often the human agrees;
|
|
59
|
+
recall = when the human says it, how often the judge agrees
|
|
60
|
+
stronger precision 88.6% recall 97.7% (human 836, judge 922)
|
|
61
|
+
weaker precision 69.4% recall 29.1% (human 148, judge 62)
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
To gate CI, add thresholds. This fails (exit 1) when the lower end of kappa's CI is under 0.6, or when the judge catches under 80% of the failures your humans found:
|
|
65
|
+
|
|
66
|
+
```bash
|
|
67
|
+
judgeproof agreement labels.csv --min-kappa 0.6 --min-recall fail=0.8
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
Other options: `--group category` repeats the report per group, and `--json report.json` saves everything.
|
|
71
|
+
|
|
72
|
+
### 2. How many labels do you need?
|
|
73
|
+
|
|
74
|
+
With too few labels, kappa's confidence interval is too wide to tell a good judge from a bad one. Plan before you label:
|
|
75
|
+
|
|
76
|
+
```bash
|
|
77
|
+
judgeproof labels-needed --kappa 0.75 --minority 0.46 # balanced labels
|
|
78
|
+
judgeproof labels-needed --kappa 0.35 --minority 0.15 # a rare failure label
|
|
79
|
+
judgeproof labels-needed --pilot labels.csv # from the labels you already have
|
|
80
|
+
```
|
|
81
|
+
|
|
82
|
+
```
|
|
83
|
+
labels median 95% CI width on kappa (middle half of runs)
|
|
84
|
+
100 0.26 (0.25 to 0.28)
|
|
85
|
+
200 0.18 (0.17 to 0.20)
|
|
86
|
+
400 0.13 (0.12 to 0.13)
|
|
87
|
+
|
|
88
|
+
for a CI width of 0.20 (+/- 0.10): about 170 labels (width ~= 2.60 / sqrt(n))
|
|
89
|
+
```
|
|
90
|
+
|
|
91
|
+
The rare-label case needs about 700 labels for the same width.
|
|
92
|
+
|
|
93
|
+
### 3. Did the judge see what it grades?
|
|
94
|
+
|
|
95
|
+
You need two files:
|
|
96
|
+
|
|
97
|
+
- **The agent run**, as OpenAI-style chat messages, the format most agent frameworks export.
|
|
98
|
+
- **What the judge received.** This is the request body your judge was sent (`.json`), or its rendered prompt (`.txt`).
|
|
99
|
+
|
|
100
|
+
```bash
|
|
101
|
+
judgeproof input check --run run.json --packet judge_request.json
|
|
102
|
+
```
|
|
103
|
+
|
|
104
|
+
```
|
|
105
|
+
Obligation 1: required content survives rendering (1 judge packet(s))
|
|
106
|
+
[PASS] user message (step 1): present
|
|
107
|
+
[FAIL] tool name 'lookup_order' (step 2): missing: 'lookup_order'
|
|
108
|
+
[FAIL] arguments of 'lookup_order' (step 2): missing: 'ACCT-90517'
|
|
109
|
+
[FAIL] result of 'lookup_order' (step 3): 9% of it
|
|
110
|
+
...
|
|
111
|
+
[FAIL] blank step: step 2: assistant step with only tool calls reached the judge with none of them
|
|
112
|
+
Obligation 3: a failed check blocks later use
|
|
113
|
+
BLOCK: 7 check(s) failed; exit 1 so the pipeline stops before using the judge
|
|
114
|
+
```
|
|
115
|
+
|
|
116
|
+
**No request log?** Do a dry run with `judgeproof capture`. It's a local fake judge that speaks the OpenAI API, saves every request it gets, and answers "pass". Point your eval tool's judge base URL at it:
|
|
117
|
+
|
|
118
|
+
```bash
|
|
119
|
+
judgeproof capture --port 8765 --out captures # then use http://127.0.0.1:8765/my-tool/v1 as the judge's base URL
|
|
120
|
+
judgeproof input check --run run.json --packet captures/my-tool/0001-chat_completions.request.json
|
|
121
|
+
```
|
|
122
|
+
|
|
123
|
+
The checks follow the four input-assurance obligations in Xia et al., [*Does the Judge See What the Evaluation Requires?*](https://arxiv.org/abs/2611.02676) (2026):
|
|
124
|
+
|
|
125
|
+
| Obligation | Command |
|
|
126
|
+
|---|---|
|
|
127
|
+
| 1. Required content survives rendering | `input check` |
|
|
128
|
+
| 2. Each check covers what its criterion needs | `input check --spec spec.json` ([example](https://github.com/woqsi/judgeproof/blob/main/examples/five-tools/checker/example/spec.json)) |
|
|
129
|
+
| 3. A failed check blocks later use | exit code 1 |
|
|
130
|
+
| 4. The judge reads the same bytes that were checked | `input check --manifest m.json`, then `input verify --manifest m.json --packet sent.json` |
|
|
131
|
+
|
|
132
|
+
### 4. Does a pairwise judge prefer whichever answer comes first?
|
|
133
|
+
|
|
134
|
+
Run your pairwise judge twice per item, swapping the order. Record the winner by name (A, B or tie) both times:
|
|
135
|
+
|
|
136
|
+
```csv
|
|
137
|
+
id,verdict_ab,verdict_ba
|
|
138
|
+
q1,A,A
|
|
139
|
+
q2,A,B
|
|
140
|
+
```
|
|
141
|
+
|
|
142
|
+
```bash
|
|
143
|
+
judgeproof position-bias swaps.csv --max-flip-rate 0.1
|
|
144
|
+
```
|
|
145
|
+
|
|
146
|
+
This prints the flip rate with a CI, and how often the judge picked the answer shown first (50% means no preference). On MT-Bench, GPT-4's verdict changed on 15.8% of items when the answers swapped.
|
|
147
|
+
|
|
148
|
+
## In CI
|
|
149
|
+
|
|
150
|
+
Use the GitHub Action. It fails the step whenever judgeproof exits non-zero:
|
|
151
|
+
|
|
152
|
+
```yaml
|
|
153
|
+
- uses: woqsi/judgeproof@v0
|
|
154
|
+
with:
|
|
155
|
+
args: agreement evals/labels.csv --min-kappa 0.6 --min-recall fail=0.8
|
|
156
|
+
```
|
|
157
|
+
|
|
158
|
+
A full workflow is in [`examples/ci/judgeproof.yml`](https://github.com/woqsi/judgeproof/blob/main/examples/ci/judgeproof.yml). On any other CI, run `pip install judgeproof` and call the CLI. Exit codes:
|
|
159
|
+
|
|
160
|
+
| Code | Meaning |
|
|
161
|
+
|---|---|
|
|
162
|
+
| 0 | Passed |
|
|
163
|
+
| 1 | A check failed |
|
|
164
|
+
| 2 | Bad input |
|
|
165
|
+
|
|
166
|
+
## What it can't do
|
|
167
|
+
|
|
168
|
+
- **`input check` searches for text.** It can tell that the judge was shown the policy. It can't tell whether the judge understood it.
|
|
169
|
+
- **Agreement is only as good as your labels.** One labeler per item is noisier than a majority vote. Expect your numbers to sit closer to the per-vote figures in [examples/mt-bench](https://github.com/woqsi/judgeproof/blob/main/examples/mt-bench/RESULTS.md).
|
|
170
|
+
- **Small samples with a rare label give optimistic CIs.** Below about 100 labels with a label rarer than about 20%, a 95% CI covers the truth less often than 95% of the time. `labels-needed` warns you.
|
|
171
|
+
|
|
172
|
+
## Examples
|
|
173
|
+
|
|
174
|
+
| Folder | What it is |
|
|
175
|
+
|---|---|
|
|
176
|
+
| [`examples/mt-bench`](https://github.com/woqsi/judgeproof/tree/main/examples/mt-bench/) | A reproduction of the MT-Bench judge-agreement study: 12 of 12 published cells reproduced, the accuracy trap, labels needed, and position bias. The data is hash-checked, and one script rebuilds every number |
|
|
177
|
+
| [`examples/five-tools`](https://github.com/woqsi/judgeproof/tree/main/examples/five-tools/) | One agent run sent through DeepEval, Inspect, promptfoo, Opik and Phoenix, with the exact judge requests each tool sent. They double as ready-made fixtures for `input check` |
|
|
178
|
+
| [`examples/real-judge`](https://github.com/woqsi/judgeproof/tree/main/examples/real-judge/) | The follow-up: 40 agent runs graded by a real OpenAI judge, with and without the tool calls and with reasoning off and on, to see whether hiding them changes the grade |
|
|
179
|
+
| [`examples/ci`](https://github.com/woqsi/judgeproof/tree/main/examples/ci/) | A GitHub Actions workflow that gates on judge checks |
|
|
180
|
+
|
|
181
|
+
## Roadmap
|
|
182
|
+
|
|
183
|
+
We add checks as we test them. Planned next:
|
|
184
|
+
|
|
185
|
+
- captures from Langfuse and Braintrust
|
|
186
|
+
- judge drift between model versions
|
|
187
|
+
- more agent-run formats, such as OpenTelemetry GenAI spans
|
|
188
|
+
|
|
189
|
+
Ideas and bug reports are welcome in [issues](https://github.com/woqsi/judgeproof/issues).
|
|
190
|
+
|
|
191
|
+
## About
|
|
192
|
+
|
|
193
|
+
judgeproof is built and maintained by [Woq](https://woq.si), which helps AI teams build evals they can trust. MIT licensed.
|
|
194
|
+
|
|
195
|
+
If you use the MT-Bench example, cite the data: Zheng et al. 2023, *Judging LLM-as-a-Judge with MT-Bench and Chatbot Arena* (CC-BY-4.0).
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
# Examples
|
|
2
|
+
|
|
3
|
+
| Folder | What it is |
|
|
4
|
+
|---|---|
|
|
5
|
+
| [`mt-bench/`](mt-bench/) | GPT-4 as a judge vs expert raters on MT-Bench: a reproduction of the published agreement tables, the accuracy trap, labels needed, and position bias. Start with [`RESULTS.md`](mt-bench/RESULTS.md) |
|
|
6
|
+
| [`five-tools/`](five-tools/) | What DeepEval, Inspect, promptfoo, Opik and Phoenix actually send to their judge for one agent run. Start with [`RESULTS.md`](five-tools/RESULTS.md) |
|
|
7
|
+
| [`real-judge/`](real-judge/) | Does hiding the tool calls change a real judge's grade? 40 runs graded by a real OpenAI judge through Inspect, with and without the tool calls, and with reasoning off and on. Start with [`RESULTS.md`](real-judge/RESULTS.md) |
|
|
8
|
+
| [`ci/`](ci/) | A GitHub Actions workflow that runs judgeproof checks on every pull request |
|
|
9
|
+
|
|
10
|
+
Both experiments were run by Woq, which sells eval services. Each `RESULTS.md` has a conflicts-of-interest note.
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
# Does the judge see the tool calls? Five eval tools, one agent run
|
|
2
|
+
|
|
3
|
+
We pushed one hand-written support-bot run through the agent-judging features of DeepEval, Inspect, promptfoo, Opik and Arize Phoenix. Each tool's judge was pointed at `judgeproof capture`, which records exactly what the judge received. The findings, tool by tool, are in [`RESULTS.md`](RESULTS.md).
|
|
4
|
+
|
|
5
|
+
- [`captures/`](captures/): the exact judge requests (`*.request.json`), plus readable copies (`*.prompt.txt`).
|
|
6
|
+
- [`run/support_run.json`](run/support_run.json): the agent run.
|
|
7
|
+
|
|
8
|
+
Check any route yourself:
|
|
9
|
+
|
|
10
|
+
```bash
|
|
11
|
+
judgeproof input check --run run/support_run.json --packet captures/inspect-default/0005-chat_completions.request.json
|
|
12
|
+
```
|
|
13
|
+
|
|
14
|
+
To rerun everything (fresh venvs from lock files, about 2 GB of disk, no network calls to any model):
|
|
15
|
+
|
|
16
|
+
```bash
|
|
17
|
+
./run_all.sh
|
|
18
|
+
```
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
# MT-Bench: does GPT-4 agree with expert raters?
|
|
2
|
+
|
|
3
|
+
A reproduction of the judge-agreement study in Zheng et al. 2023, plus what kappa, per-label recall and CI width add to it. The full results are in [`RESULTS.md`](RESULTS.md).
|
|
4
|
+
|
|
5
|
+
Try the package on the data:
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
judgeproof agreement example.csv --group category # A/B labels: kappa 0.75
|
|
9
|
+
judgeproof agreement example_stronger_weaker.csv # same items, "did the weaker model win?": kappa 0.35, recall on upsets 29%
|
|
10
|
+
judgeproof labels-needed --pilot example_stronger_weaker.csv
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
To rebuild every number and chart from the raw data (hash-checked, about 15 seconds after a 1.4 MB download):
|
|
14
|
+
|
|
15
|
+
```bash
|
|
16
|
+
python3 -m venv .venv
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
```bash
|
|
20
|
+
.venv/bin/pip install -r requirements.txt
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
```bash
|
|
24
|
+
.venv/bin/python -I analysis.py
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
Data: `lmsys/mt_bench_human_judgments` (CC-BY-4.0) and FastChat's MT-Bench questions (Apache-2.0). Cite Zheng et al. 2023, "Judging LLM-as-a-Judge with MT-Bench and Chatbot Arena".
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Woq
|
|
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.
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
# Does hiding the tool calls change a real judge's grade?
|
|
2
|
+
|
|
3
|
+
[`../five-tools/`](../five-tools/) recorded *what* five eval tools send their judge. This experiment asks whether it matters. We built 40 support-bot runs: 16 correct replies and 24 deliberately wrong ones. A real OpenAI judge graded every run through Inspect's `model_graded_qa`, both on default settings (question and final reply only) and with `include_history=True` (tool calls and results too). The small judge (gpt-5.4-mini) ran with reasoning off and with `reasoning_effort="medium"`; gpt-5.4 checked the full-history case.
|
|
4
|
+
|
|
5
|
+
The findings, the judge's own words, the cost ($1.82 at OpenAI's list prices) and the limits are in [`RESULTS.md`](RESULTS.md). The per-category table is in [`results_table.md`](results_table.md).
|
|
6
|
+
|
|
7
|
+
What's here:
|
|
8
|
+
- `build_runs.py` → `runs.json`: the 40 runs, built from templates around `article.txt`.
|
|
9
|
+
- `run_judge.py`: grades the runs through Inspect, with a cost cap (`--max-usd`).
|
|
10
|
+
- `logs/`: the Inspect logs of every grading.
|
|
11
|
+
- `analyze.py` → `results.json`, `results_table.md`.
|
|
12
|
+
- `rule_check.py`: the same rules checked in plain code, with no judge.
|
|
13
|
+
|
|
14
|
+
To rerun the analysis from the saved logs (no API key needed):
|
|
15
|
+
|
|
16
|
+
```bash
|
|
17
|
+
python3.11 -m venv .venv
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
```bash
|
|
21
|
+
.venv/bin/python -I -m pip install -r requirements.lock.txt
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
```bash
|
|
25
|
+
.venv/bin/python -I analyze.py
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
Re-grading needs an OpenAI API key, either in `OPENAI_API_KEY` or in a file named by `ENV_FILE`. See "Rerun" in `RESULTS.md`.
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
[build-system]
|
|
2
|
+
requires = ["hatchling>=1.25"]
|
|
3
|
+
build-backend = "hatchling.build"
|
|
4
|
+
|
|
5
|
+
[project]
|
|
6
|
+
name = "judgeproof"
|
|
7
|
+
dynamic = ["version"]
|
|
8
|
+
description = "Checks for your evals: prove your LLM judge agrees with your humans and sees what it needs, and fail CI when it doesn't."
|
|
9
|
+
readme = "README.md"
|
|
10
|
+
license = "MIT"
|
|
11
|
+
license-files = ["LICENSE"]
|
|
12
|
+
authors = [{ name = "Woq", email = "hello@woq.si" }]
|
|
13
|
+
requires-python = ">=3.10"
|
|
14
|
+
dependencies = ["numpy>=1.24"]
|
|
15
|
+
keywords = ["llm", "evals", "llm-as-a-judge", "cohen-kappa", "agents", "ci", "evaluation"]
|
|
16
|
+
classifiers = [
|
|
17
|
+
"Development Status :: 3 - Alpha",
|
|
18
|
+
"Environment :: Console",
|
|
19
|
+
"Intended Audience :: Developers",
|
|
20
|
+
"Intended Audience :: Science/Research",
|
|
21
|
+
"Operating System :: OS Independent",
|
|
22
|
+
"Programming Language :: Python :: 3",
|
|
23
|
+
"Programming Language :: Python :: 3 :: Only",
|
|
24
|
+
"Topic :: Scientific/Engineering :: Artificial Intelligence",
|
|
25
|
+
"Topic :: Software Development :: Quality Assurance",
|
|
26
|
+
"Topic :: Software Development :: Testing",
|
|
27
|
+
]
|
|
28
|
+
|
|
29
|
+
[project.optional-dependencies]
|
|
30
|
+
dev = ["pytest>=8", "ruff>=0.6"]
|
|
31
|
+
|
|
32
|
+
[project.scripts]
|
|
33
|
+
judgeproof = "judgeproof.cli:main"
|
|
34
|
+
|
|
35
|
+
[project.urls]
|
|
36
|
+
Homepage = "https://github.com/woqsi/judgeproof"
|
|
37
|
+
Source = "https://github.com/woqsi/judgeproof"
|
|
38
|
+
Issues = "https://github.com/woqsi/judgeproof/issues"
|
|
39
|
+
Changelog = "https://github.com/woqsi/judgeproof/blob/main/CHANGELOG.md"
|
|
40
|
+
|
|
41
|
+
[tool.hatch.version]
|
|
42
|
+
path = "src/judgeproof/__init__.py"
|
|
43
|
+
|
|
44
|
+
[tool.hatch.build.targets.sdist]
|
|
45
|
+
include = ["src", "tests", "README.md", "CHANGELOG.md", "LICENSE"]
|
|
46
|
+
|
|
47
|
+
[tool.pytest.ini_options]
|
|
48
|
+
testpaths = ["tests"]
|
|
49
|
+
|
|
50
|
+
[tool.ruff]
|
|
51
|
+
line-length = 125
|
|
52
|
+
target-version = "py310"
|
|
53
|
+
extend-exclude = ["examples"]
|
|
54
|
+
|
|
55
|
+
[tool.ruff.lint]
|
|
56
|
+
select = ["E", "F", "W", "I", "B", "UP"]
|
|
57
|
+
ignore = ["UP006", "UP007", "UP035", "B905"]
|