mirror of
https://github.com/cloudstack-llc/mlx-knife.git
synced 2026-06-30 20:48:03 -04:00
Fix: strict multi-shard health checks (#27) — backport to 1.x; bump 1.1.1b1
Summary
- Backports the 2.0 strict health policy to 1.x and ships as a pre-release.
Health changes (cache_utils.py)
- Index-aware: validate safetensors and PyTorch indexes; all referenced shards must exist, be >0B, and not be Git LFS
pointers.
- Pattern policy: shard patterns (model-XXXXX-of-YYYYY.*) without an index → unhealthy (parity with 2.0).
- Partial/tmp markers: any “.partial”, “.tmp”, or names containing “partial” anywhere under the snapshot → unhealthy.
- LFS scan: recursive detection of Git LFS pointer files (<200B with LFS header).
- Single-file fallback: non-empty .safetensors/.bin/*.gguf (no pattern shards) remain healthy.
- Ergonomics: is_model_healthy() accepts direct snapshot paths; check_lfs_corruption() scans recursively.
Tests
- Add tests/unit/test_health_multishard.py covering:
- index complete → healthy; missing/empty shard → unhealthy; LFS pointer → unhealthy
- pattern shards (no index) → unhealthy
- partial marker → unhealthy
- PyTorch index parity (complete → healthy)
- single-file safetensors/gguf → healthy
Docs
- CHANGELOG.md: add 1.1.1-beta.1 with detailed rules; note GitHub tag vs PyPI mapping (1.1.1-beta.1 ↔ 1.1.1b1).
- README.md: tests badge 160/160; pre-release note for 1.1.1b1.
- TESTING.md: status 160/160; update test structure (add test_health_multishard.py; remove 2.0 note).
Version
- version = 1.1.1b1 (PEP 440 pre-release); VERSION = (1, 1, 1).
Behavioral impact
- Health reporting is stricter (cannot regress functionality): incomplete multi-shard downloads correctly report
unhealthy. No changes to pull/run/server behavior.
Validation
- Python 3.9 local: 160 passed, 36 deselected; warnings eliminated on 3.9/3.10 under project defaults.
- New multishard tests pass; manual spot-checks show expected unhealthy→healthy transitions as downloads complete.
Release
- GitHub: tag v1.1.1-beta.1 (Pre-release).
- PyPI: upload 1.1.1b1 (install via pip install --pre mlx-knife).
This commit is contained in:
@@ -9,6 +9,7 @@ A lightweight, ollama-like CLI for managing and running MLX models on Apple Sili
|
||||
> **Note**: MLX Knife is designed as a command-line interface tool only. While some internal functions are accessible via Python imports, only CLI usage is officially supported.
|
||||
|
||||
**Current Version**: 1.1.0 (August 2025) - **STABLE RELEASE** 🚀
|
||||
- Pre-release: 1.1.1b1 — strict multi-shard health checks (Issue #27). Install with `pip install --pre mlx-knife`.
|
||||
- **Production Ready**: First stable release since 1.0.4 with comprehensive testing
|
||||
- **Enhanced Test System**: 150/150 tests passing with real model lifecycle integration tests
|
||||
- **Python 3.9-3.13**: Full compatibility verified across all Python versions
|
||||
@@ -21,7 +22,7 @@ A lightweight, ollama-like CLI for managing and running MLX models on Apple Sili
|
||||
[](https://www.python.org/downloads/)
|
||||
[](https://support.apple.com/en-us/HT211814)
|
||||
[](https://github.com/ml-explore/mlx)
|
||||
[](#testing)
|
||||
[](#testing)
|
||||
|
||||
## Features
|
||||
|
||||
|
||||
Reference in New Issue
Block a user