gatedtrain
gatedtrain checks whether a newly trained model checkpoint is really better than (or, if you choose, no worse than) the model it started from. It calls the new checkpoint better only when it beats a criterion you registered before training, on held-out test data the trainer never saw. It also records what went into each training run, so that you can later ask which checkpoints may have used a given piece of training data, for example after finding a problem in it.
It is for people who fine-tune models and want a decision they can defend, made by rules that were fixed before the results came in. It works with external trainers and evaluators.
This is a prototype. Reports and records of the demo and of external runs carry the tags prototype and
unpromotable, which mark them as not fit for promoting a model. AI-native projects are a preview.
How it works
You fix the test before training. You train while a ledger records which data was read, then score the old and the new model on held-out test data, and a gate gives one of four results in a report.
flowchart LR
data["Your data"] --> train_part["Training data"]
data --> sealed["Sealed test set (held back)"]
reg["Criterion registered before training"] --> gate
base["Base model"] --> cand["Train a candidate"]
train_part --> cand
cand --> ledger["Consumption ledger (what training read)"]
cand --> eval["Score base and candidate on the sealed set"]
base --> eval
sealed --> eval
eval --> gate{"Gate"}
gate --> result["PASS / FAIL / INCONCLUSIVE / MISSING"]
result --> report["Gate report"]
- The registration fixes the criterion before training: the metric, the margin to beat and how sure the test
must be. The spec records the registration file's SHA-256 hash;
validateandrunrefuse if the file no longer matches. - The sealed test set is the evaluation data, kept apart from the training data. How strictly this is enforced depends on how you use gatedtrain; see Concepts.
- The gate compares the two models item by item. Only PASS means the candidate met the registered rule.
- The consumption ledger records which training data each run read, so the
impactcommand can trace data to checkpoints.
Each idea is explained in Concepts.
Try it
The demo trains a very small model on two-digit addition, on a CPU. From a checkout with Python 3.12 or 3.13:
python -m venv .venv
. .venv/bin/activate
python -m pip install -e '.[tier-a]' # the tier-a extra installs PyTorch
gatedtrain validate demo/spec.yaml # checks the spec and its registration; prints "ok"
Then run it from the repository root, with a fresh demo/baseline path:
gatedtrain warmup demo/warmup.yaml --out demo/baseline # trains the starting (base) model
gatedtrain run demo/spec.yaml --runs-root demo/runs # trains a candidate, scores both, prints the gate report
gatedtrain impact demo/data/train/shard-00003.jsonl --runs-root demo/runs # which checkpoints may have used this shard
run prints its output directory and the gate report. The
CPU quickstart explains each line of the
report and shows control runs that FAIL or come out INCONCLUSIVE on purpose.
Three ways to use it
| Way | What it is | Read |
|---|---|---|
| The CPU demo | A small model on two-digit addition, trained and gated on a laptop. The quickest way to see a gate report. | Quickstart |
| External training runs | You train with your own framework (for example TRL or NeMo RL) on your GPU. A recipe repository's adapter reads the run's outputs, and ext-collect gates them. gatedtrain does not start the training itself. |
External runs |
| AI-native projects (preview) | gatedtrain project runs one goal through fixed stages and seals part of your data for the test itself. On Linux, a keeper (a service under its own OS user) can hold the sealed data and sign every record. |
AI-native projects |
Learn more
The guides below are also published as a website: https://gatedtrain.github.io/gatedtrain/.
- Concepts: registration, sealed test set,
gate results, alpha spending, the consumption ledger and
impact - Commands: every subcommand
- External runs: adapter plugins and recipe repositories
- AI-native projects: the keeper, rootless containers and scenario packs, with their guarantees and limits
- Configuration: the host file and environment variables
- Development: tests and design references
- Tier B runbook: a GPU run with NeMo RL
- Changelog
Data and licenses
- GSM8K (
openai/gsm8k, MIT, © 2021 OpenAI): downloaded byexport-gsm8kat a pinned dataset commit. The fixtures undertests/fixtures/tierb/are synthetic rows in GSM8K's shape;tests/fixtures/r11/longrun/raw_samples.jsonquotes one GSM8K test question (seeTHIRD_PARTY_NOTICES.md). - NeMo RL and NeMo Evaluator (Apache-2.0): used unchanged as external tools at pinned commits (NeMo RL
4f39fd8, NeMo Evaluatorea35ba3); the NeMo RL container image is built from NeMo RL's own Dockerfile (containers/nemo-rl-uid1000/README.md). gatedtrain quotes NeMo Evaluator's GSM8K prompt text so that training and evaluation prompts agree (seeTHIRD_PARTY_NOTICES.md). - Qwen3-0.6B (Apache-2.0, Qwen team): the base model of the Tier B run; downloaded by the operator, not
redistributed (a few of its responses are quoted in
raw_samples.json). - Checkpoints: the external-run commands hash model files and read safetensors headers and JSON; they never unpickle
a checkpoint. The Tier A stand-in model loads its own checkpoint with
torch.load(..., weights_only=True); load only checkpoints you produced.
License
gatedtrain is licensed under the Apache License, Version 2.0 (LICENSE). See NOTICE for the copyright notice and
THIRD_PARTY_NOTICES.md for the third-party material it includes.
Names of third-party projects and products are trademarks of their owners; gatedtrain is not affiliated with or endorsed by them.
Metadata
Release files for gatedtrain 0.6.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 |
|---|---|---|---|---|
| gatedtrain-0.6.0.tar.gz | 441.3 kB | With provenance | Details for gatedtrain-0.6.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| gatedtrain-0.6.0-py3-none-any.whl | Python 3 | none | any | Details for gatedtrain-0.6.0-py3-none-any.whl |
Total release size: 927.9 kB
Release files / gatedtrain-0.6.0.tar.gz
| Download URL | gatedtrain-0.6.0.tar.gz |
|---|---|
| Size | 441.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
78437d6d160981cdefed42c99f2d92f75699697d67a1e6382bcfe75f844bcd28
|
|
BLAKE2b-256 checksum How to use checksums |
af97bd5fcc22d57ee0453180451bfcf6c25a68d09e1a631d63568da3922a12ee
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
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 Nov 25, 2026.
Transparency logRelease files / gatedtrain-0.6.0-py3-none-any.whl
| Download URL | gatedtrain-0.6.0-py3-none-any.whl |
|---|---|
| Size | 486.6 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
62eb36bf27ac1733459c4a16716136ddeb4e0e07cb806ea4e76495ff3ff4ffad
|
|
BLAKE2b-256 checksum How to use checksums |
37426a1d80001ed1f26b34677e4f5f44b51b07924d7fb6999f1ac4ad03e4ff37
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
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 Nov 25, 2026.
Transparency logSecurity for gatedtrain 0.6.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.
Full provenance
Both files in this release have been uploaded with provenance metadata.
Attestation for gatedtrain-0.6.0.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 Nov 25, 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.