Model or dataset
ARahim3/mlx-tune avatar
ARahim3/mlx-tune

mlx-tune: Unsloth-Compatible LLM Fine-Tuning on Apple Silicon via MLX

Fine-tune LLMs on your Mac with Apple Silicon. SFT, DPO, GRPO, Vision, TTS, STT, Embedding, and OCR fine-tuning — natively on MLX. Unsloth-compatible API.

1,414 stars94 forksPythonApache-2.0

At a glance

What is it?
mlx-tune is an Apache-2.0 Python library that wraps Apple's MLX framework in an API compatible with Unsloth, letting developers write fine-tuning scripts once on a Mac and run the same code unchanged on a CUDA cluster with original Unsloth. It supports SFT, DPO, GRPO, vision models, TTS, STT, embedding, OCR, and JEPA fine-tuning natively on M1 through M5 hardware.
Who is it for?
Developers who use Unsloth on CUDA GPUs for production training and also prototype on an Apple Silicon Mac will find mlx-tune directly useful for keeping a single training script portable across both environments. The project targets the code-portability problem, not performance parity with Unsloth on CUDA.
Can I use it commercially?
Yes. Apache-2.0 is a permissive licence: you can use, modify and sell software built on it, as long as you keep its copyright and licence notices.
Is it still maintained?
Yes. The repository last received commits 100 days ago.
What is it written in?
Mainly Python, according to GitHub's language statistics.

Answers come from the project's GitHub data, last synced on September 29, 2026, and from our analysis. They are not legal advice.

Editorial analysis

The Workflow Problem mlx-tune Solves

The README opens with a personal note from the author: working on a MacBook M4 and wanting to prototype fine-tuning locally before committing to cloud GPU costs, the author found that Unsloth cannot run on macOS because it depends on Triton, which Apple Silicon does not support. Rather than switching to a different fine-tuning API for local work and then rewriting scripts before pushing to the cloud, the author built mlx-tune as a bridge.

The core goal, stated directly in the README, is code portability. The same FastLanguageModel and SFTTrainer code that runs with Unsloth on CUDA should run with mlx-tune on Apple Silicon by changing only the import line. The README shows the two imports side by side: from unsloth import FastLanguageModel on a CUDA machine and from mlx_tune import FastLanguageModel on a Mac, with the rest of the training script unchanged.

mlx-tune is not a replacement for Unsloth and does not claim performance parity. The README explicitly states that Unsloth is the gold standard for efficient LLM fine-tuning on CUDA. mlx-tune solves a different problem: prototyping on a Mac before scaling to a CUDA cluster.

Apple Silicon Memory and What It Enables

Apple Silicon uses a unified memory architecture where the CPU and GPU share the same memory pool. The README notes this gives Mac Studio models up to 512 GB of accessible memory for fine-tuning. This is qualitatively different from a discrete GPU setup where VRAM is the bottleneck: a Mac Studio with 192 GB of memory can load model weights that would not fit in any single consumer GPU.

The practical effect is that developers can load and fine-tune larger models locally for experimentation without the cost of cloud GPU hours. The README positions mlx-tune for small datasets and quick iterations, with the move to cloud NVIDIA GPUs and original Unsloth reserved for full-scale training runs on large datasets.

The underlying framework is Apple's MLX, which the README describes as a machine learning framework for Apple Silicon. The mlx-tune library wraps mlx-lm for language model operations, mlx-vlm for vision-language models, and mlx-audio for TTS and STT work.

Installing and Running a Fine-Tuning Job

The package installs from PyPI with the standard pip command:

bash
pip install mlx-tune

The core API mirrors Unsloth. Loading a model and starting a supervised fine-tuning job uses:

python
from mlx_tune import FastLanguageModel
from mlx_tune import SFTTrainer

The pyproject.toml lists core dependencies: mlx>=0.31.0, mlx-lm>=0.31.0, mlx-vlm>=0.4.3, transformers>=4.36.0, datasets>=2.14.0, and huggingface-hub>=0.20.0, among others. Python 3.9 and above are supported according to the classifiers.

The repository includes 25 numbered example files in the examples/ directory, covering SFT (04_simple_finetuning.py, 05_complete_finetuning_workflow.py), RL training methods (09_rl_training_methods.py), vision fine-tuning (10_qwen35_vision_finetuning.py), TTS models (12_orpheus_tts_finetuning.py, 15_spark_tts_finetuning.py), STT models (13_whisper_stt_finetuning.py, 18_canary_stt_finetuning.py, 19_voxtral_stt_finetuning.py), and preference training (21_dpo_preference_tuning.py, 22_grpo_reasoning_training.py). A sample_train.jsonl file is included in the root for quick testing. The full dependency list for audio extras is defined in pyproject.toml under [project.optional-dependencies] in the audio section.

The Full Trainer and Modality Coverage

Version 0.6.0 covers a wide range of training objectives. For language fine-tuning the stable trainers include SFT, DPO (full DPO loss), ORPO, GRPO (multi-generation with reward), KTO (binary feedback), and SimPO (no reference model). Chat templates are supported for 16 model families including Llama, Gemma, Qwen, Phi, and Mistral.

