{"id":48823085,"url":"https://github.com/swaylenhayes/mlx-triage","last_synced_at":"2026-04-14T16:01:51.178Z","repository":{"id":341787285,"uuid":"1171478321","full_name":"swaylenhayes/mlx-triage","owner":"swaylenhayes","description":"Stop guessing why your MLX model outputs garbage. Triage in 30 seconds — no model load required.","archived":false,"fork":false,"pushed_at":"2026-03-11T02:01:30.000Z","size":713,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-03-11T04:50:31.982Z","etag":null,"topics":["apple-silicon","cli","llm-debugging","local-llm","macos","mlx","mlx-lm","model-debugging","python","quantization","safetensors"],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/swaylenhayes.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":"docs/roadmap.md","authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-03-03T09:21:15.000Z","updated_at":"2026-03-11T02:01:18.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/swaylenhayes/mlx-triage","commit_stats":null,"previous_names":["swaylenhayes/mlx-triage"],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/swaylenhayes/mlx-triage","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/swaylenhayes%2Fmlx-triage","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/swaylenhayes%2Fmlx-triage/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/swaylenhayes%2Fmlx-triage/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/swaylenhayes%2Fmlx-triage/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/swaylenhayes","download_url":"https://codeload.github.com/swaylenhayes/mlx-triage/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/swaylenhayes%2Fmlx-triage/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31803790,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-14T11:13:53.975Z","status":"ssl_error","status_checked_at":"2026-04-14T11:13:53.299Z","response_time":153,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["apple-silicon","cli","llm-debugging","local-llm","macos","mlx","mlx-lm","model-debugging","python","quantization","safetensors"],"created_at":"2026-04-14T16:01:48.222Z","updated_at":"2026-04-14T16:01:51.170Z","avatar_url":"https://github.com/swaylenhayes.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"---\ntitle: README\ntype: note\npermalink: mlxtriage/readme\n---\n\n# mlx-triage\n\n[![PyPI version](https://img.shields.io/pypi/v/mlx-triage.svg)](https://pypi.org/project/mlx-triage/)\n[![CI](https://github.com/swaylenhayes/mlx-triage/actions/workflows/ci.yml/badge.svg)](https://github.com/swaylenhayes/mlx-triage/actions/workflows/ci.yml)\n[![Python 3.11+](https://img.shields.io/pypi/pyversions/mlx-triage.svg)](https://pypi.org/project/mlx-triage/)\n[![License: MIT](https://img.shields.io/github/license/swaylenhayes/mlx-triage.svg)](https://github.com/swaylenhayes/mlx-triage/blob/main/LICENSE)\n![macOS Apple Silicon](https://img.shields.io/badge/macOS-Apple%20Silicon-black.svg)\n![Validated: 32 models across 10 families](https://img.shields.io/badge/validated-32%20models%20across%2010%20families-orange.svg)\n\n**Your MLX model is producing garbage. Is it the weights? A known MLX bug? Your quantization settings?**\n\nmlx-triage answers that in 30 seconds — without loading the model into memory.\n\n```bash\npip install mlx-triage\nmlx-triage check ./my-model\n```\n\n![mlx-triage demo](docs/assets/demo.gif)\n\n## What It Checks\n\nTested 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 -\u003e](docs/validation-results.md)\n\n### Tier 0 — Sanity Checks (no MLX needed, \u003c 30 seconds)\n\n| Check | What it catches |\n|-------|----------------|\n| **Dtype Compatibility** | BF16-\u003eFP16 precision loss, training/storage dtype mismatches |\n| **Tokenizer \u0026 EOS Config** | Missing EOS tokens, chat template issues, Llama 3 dual-stop-token edge cases |\n| **Weight File Integrity** | NaN/Inf values, all-zero layers, corrupt safetensors headers |\n| **MLX Version \u0026 Known Bugs** | Outdated MLX with documented bugs affecting your model architecture |\n\n### Tier 1 — Statistical Smoke Tests (MLX required)\n\n| Check | What it catches |\n|-------|----------------|\n| **Determinism** | Non-reproducible outputs at temp=0 (infrastructure issue, not model) |\n| **Reference Divergence** | MLX output diverging from PyTorch/Transformers reference |\n| **Quantization Quality** | Excessive perplexity indicating broken quantization |\n\n## Install\n\nRequires Python 3.11+ and macOS on Apple Silicon (M1-M4).\n\n```bash\n# From PyPI\npip install mlx-triage\n\n# With MLX for Tier 1 checks\npip install \"mlx-triage[mlx]\"\n\n# With reference comparison (Tier 1, Test 1.2)\npip install \"mlx-triage[reference]\"\n\n# Development\ngit clone https://github.com/swaylenhayes/mlx-triage.git\ncd mlx-triage\nuv sync --extra dev\n```\n\n## Usage\n\n```bash\n# Tier 0 only (default — no MLX needed)\nmlx-triage check /path/to/model\n\n# Tier 0 + Tier 1\nmlx-triage check /path/to/model --tier 1\n\n# JSON output\nmlx-triage check /path/to/model --format json\n\n# Require full execution (fail if any check is skipped)\nmlx-triage check /path/to/model --tier 1 --format json --strict\n\n# Save report to file\nmlx-triage check /path/to/model --tier 1 --output report.json\n```\n\nTier 0 runs in under 30 seconds on any model. Tier 1 requires MLX and takes 5-15 minutes depending on model size.\n\n## Reliability Claims in JSON Output\n\nEach JSON report now includes:\n\n- `claim_level`: `runtime-qualified` when all checks executed, `preflight-only` when any check was skipped\n- `checks_executed`: Number of checks that ran\n- `checks_skipped`: Number of checks skipped\n- `skipped_check_ids`: IDs of skipped checks\n\nUse `--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.\n\n## How It Works\n\nmlx-triage uses a tiered diagnostic protocol — each tier increases in depth and cost:\n\n1. **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.\n\n2. **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.\n\n3. **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).\n\nIf Tier 0 finds critical issues, Tier 1 is skipped — fix the fundamentals first.\n\n## Known Bugs Database\n\nmlx-triage ships with a curated database of documented MLX bugs ([`known_bugs.yaml`](src/mlx_triage/data/known_bugs.yaml)), cross-referenced against your installed MLX version and model architecture. Running MLX \u003c 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.\n\nContributing a bug report to the database is the easiest way to help — see [CONTRIBUTING.md](CONTRIBUTING.md).\n\n## Research Basis\n\nThe diagnostic protocol is grounded in systematic analysis of MLX infrastructure defects across multiple model architectures and quantization levels. See [METHODOLOGY.md](METHODOLOGY.md) for the evidence basis, including infrastructure defect taxonomy, first-party experiments, and cross-model synthesis.\n\n## Contributing\n\nContributions welcome — especially to the known bugs database. See [CONTRIBUTING.md](CONTRIBUTING.md).\n\n## License\n\n[MIT](LICENSE)\n\n---\n\nIf mlx-triage saved you a debugging session, **star it** — it helps other MLX developers find the tool.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fswaylenhayes%2Fmlx-triage","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fswaylenhayes%2Fmlx-triage","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fswaylenhayes%2Fmlx-triage/lists"}