Skip to main content

passgate

Pass once is luck. Pass^N is a gate. A statistical reliability gate for LLM evals: a candidate must clear a Wilson-bound pass bar on every evaluation round, not just on average — then optionally prove it beats your baseline.

Eval flakiness is the quiet killer: a prompt scores 91% once, ships, and regresses. Averaging hides the weak round. passgate requires each round's conservative pass-rate estimate (the lower bound of the Wilson score interval) to clear your bar, so a candidate that needs 3 good rounds to ship must produce 3 good rounds.

Install

pip install passgate

Also runnable as python -m passgate .... Python 3.9+, no dependencies.

The gate

passgate gate rounds.json --threshold 0.9 --min-rounds 3

rounds.json (or .csv) holds one entry per round:

[
  { "label": "baseline-eval-set", "trials": 100, "passes": 93 },
  { "label": "adversarial-set",   "trials": 100, "passes": 95 },
  { "label": "regression-set",    "trials": 120, "passes": 116 }
]

Output is a per-round scoreboard and a verdict; exit code 1 fails CI:

passgate: 2/3 round(s) clear Wilson-lower >= 0.900 (95% confidence, min 3 rounds)
         PASS round 1: 93/100 = 0.930 (lower 0.863)
         FAIL round 2: 70/100 = 0.700 (lower 0.604)
verdict: FAIL

Note what the gate does: 93/100 does not certify ≥ 0.9 at 95% confidence with 100 trials — you need more data or a lower bar. That is the point: the bar scales with evidence, not vibes. Add --json for machines.

Candidate vs baseline

passgate compare --candidate 93/100 --candidate 95/100 \
                 --baseline  85/100 --baseline  88/100

Pooled two-proportion z-test with a one-sided p-value, plus Fisher's exact p (exact hypergeometric enumeration — right for small rounds where the normal approximation lies). Exit 0 only when the improvement is statistically significant at --alpha (default 0.05).

Python API

from passgate import Round, evaluate_rounds, compare

result = evaluate_rounds(
    [Round(trials=100, passes=93), Round(trials=100, passes=95)],
    threshold=0.9, confidence=0.95, min_rounds=2,
)
assert result.passed, str(result)

cmp = compare([Round(100, 93)], [Round(100, 85)])
print(cmp.verdict)  # candidate-better | baseline-better | inconclusive

CI

- run: pip install passgate
- run: python run_evals.py --out rounds.json   # your eval runner
- run: passgate gate rounds.json --threshold 0.9 --min-rounds 3

Notes

  • Wilson interval (not Wald): behaves correctly near 0% and 100%, where the naive interval explodes.
  • gate fails when rounds < --min-rounds, so "we only ran it once" cannot pass a 3-round gate.
  • Pure stdlib — no scipy, no pandas.
  • Exit codes: 0 pass, 1 gate failed / improvement not significant, 2 bad input (missing file, bad JSON/CSV, invalid number). Keeps CI from treating a typo as a model regression.
  • Input files may be UTF-8 with or without a BOM, LF or CRLF.
  • The Wilson interval is two-sided, so a 95% interval gives a one-sided 97.5% lower bound per round. Requiring every round to clear the bar is conservative, but passgate does not apply a formal multiple-testing correction.
  • Rounds are treated as independent samples of one pass rate. If rounds reuse the same test items, the real uncertainty is larger than the bound shows.
  • compare pools all rounds; it does not model round-to-round variance.

License

MIT. See LICENSE.

Metadata

Release files for passgate 0.1.1

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

Source distribution (sdist)

Source distribution for passgate 0.1.1
File Size Uploaded Provenance Actions
passgate-0.1.1.tar.gz 14.1 kB Without provenance Details for passgate-0.1.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for passgate 0.1.1
File Interpreter ABI Platform Actions
passgate-0.1.1-py3-none-any.whl Python 3 none any Details for passgate-0.1.1-py3-none-any.whl

Total release size: 24.7 kB

Release files / passgate-0.1.1.tar.gz

Download URL passgate-0.1.1.tar.gz
Size 14.1 kB
Tags Source
SHA-256 checksum
How to use checksums
1e713941da3689958cde7909d9eac91144e3f0fe7805b4a41f74a9563042bd71
BLAKE2b-256 checksum
How to use checksums
e929ff019f9af7ffd2e01204dc7baf20f2d0d01d938f939bec9b08a14f5f2570
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.11.15

Release files / passgate-0.1.1-py3-none-any.whl

Download URL passgate-0.1.1-py3-none-any.whl
Size 10.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
e91366c29d4a6dd1e47e3ec4d71bac9433e43e4137b827c0220d14b4e4557ff1
BLAKE2b-256 checksum
How to use checksums
091ff76192f29355b46df20b497a8447f8ea042c507651c77bd6329de9b7e8b6
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.11.15

Security for passgate 0.1.1

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

0.1.1 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