Skip to main content

mlx-triage

PyPI version CI Python 3.11+ License: MIT macOS Apple Silicon Validated: 32 models across 10 families

Your MLX model is producing garbage. Is it the weights? A known MLX bug? Your quantization settings?

mlx-triage answers that in 30 seconds — without loading the model into memory.

pip install mlx-triage
mlx-triage check ./my-model

mlx-triage demo

What It Checks

Tested against 32 models across 10 families (Qwen, Gemma, GLM, Mistral/Devstral, LiquidAI, GPT-OSS, Nemotron, Llama, Phi, Nanbeige), 7 quantization formats (bf16 through QAT 4-bit and MXFP4), from 0.6B to 35B parameters. Zero false negatives. Full validation results ->

Tier 0 — Sanity Checks (no MLX needed, < 30 seconds)

Check What it catches
Dtype Compatibility BF16->FP16 precision loss, training/storage dtype mismatches
Tokenizer & EOS Config Missing EOS tokens, chat template issues, Llama 3 dual-stop-token edge cases
Weight File Integrity NaN/Inf values, all-zero layers, corrupt safetensors headers
MLX Version & Known Bugs Outdated MLX with documented bugs affecting your model architecture

Tier 1 — Statistical Smoke Tests (MLX required)

Check What it catches
Determinism Non-reproducible outputs at temp=0 (infrastructure issue, not model)
Reference Divergence MLX output diverging from PyTorch/Transformers reference
Quantization Quality Excessive perplexity indicating broken quantization

Install

Requires Python 3.11+ and macOS on Apple Silicon (M1-M4).

# From PyPI
pip install mlx-triage

# With MLX for Tier 1 checks
pip install "mlx-triage[mlx]"

# With reference comparison (Tier 1, Test 1.2)
pip install "mlx-triage[reference]"

# Development
git clone https://github.com/swaylenhayes/mlx-triage.git
cd mlx-triage
uv sync --extra dev

Usage

# Tier 0 only (default — no MLX needed)
mlx-triage check /path/to/model

# Tier 0 + Tier 1
mlx-triage check /path/to/model --tier 1

# JSON output
mlx-triage check /path/to/model --format json

# Require full execution (fail if any check is skipped)
mlx-triage check /path/to/model --tier 1 --format json --strict

# Save report to file
mlx-triage check /path/to/model --tier 1 --output report.json

Tier 0 runs in under 30 seconds on any model. Tier 1 requires MLX and takes 5-15 minutes depending on model size.

Reliability Claims in JSON Output

Each JSON report now includes:

  • claim_level: runtime-qualified when all checks executed, preflight-only when any check was skipped
  • checks_executed: Number of checks that ran
  • checks_skipped: Number of checks skipped
  • skipped_check_ids: IDs of skipped checks

Use --strict in CI or external reporting workflows to enforce full execution. In strict mode, mlx-triage exits with a non-zero status if any check is skipped.

How It Works

mlx-triage uses a tiered diagnostic protocol — each tier increases in depth and cost:

  1. Tier 0 reads model files directly (safetensors headers, config JSON, tokenizer config) without loading the model into memory. This catches the most common issues instantly.

  2. Tier 1 loads the model via MLX and runs statistical tests — determinism checks (10 runs at temp=0), perplexity measurement against a fixed eval corpus, and optional comparison against a PyTorch reference backend.

  3. Tiers 2-3 (planned) will add isolation tests (batch invariance, memory pressure, context length stress) and deep diagnostics (layer-wise activation comparison, cross-runtime analysis).

If Tier 0 finds critical issues, Tier 1 is skipped — fix the fundamentals first.

Known Bugs Database

mlx-triage ships with a curated database of documented MLX bugs (known_bugs.yaml), cross-referenced against your installed MLX version and model architecture. Running MLX < 0.22.0 with float16 weights? It flags the known qmv kernel overflow. Got a 4-bit Llama model looping on long prompts? There's a documented bug for that. Safetensors file looks valid but weights are numerically garbage? That's a known silent bfloat16 corruption path.

Contributing a bug report to the database is the easiest way to help — see CONTRIBUTING.md.

Research Basis

The diagnostic protocol is grounded in systematic analysis of MLX infrastructure defects across multiple model architectures and quantization levels. See METHODOLOGY.md for the evidence basis, including infrastructure defect taxonomy, first-party experiments, and cross-model synthesis.

Contributing

Contributions welcome — especially to the known bugs database. See CONTRIBUTING.md.

License

MIT


If mlx-triage saved you a debugging session, star it — it helps other MLX developers find the tool.

Metadata

Release files for mlx-triage 0.2.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 mlx-triage 0.2.0
File Size Uploaded Provenance Actions
mlx_triage-0.2.0.tar.gz 239.6 kB With provenance Details for mlx_triage-0.2.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for mlx-triage 0.2.0
File Interpreter ABI Platform Actions
mlx_triage-0.2.0-py3-none-any.whl Python 3 none any Details for mlx_triage-0.2.0-py3-none-any.whl

Total release size: 277.3 kB

Release files / mlx_triage-0.2.0.tar.gz

Download URL mlx_triage-0.2.0.tar.gz
Size 239.6 kB
Tags Source
SHA-256 checksum
How to use checksums
85fe5eeb9bd5dc421f817a228daf40f3f31047b1229731f3fcae93432b2a1cd6
BLAKE2b-256 checksum
How to use checksums
460246dd2d2e063f80468696c4bcdfebd30cd71a2ed4bea892b2f3c46c2034c9
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.7

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 Mar 11, 2026.

Transparency log

Release files / mlx_triage-0.2.0-py3-none-any.whl

Download URL mlx_triage-0.2.0-py3-none-any.whl
Size 37.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
d4e23857dea9a9a96b1f62937a4213af6d243f79169bfe4fed29d99bdf31fd05
BLAKE2b-256 checksum
How to use checksums
9394cbf7b04ed73ac2226642b6ae828ef996bf64a058c45529ff3c3a8638fac6
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.7

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 Mar 11, 2026.

Transparency log

Security for mlx-triage 0.2.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.

Select from 2 files

Attestation for mlx_triage-0.2.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 Mar 11, 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