ClusterOne model, several Macs
How it works
Each Mac holds a run of the model's layers. The Mac you ask keeps the embedding and the head, does the sampling, and passes the model's working state from Mac to Mac. To every app, agent and API the model looks like any other: tools, structured output, thinking, made models and tracing all work unchanged.
The first time another Mac runs part of a model, it's sent a shard holding only its layers, and it keeps the shard for next time. A Mac that already has the same model file is recognized by the file's SHA-256 and uses its own copy.
Set it up
In Settings › Models › RoachNet Cluster:
On the first Mac, turn on Cluster. RoachNet makes a pairing code.
On each other Mac, turn on Cluster, paste that code into Join a cluster and click Join.
On the Mac that will run models, add the others with Find Macs nearby, or by address (
studio.local,192.0.2.20). Each one shows its chip and how much memory it can give to models.Choose Only models too big for this Mac (the default) or Every model.
Running across Macs shows which Mac holds which layers of each loaded model. macOS asks once for permission to use the local network, the first time Cluster connects to another Mac.
Security
- The pairing code is a 128-bit secret. It never crosses the network.
- Each connection starts with a handshake in which both ends prove they hold the code. After that, every message is sealed with ChaCha20-Poly1305 under keys for that connection alone, so it can't be read, forged, replayed or reordered.
- Being found over Bonjour gives a Mac nothing. It still needs the code.
- Until a connection has proved that it holds the code, the listener takes no message longer than the pairing messages (128 bytes), the whole handshake must finish within the link's time limit, and only a few handshakes from one address, and a limited number in all, run at once (since 1.1.3). 8 of the 32 places are kept for Macs that have connected to this one since RoachNet started, the listener refuses a connection before it starts any work for it, and a connection that sends nothing for 2 seconds is closed (since 1.1.4).
- A paired Mac's request for a stage outside the model is refused (since 1.1.3).
- Shards are checked by SHA-256 before use; a damaged transfer is sent again, and a cut-off one resumes.
- New code… makes a new secret. The other Macs stop trusting this one until they join again.
On the network
While Cluster is on, the runtime listens on port 7419 on every network interface and advertises itself over Bonjour as _roachnet-cluster._tcp. ROACHNET_CLUSTER_PORT, ROACHNET_CLUSTER_HOST and ROACHNET_CLUSTER_BONJOUR=0 change that; see Environment variables. Settings are kept in ~/RoachNet/storage/state/cluster.json and shards in ~/RoachNet/storage/cluster/shards.
Limits in 1.1.4
- Apple Silicon only, and the model's architecture must be one RoachInference reads (Llama, Mistral, Qwen2, Qwen3).
- A dropped Mac fails the reply. If a Mac drops out while a reply is being written, that request fails with a
502. A Mac that drops before any of the reply is sent is planned around, and the request is answered without it. The next request plans the model again across the Macs that answer, or on this Mac alone. - Tested on one Mac. 1.1.0 through 1.1.4 were tested with two RoachNet runtimes on one Mac, not across two physical Macs.
- Handshakes can be kept busy right after RoachNet starts. Until a paired Mac has connected since RoachNet started, it waits with every other device for a handshake place, so a device on your network that uses many addresses can keep it out. It can't pair or read anything. Keep Cluster off on networks you share with people you don't trust.
- Splitting is for models that don't fit. A model that fits on one Mac runs faster there, because every token makes a round trip to each other Mac.
Related
- The cluster routes
- RoachClaw and local models covers memory planning on one Mac.