unsloth-mlx  by ARahim3

LLM fine-tuning prototype for Mac users

Created 1 week ago

New!

336 stars

Top 81.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

3 days ago

Responsiveness

Inactive

Pull Requests (30d)
0
Issues (30d)
2
Star History
339 stars in the last 7 days

Explore Similar Projects

Starred by Andrej Karpathy Andrej Karpathy(Founder of Eureka Labs; Formerly at Tesla, OpenAI; Author of CS 231n), Gabriel Almeida Gabriel Almeida(Cofounder of Langflow), and
2 more.

torchchat by pytorch

0.1%
4k
PyTorch-native SDK for local LLM inference across diverse platforms
Created 1 year ago
Updated 4 months ago
Starred by Chip Huyen Chip Huyen(Author of "AI Engineering", "Designing Machine Learning Systems"), Elie Bursztein Elie Bursztein(Cybersecurity Lead at Google DeepMind), and
8 more.

h2o-llmstudio by h2oai

0.1%
5k
LLM Studio: framework for LLM fine-tuning via GUI or CLI
Created 2 years ago
Updated 3 weeks ago
Starred by Andrej Karpathy Andrej Karpathy(Founder of Eureka Labs; Formerly at Tesla, OpenAI; Author of CS 231n), Stefan van der Walt Stefan van der Walt(Core Contributor to scientific Python ecosystem), and
12 more.

litgpt by Lightning-AI

0.1%
13k
LLM SDK for pretraining, finetuning, and deploying 20+ high-performance LLMs
Created 2 years ago
Updated 3 days ago
Feedback? Help us improve.