gradecore
One deterministic, no-LLM-judge grading engine, used by the crash-test platform (on-demand adversarial testing) and wire-compatible with model-drift (longitudinal monitoring). Zero dependencies.
On that compatibility, precisely: model-drift does not import gradecore, and
declares no dependency on it. What is verified is that the two agree, which is
the claim worth making and the one that can be checked: both compute the same
suite_hash (e76f17b6c56e) over model-drift's suite, and all 35 of its graders
lift through bool_grader with 0 of 175 verdicts differing. "Shared by" was the
older wording here and it was false in code.
Every grade is a pure predicate over a string, so it reproduces exactly. The property a drift board and a vulnerability score both depend on. No second model grades the first; there is nothing here you can't rerun and get the same answer.
from gradecore import exact, contains, number, GradeInput, suite_hash
exact("blue")(GradeInput(text=" BLUE ")) # -> Verdict(passed=True, score=1.0, severity="none", …)
contains("signal", "process")(GradeInput(text="signal a process")) # both needles required
number(3.14, tol=0.01)(GradeInput(text="about 3.141")) # extracts + tolerance-compares
Eight tasks, two prompt variants, four disagreements. Four cannot clear p<0.05 even under a clean sweep, so the suite reports that it cannot decide rather than naming a winner: python3 -m demos.underpowered. Play it as a terminal session. The text is selectable.
The one signature
model-drift's graders are Callable[[str], bool]; rag-eval-lab's return floats
gated by thresholds. gradecore reconciles both under GradeInput -> Verdict,
which generalizes boolean into a severity-scored verdict without losing the
boolean case:
Verdict(passed: bool, score: float, severity: str, detail: str, grader_id: str)
# pass/fail 0.0..1.0 none|low|med|high|critical
What's here (v0.1)
-
Scalar/text graders lifted from model-drift's suite combinators -
exact,contains,regex,exact_cs,one_of,number. -
bool_grader(fn, grader_id): lifts any existingCallable[[str], bool]unchanged, so model-drift's frozen SUITE runs through gradecore without being rewritten. (Verified: gradecore'ssuite_hashover that SUITE is byte-identical to model-drift's own fingerprint.) -
suite_hash(identities): the freeze-and-fingerprint discipline, so a silently-edited suite is detectable and two runs are only comparable if they answered the same questions. -
Retrieval/grounding family (
grounding.py). With the empty-gold / empty-answer gotchas corrected. -
Adversarial graders (
adversarial.py). Injection-resistance, tool-misuse, spec/format-violation, refusal-calibration. Shipped with crash-test Phase 1. -
Trajectory scoring (
trajectory.py) and paired comparison stats (paired.py). The sign-test/permutation machinery that refuses underpowered verdicts.
pip install -e ".[dev]" && pytest -q # 150 tests, zero dependencies
MIT · by Erik Hill
Metadata
Release files for gradecore 0.10.3
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 |
|---|---|---|---|---|
| gradecore-0.10.3.tar.gz | 40.2 kB | With provenance | Details for gradecore-0.10.3.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| gradecore-0.10.3-py3-none-any.whl | Python 3 | none | any | Details for gradecore-0.10.3-py3-none-any.whl |
Total release size: 65.4 kB
Release files / gradecore-0.10.3.tar.gz
| Download URL | gradecore-0.10.3.tar.gz |
|---|---|
| Size | 40.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
21e236882fbc7bdd9ea989ed719b3cb9ea972f19e43ff500a789a1b3bf317150
|
|
BLAKE2b-256 checksum How to use checksums |
d9bd9c6bdc1e79fb68f4fac2415cd7c50fdf5f7109725b1606ae0bcaa9573f9e
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
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 Oct 12, 2026.
Transparency logRelease files / gradecore-0.10.3-py3-none-any.whl
| Download URL | gradecore-0.10.3-py3-none-any.whl |
|---|---|
| Size | 25.2 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
9ab5634e74dda8213a0c2ba49afc9821f180c145eddcfc581f7345769233ff7c
|
|
BLAKE2b-256 checksum How to use checksums |
2eec06a8933cc518a9c1dc80ffd8006907e80370e196ec09e496d4617647a7a8
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
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 Oct 12, 2026.
Transparency logSecurity for gradecore 0.10.3
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 gradecore-0.10.3.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 Oct 12, 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.