Skip to main content
Modeldiffr

Know what changed between a model and anything built from it.

PyPI Python CI Docs License

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

  1. 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.
  2. Both models run on exactly the same inputs, with one shared chat template when theirs differ.
  3. Multiple choice items are scored by log likelihood, so the result does not depend on answer formatting.
  4. Paired bootstrap resampling turns per item results into deltas with intervals and p values, corrected across all metrics.
  5. Every item and result is committed to in a Merkle tree, and a statement hash covers every claim, so modeldiffr verify can recompute the report.
  6. 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 quick suite is a smoke test. Use lite, standard or full for 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.2}
}

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

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for modeldiffr 0.9.2
File Size Uploaded Provenance
modeldiffr-0.9.2.tar.gz 164.8 kB With provenance Details

Built distribution (wheel)

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

Total release size: 329.9 kB

Release files / modeldiffr-0.9.2.tar.gz

Download URL modeldiffr-0.9.2.tar.gz
Size 164.8 kB
Tags Source
SHA-256 checksum
How to use checksums
32a482224a6f8fe380f03ad3b8ae4b52d69c6ce44601e0d514b5e225aff26796
BLAKE2b-256 checksum
How to use checksums
c4da7a5cabf556f4cf235fc259b605f8dfeb04a37cde8c90edbf4ba12187326f
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 23, 2026.

Transparency log

Release files / modeldiffr-0.9.2-py3-none-any.whl

Download URL modeldiffr-0.9.2-py3-none-any.whl
Size 165.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
1fcc316f04afcc069568f3928de4e87c41d2d3724f7743f4ea004e5824f2c481
BLAKE2b-256 checksum
How to use checksums
adba95f4a128d385ea26969c75ad93d7a76cc9ce80de77742d77af4bba6a282f
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 23, 2026.

Transparency log

Security for modeldiffr 0.9.2

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.

Select from 2 files

Attestation for modeldiffr-0.9.2.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 23, 2026.

Transparency log

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.

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