Skip to main content

mlinter

mlinter

A standalone linter for Hugging Face Transformers model integration files — modeling_*.py, modular_*.py, configuration_*.py, processing_*.py, image_processing_*.py, video_processing_*.py, feature_extraction_*.py, tokenization_*.py and generation_*.py under src/transformers/models/, plus test_tokenization_*.py under tests/models/. It enforces the structural conventions that keep hundreds of model implementations consistent with each other.

📖 Documentation: https://huggingface.github.io/transformers-mlinter/

The docs site is generated from mlinter/rules.toml, so its rule reference is always in step with the installed rules.

Installation

pip install transformers-mlinter

When working on the transformers repo, mlinter is included in the quality extras:

pip install -e ".[quality]"

Quick start

Run from the root of a transformers checkout:

mlinter                                     # check every model integration file
mlinter --changed-only --base-ref origin/main   # only what you changed
mlinter --list-rules                        # list rules and their default state
mlinter --rule TRF001                       # explain one rule

Pass a path to check code that lives outside a transformers checkout — a model repository shipped on the Hub with trust_remote_code, for instance, which has to honour the same conventions:

mlinter ~/models/LLaDA-8B-Instruct          # a directory, searched recursively
mlinter path/to/modeling_llada.py           # or a single file

See the CLI reference for every flag, the Python API, and cache locations.

Documentation map

Page What's there
Home What mlinter checks and why, installation, how rule registration works
Rules All rules, filterable, one page each with examples and exemptions
CLI usage Every flag, output formats, cache, Python API
Suppressing rules # trf-ignore, whole-file directives, cutoff dates, allowlists
Contributing a rule Adding a rule, the add-mlinter-rule skill, constraints on a rule
Releasing The tag-driven release process

Development

git clone https://github.com/huggingface/transformers-mlinter
cd transformers-mlinter
pip install -e ".[dev]"
make test        # pytest under tests/
make lint        # ruff check + format --check
make format      # auto-fix style
make typecheck   # ty on mlinter/

Building the docs site

The rule pages are generated and git-ignored. Building needs the Ruby toolchain once:

cd docs && bundle install && cd ..
make docs         # regenerate rule pages, build the site, check internal links
make docs-serve   # live preview on http://localhost:4000/transformers-mlinter/

License

Apache-2.0. See LICENSE.

Metadata

Release files for transformers-mlinter 0.1.6

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

Source distribution (sdist)

Source distribution for transformers-mlinter 0.1.6
File Size Uploaded Provenance Actions
transformers_mlinter-0.1.6.tar.gz 172.7 kB With provenance Details for transformers_mlinter-0.1.6.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for transformers-mlinter 0.1.6
File Interpreter ABI Platform Actions
transformers_mlinter-0.1.6-py3-none-any.whl Python 3 none any Details for transformers_mlinter-0.1.6-py3-none-any.whl

Total release size: 353.2 kB

Release files / transformers_mlinter-0.1.6.tar.gz

Download URL transformers_mlinter-0.1.6.tar.gz
Size 172.7 kB
Tags Source
SHA-256 checksum
How to use checksums
840ae5f8b1f665892a5b2709e3b1997701b087b1d0d92533241bf76f1705c388
BLAKE2b-256 checksum
How to use checksums
70014f248e49b7e6929ae38f7b0ae4a5b62f14a65821a97eab661d767022951c
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 10, 2026.

Transparency log

Release files / transformers_mlinter-0.1.6-py3-none-any.whl

Download URL transformers_mlinter-0.1.6-py3-none-any.whl
Size 180.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
794285abbb477599ba2ee6e5a308fe0d4cfec9c49a53ae0dd6da1e268dd6b6c0
BLAKE2b-256 checksum
How to use checksums
1a243e03c89c3948b46b15a6e228fe4413effe4f546453da024e8b8a62cf35e6
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 10, 2026.

Transparency log

Security for transformers-mlinter 0.1.6

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.

Select from 2 files

Attestation for transformers_mlinter-0.1.6.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 10, 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