Vision language model fine-tuning covers Gemma 4, Qwen3.5, PaliGemma, LLaVA, and Pixtral via mlx-vlm. For audio, five TTS models are supported: Orpheus, OuteTTS, Spark-TTS, Sesame/CSM, and Qwen3-TTS. STT fine-tuning covers Whisper, Moonshine, Qwen3-ASR, NVIDIA Canary, Voxtral, Voxtral Realtime (streaming), and Parakeet TDT with CTC, RNN-T, and TDT losses.

Version 0.6.0 added the JEPA family: LeJEPA for pretraining a Vision Transformer from scratch, I-JEPA for fine-tuning Meta's pretrained image encoder, V-JEPA 2 for Meta's video world model (including video classification and masked-latent prediction), and LLM-JEPA for bringing the JEPA objective to LLM fine-tuning based on arXiv paper 2509.14252. New entry points in this release are FastJEPAModel, FastVideoJEPAModel, and LLMJEPATrainer.

Export is documented for both HuggingFace format and GGUF for use with Ollama and llama.cpp.

Where mlx-tune Is Not the Right Tool

The README is direct about the limitations. mlx-tune targets prototyping and local iteration on small datasets, not production training runs. Users who need maximum throughput for large-scale fine-tuning should use original Unsloth on CUDA hardware, which the README identifies as the intended follow-on step.

The Unsloth-compatible API covers the main trainers and model-loading path, but not every Unsloth feature is documented as implemented. The README's status table uses "Stable" for all listed features but the pyproject.toml classifies the project as Development Status Alpha, which indicates the author considers the API surface still subject to change.

GGUF export has noted limitations. The README mentions a limitations section for the convert() and GGUF export functionality but the content of those limitations is in the docs/ directory rather than in the README text. Before relying on GGUF export for a specific architecture, checking the documentation at arahim3.github.io/mlx-tune is necessary.

The requirements.txt at the repository root lists core dependencies with minimum versions but the audio, dev, and train extras are defined separately in pyproject.toml. The requirements.txt comment explicitly notes that optional training dependencies such as trl, peft, and wandb are commented out and must be installed separately. Teams integrating mlx-tune into an existing environment should review pyproject.toml rather than requirements.txt to get the complete dependency picture including version constraints. The train extra includes trl, peft, and wandb for users who want experiment tracking and reward modeling support alongside the core MLX trainers.

License and Release History

mlx-tune is licensed under Apache-2.0, which permits commercial use, modification, and distribution. The package was originally called unsloth-mlx; the README notes the name change and directs users to switch from pip install unsloth-mlx to pip install mlx-tune and update imports from unsloth_mlx to mlx_tune.

Recent releases include v0.6.0 on 2026-06-23 (JEPA family), v0.5.1 on 2026-05-31 (fix for save_pretrained_merged on quantized base), and v0.5.0 on 2026-05-19 (performance improvements across every trainer). The documentation site at arahim3.github.io/mlx-tune is linked from the README as the primary reference for installation, quick start, supported training methods, and examples.

Editorial conclusion

Developers who use Unsloth on CUDA GPUs for production training and also prototype on an Apple Silicon Mac will find mlx-tune directly useful for keeping a single training script portable across both environments. The project targets the code-portability problem, not performance parity with Unsloth on CUDA. The last release was v0.6.0 on 2026-06-23, covering the JEPA family. Teams that need production-scale training or maximum throughput should use original Unsloth on CUDA hardware; mlx-tune is the local-experimentation half of that workflow.

Frequently asked questions

What is mlx-tune and how does it relate to Unsloth?

mlx-tune wraps Apple's MLX framework in an Unsloth-compatible API so that fine-tuning scripts written for Unsloth on CUDA can run unchanged on an Apple Silicon Mac by changing only the import line. It is not a replacement for Unsloth; it solves the code-portability problem for developers who prototype on a Mac before training at scale.

How do I install mlx-tune on a Mac with Apple Silicon?

Run pip install mlx-tune. For audio fine-tuning including TTS and STT models, install the optional audio dependencies defined in pyproject.toml under the audio extras section. The package requires Python 3.9 or above and Apple Silicon hardware.

What fine-tuning methods does mlx-tune support?

The stable trainers include SFT, DPO, ORPO, GRPO, KTO, SimPO, vision language models, TTS and STT audio models, embedding models, OCR models, and the JEPA family added in v0.6.0. All are documented in the examples/ directory and the documentation site.

Official sources

  1. ARahim3/mlx-tune on GitHub
  2. License: Apache-2.0
  3. Project website
  4. README
  5. Releases
Add this badge to your README

If you maintain this project, the badge below links readers to this analysis and shows its maintenance status from the daily GitHub snapshot. Paste the markdown into your README; add ?metric=license or ?metric=stars to the image URL for a different field.

Add this badge to your README

markdown
[![Hysen Labs](https://hysenlabs.com/badge/arahim3-mlx-tune.svg)](https://hysenlabs.com/projects/arahim3-mlx-tune)