eval-flake-detector
Detect flaky LLM eval cases across repeated runs. Computes per-case pass rate, standard deviation, and a flakiness severity ("stable" / "low" / "medium" / "high"). Pure stdlib, zero runtime dependencies.
Python port of @mukundakatta/eval-flake-detector. The JS-compatible shape is exposed as detect_eval_flakes so existing dashboards keep working.
Install
pip install eval-flake-detector
Usage
from eval_flake_detector import detect
# One inner list per case; entries are repeat results.
runs = [
[True, True, True, True, True], # case 0: stable pass
[False, False, False, False, False], # case 1: stable fail
[True, False, True, False, True, False], # case 2: flaky 50/50
]
report = detect(runs, flaky_low=0.1, flaky_high=0.9, min_runs=3)
report.stable # False -- case 2 is flaky
for case in report.flakes:
print(case.case_id, case.pass_rate, case.std_dev, case.severity)
# case-2 0.5 0.5 high
Already have a flat list of result dicts (one row per repeat)? Pass that
directly -- it's auto-grouped by id:
runs = [
{"id": "math-1", "passed": True},
{"id": "math-1", "passed": False},
{"id": "math-1", "passed": True},
{"id": "lookup-2", "score": 0.95},
{"id": "lookup-2", "score": 1.00},
]
detect(runs)
Severity bands
| Band | Meaning |
|---|---|
stable |
Pass rate is outside the ambiguous band -- consistently passes or consistently fails. |
low |
In band, std_dev < 0.30. Probably noise; revisit prompt. |
medium |
In band, 0.30 <= std_dev < 0.45. Real flakiness; investigate. |
high |
In band, std_dev >= 0.45. Behaves randomly; consider redesigning the eval. |
JS-compat output
from eval_flake_detector import detect_eval_flakes
# Same shape as the JS sibling: {"stable": bool, "flakes": [{"id", "count", "stddev"}]}
detect_eval_flakes(runs, max_stddev=0.2)
See the JS sibling's README for the original design notes.
Metadata
Release files for eval-flake-detector 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 |
|---|---|---|---|---|
| eval_flake_detector-0.1.0.tar.gz | 7.1 kB | Without provenance | Details for eval_flake_detector-0.1.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| eval_flake_detector-0.1.0-py3-none-any.whl | Python 3 | none | any | Details for eval_flake_detector-0.1.0-py3-none-any.whl |
Total release size: 14.3 kB
Release files / eval_flake_detector-0.1.0.tar.gz
| Download URL | eval_flake_detector-0.1.0.tar.gz |
|---|---|
| Size | 7.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
be89c2e4e8e2ad7fb13983350ce88676c9c3fc6c0fa70605332a80f172d23aea
|
|
BLAKE2b-256 checksum How to use checksums |
5f1c2d5dee57b4f6b5880fb4764f77932ced94d6a8ad2ee9c5c7f0af2c2a4ad3
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.14.4
|
Release files / eval_flake_detector-0.1.0-py3-none-any.whl
| Download URL | eval_flake_detector-0.1.0-py3-none-any.whl |
|---|---|
| Size | 7.2 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
41868159e4cfb2bcba474726b7b24f958e656d38be9330d00e64245c779b844a
|
|
BLAKE2b-256 checksum How to use checksums |
355e036450eaaac30603382a7703c0f5a584bf951bf689c84ebaf0f062d7810b
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.14.4
|
Security for eval-flake-detector 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.
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.