Skip to main content

llm-judge-agreement

Check an LLM judge against human labels before you let it gate a release.

You give it one row per test case with your label and the judge's label. It tells you how many real failures the judge caught (TPR) and how many good outputs it passed (TNR), each with a 95% interval, plus raw agreement and Cohen's kappa. For rows the judge graded on its own, it corrects the judge's pass rate for the error rates it just measured.

No dependencies. Python 3.9 or later.

pip install llm-judge-agreement
llm-judge-agreement --demo

Use it

Make a CSV with three columns:

case_id,human_label,judge_label
refund-001,fail,fail
refund-002,pass,pass
refund-003,,pass

Each label is pass or fail. Leave human_label blank for rows the judge graded alone. Labelled rows must come from a test split you never used to write the judge's prompt, or the numbers flatter the judge.

llm-judge-agreement labels.csv
labelled rows: 120 (human labels: 40 fail, 80 pass)
              judge fail  judge pass
human fail            30          10
human pass             2          78
TPR, failures caught:     30/40 = 75.0% (59.8-85.8)  bar 80% at the lower end: missed
TNR, good outputs passed: 78/80 = 97.5% (91.3-99.3)  bar 90% at the lower end: met
raw agreement:            108/120 = 90.0%
Cohen's kappa:            0.763
judge-only rows: 400
judge's raw pass rate:    320/400 = 80.0% (75.8-83.6)
corrected pass rate:      75.9% (67.3-84.1)
decision: the judge missed a bar; don't let it gate a release yet

A bar is met when the lower end of the interval reaches it, so a judge can't pass on a lucky handful of labels. The defaults are 80% for TPR and 90% for TNR. Agree your own before the run and set them with --min-tpr and --min-tnr.

Options:

  • --json prints the result as JSON, for CI.
  • - reads the CSV from standard input.
  • Exit status is 0 when the judge meets both bars, 1 when it misses one and 2 when the input can't be used, so a CI step fails on its own.

From Python:

from llm_judge_agreement import analyse, format_report

result = analyse(rows, min_tpr=0.8, min_tnr=0.9)  # rows: dicts with case_id, human_label, judge_label
print(format_report(result))

The method

The intervals are Wilson score intervals. The corrected pass rate is the Rogan-Gladen estimator, with the adjusted interval from Lee et al., arXiv:2511.21140. Raw agreement and kappa are reported, but the decision rests on TPR and TNR, because a judge can agree 90% of the time and still miss a quarter of real failures, as the example shows.

The full method, including how many cases to label, how to split them and what to do when a judge misses its bar, is in How to calibrate an LLM as a judge for agent evals, a guide by Volans Aquilae.

Licence

MIT.

Metadata

Release files for llm-judge-agreement 1.0.0

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

Source distribution (sdist)

Source distribution for llm-judge-agreement 1.0.0
File Size Uploaded Provenance Actions
llm_judge_agreement-1.0.0.tar.gz 6.9 kB Without provenance Details for llm_judge_agreement-1.0.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for llm-judge-agreement 1.0.0
File Interpreter ABI Platform Actions
llm_judge_agreement-1.0.0-py3-none-any.whl Python 3 none any Details for llm_judge_agreement-1.0.0-py3-none-any.whl

Total release size: 14.6 kB

Release files / llm_judge_agreement-1.0.0.tar.gz

Download URL llm_judge_agreement-1.0.0.tar.gz
Size 6.9 kB
Tags Source
SHA-256 checksum
How to use checksums
360fad20b5ec280bf5f08252295e7c49b36bea67bee6edf51f6ae05c0cf51ac4
BLAKE2b-256 checksum
How to use checksums
430a0603d0e8513cf51b269983cd3f621bf33b3dea582caa1aa7095522bbd908
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.10

Release files / llm_judge_agreement-1.0.0-py3-none-any.whl

Download URL llm_judge_agreement-1.0.0-py3-none-any.whl
Size 7.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
df1b20fa9e5a3dd9c3d8b01f80c6f397b99479420b94c5954aae02346965db7c
BLAKE2b-256 checksum
How to use checksums
b80ba958f6204bb5928f63c2b7c8cf99674cd968feaf15e7fff48d1604779cae
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.10

Security for llm-judge-agreement 1.0.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.

Release history Release notifications | RSS feed

This release

1.0.0 This release

2 release files No provenance

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