judgemeter
Measure how far an LLM judge can be trusted before you rely on its scores.
LLM-as-a-judge is everywhere in evaluation pipelines, but the judge itself is rarely checked. judgemeter answers three questions about any judge, whatever framework or model it uses:
| Check | Question it answers |
|---|---|
| Human agreement | Does the judge label things the way people do? (Cohen's kappa, with a confidence interval) |
| Position bias | Does the judge's pick change when only the order of the answers changes? |
| Self-consistency | Does the judge give the same answer when asked the same thing again? |
It has no dependencies and works with any judge you can wrap in a Python function.
Install
pip install judgemeter
Quick start
Agreement with human labels
from judgemeter import agreement
judge = ["pass", "fail", "pass", "pass", "fail", "pass"]
human = ["pass", "fail", "fail", "pass", "fail", "pass"]
result = agreement(judge, human, bootstrap=1000)
print(result.kappa, result.kappa_ci, result.interpretation)
# 0.667 (0.0, 1.0) substantial
For ordinal scores (for example 1 to 5), use weighted kappa so near misses count less than big misses:
agreement(judge_scores, human_scores, weights="quadratic")
agreement(judge, human, labels=["bad", "ok", "good"], weights="linear")
result.disagreements lists the item indexes where the judge and the human differ, which is usually the most useful thing to read next.
Position bias
Wrap your judge as a function that takes the candidates in the order shown and returns the index of the one it picks:
from judgemeter import position_bias
def my_judge(candidates):
prompt = build_prompt(question, candidates) # your prompt
reply = call_llm(prompt) # your model
return parse_choice(reply) # 0, 1, ...
result = position_bias(my_judge, dataset_of_answer_pairs)
print(result.consistency) # 1.0 = same winner in every ordering
print(result.first_position_win_rate) # vs result.expected_first_position_rate
print(result.p_value) # exact binomial test against chance
Each set of candidates is shown in every cyclic order (A-B and B-A for pairs), so every candidate appears once in each position. A judge that ignores order scores a consistency of 1.0. A judge that always picks the first answer scores 1/n and wins 100% of the time from the first position.
Self-consistency
from judgemeter import self_consistency_many
report = self_consistency_many(lambda item: my_grader(item), items, runs=5)
print(report.agreement, report.stable_share, report.unstable_items)
One report
from judgemeter import ReliabilityReport
report = ReliabilityReport(
judge_name="my judge",
agreement=agreement_result,
position=position_result,
consistency=consistency_report,
)
print(report.to_markdown()) # or report.to_json()
## Judge reliability: simulated judge
### Agreement with human labels
| Metric | Value |
| --- | --- |
| Items | 200 |
| Percent agreement | 92.0% |
| Cohen's kappa | 0.836 (95% CI 0.754 to 0.908) |
| Interpretation | almost perfect |
### Position bias
| Metric | Value |
| --- | --- |
| Items | 100 (200 comparisons) |
| Mean consistency across orderings | 82.5% |
| Items with the same winner in every ordering | 65.0% |
| First-position win rate | 67.5% (chance: 50.0%) |
| p-value vs chance | < 0.001 |
### Self-consistency
| Metric | Value |
| --- | --- |
| Items | 50 |
| Mean agreement across repeated runs | 92.8% |
| Items with identical answers every run | 76.0% |
That output comes from examples/demo.py, which simulates a judge that agrees with humans most of the time but picks the first answer on close calls. Run it with python examples/demo.py; no API key needed.
Command line
Check a labelled CSV, for example in CI:
judgemeter agreement examples/labels.csv --judge judge_label --human human_label
Items: 200
Percent agreement: 92.0%
Cohen's kappa: 0.836 (almost perfect), 95% CI 0.754 to 0.908
| Option | Description |
|---|---|
--weights linear|quadratic |
Weighted kappa for ordinal labels |
--labels bad,ok,good |
Label order for weighted kappa |
--bootstrap N |
Resamples for the confidence interval (default 1000, 0 to skip) |
--format text|markdown|json |
Output format |
--min-kappa 0.6 |
Exit with status 1 if kappa is below the value |
Rows with an empty judge or human label are skipped and counted.
How the numbers are computed
- Cohen's kappa is
1 - observed_disagreement / expected_disagreement, with disagreement weights of 0/1 (unweighted),|i-j|/(k-1)(linear) or its square (quadratic). Results matchsklearn.metrics.cohen_kappa_score. Kappa is undefined (nan) when both raters used a single, identical label for every item. - Confidence interval is a percentile bootstrap over items. It is seeded, so results are reproducible.
- Interpretation uses the Landis & Koch (1977) bands: slight, fair, moderate, substantial, almost perfect.
- Position p-value is an exact two-sided binomial test of first-position wins against
1/n. It is only reported when every item has the same number of candidates. - Self-consistency entropy is normalised to 0 (always the same answer) to 1 (answers split evenly).
Development
git clone https://github.com/aman-singh01/judgemeter
cd judgemeter
pip install -e ".[dev]"
pytest --cov=judgemeter
ruff check . && ruff format --check .
Roadmap
- Async judges, so orderings and repeats run concurrently
- Krippendorff's alpha for more than two raters
- Adapters for DeepEval and other eval frameworks
License
MIT
Metadata
Release files for judgemeter 0.1.0
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 |
|---|---|---|---|---|
| judgemeter-0.1.0.tar.gz | 15.9 kB | With provenance | Details for judgemeter-0.1.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| judgemeter-0.1.0-py3-none-any.whl | Python 3 | none | any | Details for judgemeter-0.1.0-py3-none-any.whl |
Total release size: 30.5 kB
Release files / judgemeter-0.1.0.tar.gz
| Download URL | judgemeter-0.1.0.tar.gz |
|---|---|
| Size | 15.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
9ad4b46c9c9f92a67aac2d18d62d1d12caaa1c05bd28a4b29017034bbeed5aba
|
|
BLAKE2b-256 checksum How to use checksums |
296fdcf2bb93349c29761c09768c666025002056ad79476be0ef87d96955daff
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
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.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 27, 2026.
Transparency logRelease files / judgemeter-0.1.0-py3-none-any.whl
| Download URL | judgemeter-0.1.0-py3-none-any.whl |
|---|---|
| Size | 14.5 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
d76c925b55e9c89d618be28eab14d7849a196589525cf3eeee2103a55b5e310a
|
|
BLAKE2b-256 checksum How to use checksums |
3f3525cc3499ab7f8bea90017fd65eb545828cc64d0dc978c3dd0b67edef4203
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
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.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 27, 2026.
Transparency logSecurity for judgemeter 0.1.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.
Full provenance
Both files in this release have been uploaded with provenance metadata.
Attestation for judgemeter-0.1.0.tar.gz
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 27, 2026.
Transparency logA 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.