Model setup recipes
Last updated
Run a local LLM across Macs: MLX, JACCL and performance
Use MLX-LM and JACCL together to run a model across two Macs.
JACCL is an MLX1 communication backend that exchanges data between Macs while they run an AI model. MLX-LM2 splits and places the model across the Macs, and JACCL transfers the values exchanged during computation. Together they provide a way to run a model that is difficult to fit on one Mac.
Connect two Macs over Thunderbolt, check communication with a small example, then run a model with MLX-LM. After confirming that the model is distributed across both machines, send the same question to one Mac and to the pair to compare waiting time and memory use.
Prepare two Macs and a supported model
MLX 0.30.6 includes changes to JACCL and MLX-LM distributed server inference3. Its JACCL update requires macOS 26.3 or later. Check the official documentation to confirm that both machines use Apple Silicon, the MLX and MLX-LM versions provide the JACCL path, and the model supports distributed sharding.
Both Macs must reach each other on the same local network. If using managed company devices or public Wi-Fi, check administrator guidance before changing network or firewall settings. Speed depends on the model and communication volume, so the steps below first verify connection and execution, then compare performance on your workload.
Prepare matching MLX and MLX-LM environments on both Macs. The installation block below reproduces the 0.30.6 connectivity example. Create virtual environments at matching paths, install on each machine and check versions. Choose one controlling Mac for the network and RDMA setup in the next section.
python3 -m venv .venv
source .venv/bin/activate
python -m pip install 'mlx==0.30.6' 'mlx-lm==0.30.6'
python -m pip show mlx mlx-lm- Official MLX distributed launch and JACCL guide
- Official MLX distributed-inference example
- MLX 0.30.6 JACCL and system-requirement changes
- MLX-LM 0.30.6 distributed server inference changes
- Mac Studio M5 Ultra 256GB baseline
- Context length, RoPE and sliding-window attention
- GGUF vs MLX: which model format should you download?
- Running local LLMs across two or more GPUs

Check versions and the Thunderbolt path first
The official walkthrough connects two Mac minis over Thunderbolt, then uses MLX’s RDMA setup tool to create a hostfile. After a small distributed check passes with mlx.launch, you can run an MLX-LM example.
The automatic setup checks SSH between the machines, RDMA support, and the Thunderbolt connection mesh. If the mesh cannot be formed, the Macs use Ethernet only, or the OS is unsupported, use the official ring/Ethernet path or a single Mac instead of forcing JACCL.
Both Macs need hostname resolution and passwordless SSH, with Python and the test script at matching paths. JACCL --auto-setup uses administrative access on each Mac to change Thunderbolt network settings. For managed devices, review the proposed commands and obtain administrator approval first. This JACCL example uses macOS 26.3 or later.
Because this setup may change network and kernel configuration, run it on dedicated test machines. Do not start a large model until two ranks are confirmed. If both logs do not show ranks 0 and 1 with size=2, stop before proceeding.
Check macOS, Python and package versions on each Mac. The ssh mac-mini-2 example queries the other Mac from mac-mini-1; reverse the destination when checking the opposite direction. Match absolute virtual-environment paths, then run network configuration from the controlling Mac. Review the changes and administrator access before --auto-setup.
# Check local versions on each Mac. Run SSH and network setup from mac-mini-1.
# Replace both hostnames with your SSH hostnames; review auto-setup changes first.
sw_vers
python3 --version
python3 -m pip show mlx mlx-lm
JACCL_PYTHON="$(mlx.launch --print-python)"
"$JACCL_PYTHON" --version
ssh mac-mini-2 "'$JACCL_PYTHON' --version && '$JACCL_PYTHON' -m pip show mlx mlx-lm"
mlx.distributed_config --verbose --hosts mac-mini-1,mac-mini-2 --over thunderbolt --dot
mlx.distributed_config --verbose --backend jaccl --hosts mac-mini-1,mac-mini-2 --over thunderbolt --auto-setup --output hosts.jsonUse a small example to verify ranks and model placement separately
After creating the hostfile, confirm that both Macs can use the same Python and launch script, then run the rank check first. The JACCL hostfile needs RDMA device information linking the two ranks. If you edit the file manually, compare the RDMA device names and rank order with the setup tool's output.
First check the two-Mac connection using the rank test without loading a model. The following mlx-community/DeepSeek-R1-0528-4bit command is a large-model distributed-chat example. Check that weights and context fit across the Macs before starting with a short prompt4. Record per-device loading and runtime5 logs, then check connectivity, versions and placement if an error occurs.
If the rank check prints rank=0 size=2 and rank=1 size=2, the two Macs form a distributed group. Then run the MLX-LM chat example and check the logs to confirm the model is actually placed across both devices. Also check the model's official documentation to see whether its architecture supports distributed sharding.
This block also passes the earlier JACCL_PYTHON as --python. The trailing python3 is resolved from the locally activated environment, and its absolute executable path is used remotely. Start with the rank test in the environment that passed the SSH check.
mlx.launch --verbose --python "$JACCL_PYTHON" --backend jaccl --hostfile hosts.json -- python3 -c 'import mlx.core as mx; g=mx.distributed.init(backend="jaccl"); print(f"rank={g.rank()} size={g.size()}")'
mlx.launch --verbose --python "$JACCL_PYTHON" --backend jaccl --hostfile hosts.json -- python3 -m mlx_lm chat --model mlx-community/DeepSeek-R1-0528-4bit
What changes from two M5 Ultras to four?
Apple’s October 15 MLX experiment distributes Muse Spark Open NVFP46 across M5 Ultras. Pipeline parallelism7 splits model layers, while tensor parallelism8 splits calculations within a layer. Producing tokens9 requires inter-machine communication, making low-latency RDMA important.
| Machines and split | Generation |
|---|---|
| 2 · pipeline | 15.74 tok/s |
| 2 · tensor | 24.99 tok/s |
| 4 · tensor | 36.73 tok/s |
M5 Ultra Mac Studio · Muse Spark Open 816B-A42B NVFP4 · 8,192 input tokens followed by 128 generated tokens · mlx_lm.benchmark · Apple measurements
Tensor parallelism generated faster even on the same two machines, and four reached 36.73 tok/s. For long conversations, compare input-processing time too. TTFT10 in these configurations was 8.4 seconds for two-machine pipeline11, 8.2 for two-machine tensor, and 4.8 for four-machine tensor.
For the new Muse configuration, update MLX and MLX-LM on every Mac to matching versions supporting the model. The earlier pinned 0.30.6 commands reproduce the JACCL connection example from that release. Confirm ranks with the same virtual-environment paths and hostfile, then use the checkpoint12 and command in the dedicated Muse guide.
Fix the conditions to compare one Mac with two
Keep model version, weights, quantization13, prompt, maximum output length and sampling identical. For a model that fits on one Mac, measure it first and repeat distributed runs under the same conditions. Record cold runs including initial download and loading separately from repeated warm runs14.
Record more than completion time: include time to first token, output token count and generation rate, memory and GPU/CPU use on each Mac, network traffic, errors, and retries. If answers differ, check that the seed, sampling, tokenizer, and template match before comparing speed. Distribution changes computation placement and communication, so results can vary with input and output length.
For example, suppose short replies are slower because of network communication and a difference appears only on long replies. In that case, record interactive queries separately from long batch jobs so one average does not obscure the workload you care about. This is an illustrative assumption, not an MLX measurement.
| Stage | Record | Pass criterion |
|---|---|---|
| Connection | OS, package, address, and rank logs | Both processes can find each other. |
| Placement | Per-device memory and work logs | The intended model split and device participation are visible. |
| Correctness | Output and token count for the same prompt | Answer quality and completion status are acceptable. |
| Performance | TTFT, completion time, memory, and transfer volume | The benefit exceeds the operational complexity for the actual workload. |

