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.

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"

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.1.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.1.0
File Size Uploaded Provenance
modelcertify-0.1.0.tar.gz 20.4 kB Without provenance Details

Built distribution (wheel)

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

Total release size: 38.1 kB

Release files / modelcertify-0.1.0.tar.gz

Download URL modelcertify-0.1.0.tar.gz
Size 20.4 kB
Tags Source
SHA-256 checksum
How to use checksums
ddf627413700ca7f17d71665bb70577b97818465c88beb4d8878749ca868322e
BLAKE2b-256 checksum
How to use checksums
c93562fdfb6498c22a400eaa791f6c97ae34084e55e7e5bdda9b652b3612e32c
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.1.0-py3-none-any.whl

Download URL modelcertify-0.1.0-py3-none-any.whl
Size 17.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
8501566fdb2b7b0870662cb82d38303554a94aa9ddf92382075515700b0e74c8
BLAKE2b-256 checksum
How to use checksums
a703fe1c092fce1541fd7558d854f2c2fa04373e055051e99ae487e960cfc4af
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.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.

Release history Release notifications | RSS feed

This release

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