Skip to main content

modelcertify

Supply-chain certification for trained models.

A model is only as trustworthy as the run that produced it. modelcertify makes that run auditable and certifies it against a written policy.

  • A run proof hashes every artefact the run produced (config, metrics, checkpoints, weights) and combines the hashes into a Merkle root. Change one byte of one artefact and the root changes.
  • An attestation is a signed statement by an issuer that they vouch for a proof root.
  • A certificate is a policy evaluated against a run's evidence: it records every gate, how each one came out, the proof root it is bound to, and the issuer who signed it.
  • An evaluation suite (P4.x) is a private set of scored cases. Running it produces a report whose suite digest is committed to the proof, so a policy can gate on exactly which suite was used without shipping the suite. The runner supports two modes: quick (deterministic subsample, for iteration) and full (every case, for the attestable result). Scoring is a dependency-free port of the decision-index primitives (accuracy, macro/binary F1, NDCG@10, MRR, chance baselines).

The certificate never overstates. It carries the gate results, so a reader can see why something was certified, not just that it was.

Install

pip install modelcertify
pip install -e ".[dev]"           # from a checkout

modelcertify has no runtime dependencies: it is stdlib-only on purpose, so it can be dropped into an air-gapped review environment.

Relationship to iroh-tinker

modelcertify is a standalone product. It does not import iroh-tinker, and it does not need to: it certifies a run's artefacts, wherever they were produced.

The natural pairing is that an iroh-tinker run writes its artefacts (the launch spec, the metrics, the checkpoints) to a directory, and modelcertify proof --dir <that directory> turns them into a proof.

CLI

modelcertify proof --run-id run-1 --dir ./artifacts --out proof.json
modelcertify policy --file policy.json --json
modelcertify certify --evidence evidence.json --policy policy.json \
    --issuer scai --key "$MODELCERTIFY_KEY" --out certificate.json
modelcertify verify --certificate certificate.json --key "$MODELCERTIFY_KEY"
modelcertify eval --suite suite.json --mode full --run-id run-1 --out certificate.json

Every command accepts --json.

Exit codes: 0 success, 1 the run was not certified (or the certificate did not verify), 2 a usage or input error.

The signing key is hex. Pass it with --key or set MODELCERTIFY_KEY.

Evidence and policies

An evidence document is what a policy is allowed to look at:

{
  "proof": {"run_id": "run-1", "artifacts": [{"name": "model.safetensors", "digest": "..."}]},
  "metrics": {"eval_loss": 0.21, "eval_accuracy": 0.94},
  "provenance": {"dataset_id": "ds-1", "licence": "cc-by-4.0"}
}

A policy is a set of gates over that evidence:

{
  "policy_id": "baseline",
  "name": "Baseline release policy",
  "required_artifacts": ["config.json", "model.safetensors"],
  "gates": [
    {"name": "loss", "kind": "metric", "field": "eval_loss", "op": "<=", "threshold": 0.5},
    {"name": "dataset", "kind": "provenance", "field": "dataset_id", "op": "!=", "threshold": null}
  ]
}

Gate kinds:

kind what it checks
metric a measured metric against a threshold
artifact that a named artefact is in the proof
provenance a field of the run's provenance record

Operators: >=, <=, >, <, ==, !=, in.

What it does not do

  • It does not prove the code was correct, only that the artefacts are the ones that were certified.
  • The signature is an HMAC, not a public-key signature: the verifier needs the issuer's key. That is deliberate for v1 (no key ceremony before there is a customer), and the interface is narrow enough to swap in Ed25519 later.
  • A failed policy still produces a certificate. The point of a certificate is to record the outcome, including a refusal.

Tests

pip install -e ".[dev]"
pytest

Layout

src/modelcertify/
  proof.py       run proofs, artefacts, the Merkle root
  attestation.py signed statements about a proof root
  certify.py     policies, gates, evidence, certificates
  cli.py         modelcertify proof | policy | certify | verify

Licence

Apache-2.0.

Metadata

Release files for modelcertify 0.2.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 modelcertify 0.2.0
File Size Uploaded Provenance
modelcertify-0.2.0.tar.gz 27.7 kB Without provenance Details

Built distribution (wheel)

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

Total release size: 52.0 kB

Release files / modelcertify-0.2.0.tar.gz

Download URL modelcertify-0.2.0.tar.gz
Size 27.7 kB
Tags Source
SHA-256 checksum
How to use checksums
24afee2e213081d5bc05af2d03fcff9487fbbaad1c2ba19c3565bb9d5d648a8c
BLAKE2b-256 checksum
How to use checksums
e70ade2f99761a9053b04032f69e018fec6ebb612e69e197cf4fd49a807c5fa5
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.4

Release files / modelcertify-0.2.0-py3-none-any.whl

Download URL modelcertify-0.2.0-py3-none-any.whl
Size 24.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
8e5a7d6a8eb2c07f057de9e3e5fadfbc7b467b0a86e7baba6c82e8ab206b9028
BLAKE2b-256 checksum
How to use checksums
11dc6a1bb9ac1365b69295394294369fbc1a90787b6f51c22605d68dc4cb933f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.4

Security for modelcertify 0.2.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

0.2.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