| name | exo-distributed |
| description | Distributed LLM inference across Apple Silicon clusters with exo. Run models across Mac Studios via Thunderbolt RDMA, auto peer discovery, and MLX sharding. Use for multi-device inference, model parallelism, or building LLM clusters. |
| version | 1.0.0 |
exo-distributed Skill
"Run models across heterogeneous devices by forming GPU clusters with zero configuration."
Trit: 0 (ERGODIC - coordination/orchestration)
Color: Neutral (60-180° hues)
Source: Random walk fusion over DuckLake interactions + DeepWiki exo-explore/exo
Overview
exo enables distributed LLM inference across multiple Apple Silicon devices:
- Auto Peer Discovery: Devices find each other automatically
- RDMA over Thunderbolt 5: Low-latency direct memory access
- MLX Backend: Native Apple Silicon acceleration via mlx.distributed
- Pipeline + Tensor Parallelism: Shard models across devices
Quick Start
pip install exo-explore
exo
exo
Architecture
┌─────────────────────────────────────────────────────────────────┐
│ EXO CLUSTER │
├─────────────────────────────────────────────────────────────────┤
│ │
│ ┌────────────┐ Thunderbolt 5 ┌────────────┐ │
│ │ Mac Studio │◄───── RDMA ────►│ Mac Studio │ │
│ │ M4 Max │ │ M4 Max │ │
│ │ Layers 0-15│ │Layers 16-31│ │
│ └──────┬─────┘ └──────┬─────┘ │
│ │ │ │
│ └──────────────┬───────────────┘ │
│ │ │
│ ┌────▼────┐ │
│ │ Master │ │
│ │ (Elected)│ │
│ └────┬────┘ │
│ │ │
│ ┌─────────▼─────────┐ │
│ │ REST API :8080 │ │
│ │ OpenAI Compatible │ │
│ └───────────────────┘ │
└─────────────────────────────────────────────────────────────────┘
Core Components
1. Peer Discovery (Gossipsub/libp2p)
exo --list-peers
2. MLX Backend
from exo.worker.engines.mlx.utils_mlx import mlx_distributed_init
mlx_distributed_init(
rank=0,
world_size=4,
backend="jaccl"
)
3. Shard Distribution
from exo.master.placement import place_instance
shard_assignments = place_instance(
model="llama-3.3-70b",
topology=discovered_topology,
strategy="pipeline"
)
4. RDMA over Thunderbolt 5
Sharding Strategies
Pipeline Parallelism
Device 0: Layers 0-15 → embeddings + early layers
Device 1: Layers 16-31 → middle layers
Device 2: Layers 32-47 → late layers
Device 3: Layers 48-63 → final layers + head
Data flows: D0 → D1 → D2 → D3 → output
from exo.master.placement import get_shard_assignments_for_pipeline_parallel
assignments = get_shard_assignments_for_pipeline_parallel(
model="llama-3.3-70b",
num_devices=4
)
Tensor Parallelism
All devices: All layers (replicated)
But: Attention heads partitioned across devices
MLP tensors partitioned across devices
Each device computes partial results → all-reduce → combined output
from exo.master.placement import get_shard_assignments_for_tensor_parallel
assignments = get_shard_assignments_for_tensor_parallel(
model="deepseek-r1",
num_devices=4
)
Supported Models
| Model | Size | Min Devices | Strategy |
|---|
| Llama 3.3 | 70B | 2 × M4 Max | Pipeline |
| DeepSeek R1 | 671B | 8+ × M4 Max | Tensor |
| Qwen 2.5 | 72B | 2 × M4 Max | Pipeline |
| Mixtral 8×22B | 141B | 4 × M4 Max | Tensor |
| Llama 3.1 | 405B | 8+ × M4 Max | Tensor |
API Usage
OpenAI-Compatible Endpoint
import openai
client = openai.OpenAI(
base_url="http://localhost:8080/v1",
api_key="not-needed"
)
response = client.chat.completions.create(
model="llama-3.3-70b",
messages=[{"role": "user", "content": "Hello!"}],
stream=True
)
for chunk in response:
print(chunk.choices[0].delta.content, end="")
Direct API
curl http://localhost:8080/v1/chat/completions \
-H "Content-Type: application/json" \
-d '{
"model": "llama-3.3-70b",
"messages": [{"role": "user", "content": "Hello"}],
"stream": true
}'
Hardware Setup
Thunderbolt Cluster (Recommended)
Mac Studio 1 ──TB5──► Mac Studio 2
│ │
TB5 TB5
│ │
▼ ▼
Mac Studio 3 ──TB5──► Mac Studio 4
- Use Thunderbolt 5 cables (120 Gbps bidirectional)
- All-to-all connectivity required for RDMA
- RDMA gives ~10× lower latency than TCP/IP
Network Cluster (Fallback)
exo --backend ring
GF(3) Triadic Integration
exo-distributed (0) ⊗ mlx-apple-silicon (+1) ⊗ bisimulation-game (-1) = 0 ✓
exo-distributed (0) ⊗ parallel-fanout (+1) ⊗ sheaf-cohomology (-1) = 0 ✓
exo-distributed (0) ⊗ gay-mcp (+1) ⊗ temporal-coalgebra (-1) = 0 ✓
Trifurcated Inference Pattern
;; Distribute inference across 3 device groups
(defn trifurcated-inference [prompt]
(let [minus (future (exo-infer :validator prompt)) ; -1: Check safety
ergodic (future (exo-infer :main prompt)) ; 0: Main inference
plus (future (exo-infer :speculative prompt))] ; +1: Speculative draft
;; GF(3) sum: -1 + 0 + 1 = 0 ✓
{:validated @minus
:response @ergodic
:speculative @plus}))
Derivational Chaining (from Bumpus/DuckLake)
Each inference step derives from previous via seed chaining:
GOLDEN = 0x9E3779B97F4A7C15
def derive_shard_seed(base_seed: int, shard_id: int, step: int) -> int:
"""Deterministic seed for each shard at each step"""
z = (base_seed + GOLDEN * shard_id + step) & 0xFFFFFFFFFFFFFFFF
z = ((z ^ (z >> 30)) * 0xBF58476D1CE4E5B9) & 0xFFFFFFFFFFFFFFFF
z = ((z ^ (z >> 27)) * 0x94D049BB133111EB) & 0xFFFFFFFFFFFFFFFF
return z ^ (z >> 31)
Commands
exo
exo --list-peers
exo --backend jaccl
exo --backend ring
exo --model llama-3.3-70b
exo --port 8080
exo bench --config bench_simple.yaml
Monitoring
Dashboard
DuckLake Integration
CREATE TABLE exo_inferences (
id INTEGER PRIMARY KEY,
timestamp TIMESTAMP,
model VARCHAR,
prompt_tokens INTEGER,
completion_tokens INTEGER,
latency_ms FLOAT,
devices INTEGER,
strategy VARCHAR,
trit INTEGER,
seed BIGINT
);
SELECT model, AVG(latency_ms) as avg_latency, COUNT(*) as count
FROM exo_inferences
GROUP BY model
ORDER BY avg_latency;
Troubleshooting
| Issue | Solution |
|---|
| Peers not discovered | Check firewall, ensure same network |
| RDMA not working | Verify Thunderbolt cables, check ibv_devices |
| OOM on device | Reduce batch size or use more devices |
| Slow inference | Switch from ring to jaccl backend |
| Model not loading | Check ~/.cache/huggingface for space |
References
Skill Name: exo-distributed
Type: Distributed LLM Inference / Cluster Orchestration
Trit: 0 (ERGODIC - coordination)
GF(3): Coordinates multi-device inference with balanced sharding
Platform: Apple Silicon clusters (macOS)
Discovery: Random walk fusion over DuckLake + DeepWiki exo-explore/exo
Scientific Skill Interleaving
This skill connects to the K-Dense-AI/claude-scientific-skills ecosystem:
Graph Theory
- networkx [○] via bicomodule
Bibliography References
distributed-systems: 3 citations in bib.duckdb
Cat# Integration
This skill maps to Cat# = Comod(P) as a bicomodule in the equipment structure:
Trit: 0 (ERGODIC)
Home: Prof
Poly Op: ⊗
Kan Role: Adj
Color: #26D826
GF(3) Naturality
The skill participates in triads satisfying:
(-1) + (0) + (+1) ≡ 0 (mod 3)
This ensures compositional coherence in the Cat# equipment structure.