Know what changed between a model and anything built from it.
Documentation | Quickstart | CLI reference | Roadmap | Report a bug | Contact
Modeldiffr audits a derivative language model against its base: a fine tune, a quantized build, a merge or an edited checkpoint. Both models answer the same items under the same template. Every change comes with a paired interval, and the report is bound to the exact weights, so anyone can verify it.
pip install "modeldiffr[hf]"
modeldiffr audit Qwen/Qwen2.5-0.5B-Instruct your-org/your-qwen-finetune
Preview, v0.9. Every layer has shipped. Version 1.0 waits for the published study and model zoo results described in the roadmap. Report schema 0.3 is the 1.0 candidate.
Why
Hugging Face hosts hundreds of thousands of derivative models. A model card might say "fine tuned for medical Q&A" or "4 bit, near lossless", but nobody can cheaply check whether general capability dropped, whether safety behavior shifted, or whether a merge is actually better than its parents. Benchmarks run by hand show that a score moved, not whether the move is real, and comparisons are often unfair because prompts, templates or decoding settings differ between runs.
Modeldiffr makes the comparison fair, statistical, repeatable and checkable.
What it answers
| Question | Commands | Read more |
|---|---|---|
| Which exact models, items and settings were compared, and can anyone check that? | verify sign anchor |
Fingerprints and proof, Attestations |
| What changed on thirteen standard benchmarks, and is it larger than noise? | audit |
Statistics, Suites |
| Which layers moved, and which features are new, lost or reshaped? | layers features |
Representational layer |
| How much of a behavioral change do those layers and features carry? | causal |
Causal layer |
| Is there an input where the derivative behaves unlike its base? | scan zoo |
Anomaly scan |
Every behavioral metric is a paired delta with a 95% bootstrap interval, corrected for multiple comparisons, with a minimum effect below which a change is called negligible. Identical models produce a clean report.
Install
pip install "modeldiffr[hf]"
| Extra | Adds | Use it for |
|---|---|---|
hf |
PyTorch, Transformers | Running audits and the interpretability commands |
tasks |
Datasets | The lite, standard and full suites |
vllm, llamacpp |
vLLM, llama.cpp | Fast GPU generation, GGUF builds |
proof |
jsonschema | Full schema checks in verify |
sign, anchor |
cryptography, Sigstore, OpenTimestamps, web3 | Signing and public timestamps |
batch |
PyYAML | YAML batch specs |
all |
Everything above except vLLM and llama.cpp |
The core package has no dependencies, which keeps it light for CI jobs that only read reports. See Installation.
Quickstart
modeldiffr audit Qwen/Qwen2.5-0.5B-Instruct Qwen/Qwen2.5-0.5B --out reports/qwen
audit id mdr1:71e153dc730bb9ec20b7159dc8845afab76de27ddf94b99cada26c713aa3170d
weights: 290 of 290 shared tensors changed, 0 added, 0 removed
capability_accuracy base 0.7917 derivative 0.7500 delta -0.0417 95% CI [-0.1667, +0.0833] within noise
over_refusal_rate base 0.1000 derivative 0.0000 delta -0.1000 95% CI [-0.2500, +0.0000] within noise
output_divergence_kl base 0.0000 derivative 0.4120 delta +0.4120 95% CI [+0.3051, +0.5233] CHANGED
report: reports/qwen/report.html
json: reports/qwen/report.json
These numbers show the format only. Run the command to get real values for your models.
report.html is a self contained page you can open anywhere or attach to a pull request. report.json holds every item, setting and hash. Full walkthrough: Quickstart.
Common tasks
Run standard benchmarks
pip install "modeldiffr[hf,tasks]"
modeldiffr audit BASE DERIVATIVE --suite standard --plan-only --estimate
modeldiffr audit BASE DERIVATIVE --suite standard
MMLU, ARC Challenge, HellaSwag, TruthfulQA, GSM8K, MGSM, IFEval, XSTest, OR Bench, HumanEval, a long context needle test and output divergence, every dataset pinned to a commit. Try it on a free GPU with the Colab notebook. See Suites and tasks.
Audit a quantized build
modeldiffr audit Qwen/Qwen2.5-1.5B-Instruct \
Qwen/Qwen2.5-1.5B-Instruct-GGUF:qwen2.5-1.5b-instruct-q4_k_m.gguf \
--base-backend hf --suite lite
See Backends.
Verify any report
modeldiffr verify report.json
modeldiffr verify report.json --models
--models also hashes the real model files at the recorded commits. See Verify a report.
Sign and publish
modeldiffr keygen --out keys
modeldiffr sign report.json --key keys/modeldiffr.key
modeldiffr hub push audit --repo your-org/your-model
modeldiffr registry build audits --out registry_site --key me=keys/modeldiffr.pub
See Sign and verify, Publish an audit and Public registry.
Look inside the model
modeldiffr layers BASE DERIVATIVE
modeldiffr features BASE DERIVATIVE --layer 14 --out audit --report audit/report.json
modeldiffr causal BASE DERIVATIVE --layer 14 --features audit --tasks mmlu --out audit
modeldiffr scan BASE DERIVATIVE --out audit
See Find changed features, Test what drives a change and Scan for hidden behavior.
Gate a checkpoint in CI
permissions:
id-token: write
contents: read
steps:
- uses: actions/checkout@v4
- uses: amareshhebbar/modeldiffr@v0.9.3
with:
base: org/base_model
derivative: ./checkpoints/candidate
suite: lite
The action audits, fails the job on a significant change, signs the report with Sigstore and uploads it. See GitHub Action and CI gate.
Use it from Python
from modeldiffr import run_audit
from modeldiffr.backend import HFBackend
from modeldiffr.report import write_reports
from modeldiffr.suites import get_suite
base = HFBackend("Qwen/Qwen2.5-0.5B-Instruct")
derivative = HFBackend("your-org/your-qwen-finetune")
result = run_audit(base, derivative, get_suite("quick"))
write_reports(result, "audit")
print(result["verdict"])
See Python usage.
How it works
- Both models are fingerprinted (weights, tokenizer, chat template) and checked for comparability. The audit gets an id computed from everything that defines it, before anything runs.
- Both models run on exactly the same inputs, with one shared chat template when theirs differ.
- Multiple choice items are scored by log likelihood, so the result does not depend on answer formatting.
- Paired bootstrap resampling turns per item results into deltas with intervals and p values, corrected across all metrics.
- Every item and result is committed to in a Merkle tree, and a statement hash covers every claim, so
modeldiffr verifycan recompute the report. - Optional layers look inside: crosscoders for features, patching for causal shares, and a scan for unusual inputs.
Details: How it works.
Roadmap
| Version | Shipped |
|---|---|
| 0.2 | Weight fingerprints, audit ids, verify |
| 0.3 | Thirteen benchmarks, four backends, corrected statistics |
| 0.4 | Signing, in toto attestations, public timestamps, bills of materials, GitHub Action, Hub upload |
| 0.5 | Planted regression controls, batch audits, a registry that verifies in the browser |
| 0.6 | Layer statistics, direction comparison, crosscoders with new, lost and shifted features |
| 0.7 | Layer and feature patching and steering |
| 0.8 | Anomaly scan and a model zoo that measures its accuracy |
| 0.9 | Study tables, JSON Schemas, compatibility promise, governance, report draft |
| 1.0 | When the public study and zoo results are published |
Full plan: Roadmap and PLAN.md.
Limitations
- The built in
quicksuite is a smoke test. Uselite,standardorfullfor a release decision. - Large models need a GPU. Both models are held in memory at once.
- A significant change shows that something moved, not why. Features and causal shares are leads, not proofs.
- The anomaly scan makes no claim about real models until its rates on a public zoo are published.
All of them: Limitations.
Help and contact
| Need | Where |
|---|---|
| Something is broken | Report a bug |
| A metric, suite or backend you need | Request a feature |
| Usage questions | GitHub Discussions |
| A security issue | Private advisory, see SECURITY.md |
| Audits of your models, collaboration, anything else | hebbar.gvamaresh@gmail.com |
More: Contact and support.
Responsible use
Modeldiffr is a measurement tool. It never modifies model weights, and its reports describe what changed and how much, not how to reproduce or reverse a change. If you find a serious safety regression or hidden behavior in a public model, please contact its publisher before posting the finding. See Responsible use.
Contributing
Contributions are welcome, from bug reports to new evaluation suites. Start with CONTRIBUTING.md, GOVERNANCE.md and issues labelled good first issue.
Citation
If Modeldiffr helps your research, please cite it using CITATION.cff or:
@software{hebbar_modeldiffr_2026,
author = {Hebbar, Amaresh},
title = {Modeldiffr: auditing what changes between base and derivative language models},
year = {2026},
url = {https://github.com/amareshhebbar/modeldiffr},
version = {0.9.3},
doi = {10.5281/zenodo.23587022}
}
Acknowledgements
The representational layer builds on crosscoder based model diffing, introduced in Sparse Crosscoders for Cross Layer Features and Model Diffing (Lindsey et al., Anthropic, 2024), and on the work that followed it. Behavioral evaluation draws on open harnesses such as EleutherAI's lm evaluation harness and UK AISI's Inspect. The proof layer follows RFC 8785 and RFC 6962 and interoperates with Sigstore and in toto.
License
Apache 2.0. Copyright 2026 Amaresh Hebbar.
Metadata
Release files for modeldiffr 0.9.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 | |
|---|---|---|---|---|
| modeldiffr-0.9.3.tar.gz | 165.6 kB | With provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| modeldiffr-0.9.3-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 331.2 kB
Release files / modeldiffr-0.9.3.tar.gz
| Download URL | modeldiffr-0.9.3.tar.gz |
|---|---|
| Size | 165.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
b27995f895359d1a1a7309e2851bd1b104fd7e83db30b17fb892ed31c69bb77a
|
|
BLAKE2b-256 checksum How to use checksums |
2c597017f63c137008fa92e83645e48809b7170a708fa2d901d88612972152aa
|
| 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 Oct 24, 2026.
Transparency logRelease files / modeldiffr-0.9.3-py3-none-any.whl
| Download URL | modeldiffr-0.9.3-py3-none-any.whl |
|---|---|
| Size | 165.5 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
a25263301fe3338ec5f0ded5d951a1c4f3ffb1db189adcb238aa7962c9f16ccf
|
|
BLAKE2b-256 checksum How to use checksums |
62aa61260f6390e0d3e250c097f8e65cb4d4574790e535884a817f25d8dd79b0
|
| 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 Oct 24, 2026.
Transparency logSecurity for modeldiffr 0.9.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
All 2 files in this release have been uploaded with provenance metadata.
Attestation for modeldiffr-0.9.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 24, 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.