mlx-tune  by ARahim3

LLM fine-tuning prototype for Mac users

Created 4 months ago
1,261 stars

Top 30.9% on SourcePulse

GitHubView on GitHub
Project Summary

This project provides a bridge for Mac users to fine-tune Large Language Models (LLMs) locally using Apple's MLX framework, maintaining compatibility with the popular Unsloth library. It targets developers and researchers who use MacBooks with Apple Silicon and wish to prototype, test, and iterate on LLM training scripts locally before scaling to cloud GPUs, thereby solving the "context switch" problem and enabling code portability.

How It Works

Unsloth-MLX wraps Apple's native MLX framework with an API designed to mirror the original Unsloth library. This allows users to write their training code once using familiar Unsloth components like FastLanguageModel and SFTTrainer, and then execute it seamlessly on their Mac hardware. The core advantage is enabling local development and rapid iteration using the Mac's unified memory, with the exact same script deployable to cloud environments running the original Unsloth on CUDA.

Quick Start & Requirements

  • Installation: uv pip install unsloth-mlx or pip install unsloth-mlx.
  • Prerequisites: Apple Silicon Mac (M1/M2/M3/M4/M5), macOS 13.0+ (15.0+ recommended), 16GB+ unified RAM (32GB+ for 7B+ models), Python 3.9+.
  • Links: Examples are available in the examples/ directory.

Highlighted Details

  • Leverages Mac's unified memory, offering up to 512GB capacity on devices like the Mac Studio.
  • Maintains 100% API compatibility with the original Unsloth library, allowing existing code to function with a simple import change.
  • Supports saving and exporting models in HuggingFace format, GGUF (for Ollama/llama.cpp), and fully merged formats.
  • Implements a wide range of training methods including SFT, DPO, ORPO, GRPO, KTO, and SimPO, with Vision Language Model (VLM) training available in beta.

Maintenance & Community

This is an unofficial, community-driven project built by a fan, not affiliated with Unsloth AI or Apple. Contributions are welcomed, particularly in areas like custom MLX kernels, test coverage, documentation, and VLM training improvements. The GitHub repository serves as the primary hub for community interaction and development.

Licensing & Compatibility

The project is licensed under the Apache 2.0 license, which generally permits commercial use and integration into closed-source projects.

Limitations & Caveats

Vision model training is currently in beta. As an unofficial project, users should be aware that support and long-term maintenance may differ from official library offerings.

Health Check
Last Commit

1 week ago

Responsiveness

Inactive

Pull Requests (30d)
0
Issues (30d)
1
Star History
69 stars in the last 30 days

Explore Similar Projects

Feedback? Help us improve.