New Tool Radar

Local AI

How to Run a Local Model on an Apple Silicon Mac with MLX

Install mlx-lm on an Apple Silicon Mac, start its chat command, and talk to a local model that runs on the Mac's own unified memory.

Schematic diagram with three steps: install with pip install mlx-lm, chat with mlx_lm.chat using the default model Llama-3.2-3B-4bit, and ask Why is the sky blue for a reply in the terminal.

On an Apple Silicon Mac, there is a local-model route built for the Mac itself: MLX. MLX LM is a Python package for generating text and fine-tuning large language models on Apple silicon with MLX. It works with thousands of models from the Hugging Face Hub, and its models come from the MLX Community organization, pre-converted into the MLX format. This guide is only for Apple Silicon Macs — MLX is for Apple silicon, so it does not apply to Windows, Linux, or Intel Macs.

Install mlx-lm

Install the package with pip:

pip install mlx-lm

That is the install step the MLX LM README gives, with conda install -c conda-forge mlx-lm as the alternative. The README’s examples use an Apple Silicon Mac with a native Python; if your Python is the wrong architecture, the install will not find a matching package, so check that first.

Try it: start a chat with the default model

To chat with a model, the README gives one command:

mlx_lm.chat

This gives you a chat REPL that you can use to interact with the model, and the chat context is preserved during the lifetime of the REPL. The default model for generation and chat is mlx-community/Llama-3.2-3B-Instruct-4bit — a small 3-billion-parameter model in 4-bit, which is a good size for a first test on a Mac. Ask it the same question used in the other first-chat guides: Why is the sky blue?

Step What you do What you should see
1. Install pip install mlx-lm The package installs
2. Chat mlx_lm.chat A chat prompt in the terminal, using mlx-community/Llama-3.2-3B-Instruct-4bit
3. Ask Why is the sky blue? A reply in the terminal

If the model answers, MLX is running on your Mac. To use a different model, add the --model flag — the README’s own example model is mlx-community/Mistral-7B-Instruct-v0.3-4bit. For a one-off answer instead of a chat, the README gives mlx_lm.generate --prompt "How tall is Mt Everest?". Expected result. We checked the MLX LM README. We did not run mlx-lm on a sample model.

Limits

MLX only runs on Apple silicon, so this guide does not help on any other computer. Models that are large relative to the total RAM available on the machine can be slow — the README warns that the model will likely be slow if it does not fit in RAM, and that the memory-wiring speed-up needs macOS 15 or higher. A small default model is a good first test, not a recommendation for serious work: a 3B model will answer simple questions well and struggle with hard ones. We did not run mlx-lm, so no reply text here is a recorded result.

Sources

See all