Fine-tune on your Mac
Turn a folder of your own material into a model that answers the way you want, and run it, without leaving your Mac.
Everything on these pages ships in the free mlx-optiq package. Training is LoRA on top of an OptiQ quant, MLX-native, with no PyTorch and no rented GPU. Each step works from the command line or from OptiQ Lab, the local web UI, and the two share one engine and the same defaults. Click a step to open its guide.
The guides
- Build a training set from your files. Notes, a code folder or a CSV of preferences, turned into
train.jsonlandvalid.jsonlby a Lab template. - LoRA SFT on Apple Silicon. One command, method-aware defaults, and what to change when memory runs short.
- DPO on top of an SFT adapter. Teach the model which of two answers you prefer, starting from your SFT weights.
- Compare tuned and base in the Arena. One prompt, two panes: the base model and the base with your adapter.
- Quantize and serve the tuned model. Pick or build the quantized base, bundle the adapter with it, and serve it over the OpenAI and Anthropic APIs.
- Fine-tune a decision model. Typed questions in, a probability per option out, with no text to parse.
- NEFTune and early stopping. Two optional flags for small datasets: embedding noise during SFT, and stopping when validation loss stalls.
- Gemma 4 specifics. Which size to train on which Mac, the MoE recipe, and sampling for the check afterwards.
The short version
terminalbash
$ pip install mlx-optiq # Build the dataset in the browser (Build dataset), or write the JSONL yourself $ optiq lab # Train a LoRA on a published OptiQ quant $ optiq lora train mlx-community/Qwen3.5-4B-OptiQ-4bit \ --data ./my_data -o ./my_adapter # Bundle base + adapter into one folder and serve it $ optiq lora export mlx-community/Qwen3.5-4B-OptiQ-4bit \ --adapter ./my_adapter -o ./my-model $ optiq serve --model ./my-model
What you need
- A Mac with Apple Silicon. Small models are the place to start: a Qwen3.5 0.8B to 4B quant, or Gemma 4 E2B or E4B.
- Memory sets how long a training example can be. On a 24 GB M4, Qwen3.5-4B trains at 8k context with a peak of about 14.4 GB; the training-ceiling map has the measured numbers.
- A few hundred good examples beat thousands of noisy ones. The trainer defaults are set for small sets: three epochs for SFT, one for DPO.
CLI or Lab
| Step | Command line | OptiQ Lab |
|---|---|---|
| Dataset | write JSONL | Build dataset |
| SFT, DPO | optiq lora train | Fine-tune |
| Combine adapters | optiq lora merge | Fine-tune, last step |
| Compare | serve both and ask | Arena |
| Quantize a base | optiq convert | Quantize |
| Bundle, serve | optiq lora export, optiq serve | Fine-tune, last step |
The flag-by-flag reference for the trainer is the LoRA reference. What these pages cover is LoRA (or DoRA, with --use-dora) adapters on text and decision models; full-weight training is not part of OptiQ.