Narrow failures down through network and sharding checks
If a Mac cannot find its peer, check whether both are on the same network, whether the router blocks device-to-device traffic, and whether a firewall, VPN, or security tool blocks the connection. Inspect OS blocking logs and administrator policies instead of disabling the firewall. Check ports in the current MLX command and official documentation; do not open them arbitrarily.
If the connection works but initialization fails, compare package versions, macOS requirements, rank count, and address settings. For memory pressure, check weight size, per-device placement, context and KV cache15, and memory used by other apps separately. Faster networking does not automatically balance weights across devices.
If it runs but is slow, use the logs to locate the stage where time increases. For a small model or short prompt, communication and distribution setup can cost more than the computation saved. If the distributed server is unstable or the speed difference is not repeatable, keep one Mac as the default path.
Terminology notes
MLX — Apple’s machine-learning framework, which runs models using memory shared by the CPU and GPU on Apple Silicon.
Back to the textMLX-LM — A package for loading, running, and fine-tuning language models with MLX.
Back to the textInference — The process of using a trained model to compute an output for an input. Here, local inference means running the model on the user’s device.
Back to the textPrompt — The input text sent to a model. For generative models it describes the desired result and strongly shapes the output.
Back to the textRuntime — The software environment that provides facilities needed while a program runs. In local AI, it can also refer to a model execution engine.
Back to the textNVFP4 — A 4-bit floating-point data format defined by NVIDIA. Support depends on GPU generation, model, and software implementation.
Back to the textPipeline parallelism — A parallelization method that assigns groups of model layers to device stages and passes each stage’s output activations to the next device.
Back to the textTensor parallelism — A method that splits matrices and computations within a model layer across devices for joint execution. Devices communicate to combine partial results.
Back to the textToken — A unit into which a model divides input or output for processing.
Back to the textTime to First Token — The time from sending a request until its first output token arrives.
Back to the textPipeline — A sequence of processing stages from input to output. Different models or tools may be used at each stage.
Back to the textCheckpoint — A file containing saved model weights and related state. Versions or tasks in one model family may use different checkpoints.
Back to the textQuantization — A way to represent model weights or values with fewer bits, reducing storage and memory use. The coarser representation can also affect accuracy.
Back to the textWarm run — A measurement made after model loading and initialization. It may exclude the loading wait from the first run.
Back to the textKV cache — Memory that stores attention keys and values from earlier tokens for reuse during later token generation. Its size depends on context length and batch size.
Back to the text
Frequently asked questions
- What should you check first in this article?
- JACCL is an MLX communication backend that exchanges data between Macs while they run an AI model. MLX-LM splits and places the model across the Macs, and JACCL transfers the values exchanged during computation. Together they provide a way to run a model that is difficult to fit on one Mac.
- How much memory does it need?
- Record more than completion time: include time to first token, output token count and generation rate, memory and GPU/CPU use on each Mac, network traffic, errors, and retries. If answers differ, check that the seed, sampling, tokenizer, and template match before comparing speed. Distribution changes computation placement and communication, so results can vary with input and output length.
Read next
Executable programs and extensions
What is Apple Minions? Sharing inference jobs across idle Macs
Executable programs and extensions
Run local AI with MLX on Apple Silicon: frameworks and model tools explained
Model setup recipes
Run a 3B Model with MLX-LM and Read Its Speed: First Load, Prefill, Decode, and KV Cache
memory and model
How much VRAM or unified memory does a local LLM need?
