$ show Epistates/pmetal
PMetal is a comprehensive machine learning framework specifically optimized for Apple Silicon hardware. It provides a complete suite for LLM training, fine-tuning, inference, and deployment through multiple interfaces (CLI, TUI, GUI, Python SDK, and REST API). The framework leverages Apple-specific technologies like Metal GPU, ANE, and UltraFusion for performance optimization while supporting standard ML workflows including LoRA/QLoRA fine-tuning, knowledge distillation, model merging, and quantization to formats like GGUF. The architecture follows a modular workspace design with over 20 specialized crates handling different aspects of the ML lifecycle, unified through a job specification system and configuration framework.
The LLM identified 4 files worth highlighting for reuse:
Implements a JobSpec derive macro that standardizes job configuration across the framework. This reduces boilerplate significantly while ensuring consistency in how training, inference, and other jobs are defined and executed. The pattern is highly reusable for any configuration-driven application and demonstrates advanced Rust macro programming skills.
Provides an abstracted dispatch system for Metal GPU kernels that automatically selects between Metal 3, Metal 4, and MPP backends based on hardware capabilities. Includes fallback mechanisms and capability detection. This isolated hardware abstraction layer could be extracted for other GPU computing contexts and demonstrates sophisticated backend selection strategy.
Implements a generic, extensible LoRA framework with clean separation between core LoRA logic and architecture-specific adapters. Uses Rust traits effectively to allow easy extension to new model architectures. This component could be reused in other ML frameworks with minimal modification and demonstrates strong adherence to the open/closed principle.
Implements an efficient shard-based data reader designed for pretraining-scale data handling. Provides streaming capabilities with proper buffering and position tracking. This self-contained data loading solution demonstrates good implementation of streaming patterns and could be extracted for other data-intensive applications requiring efficient large-scale dataset processing.