macOS 26.2 introduces RDMA over Thunderbolt 5 and the JACCL collective communication library, enabling MLX to shard large language model inference and fine-tuning across multiple Apple Silicon Macs in a cluster. Developers can now run models too large for a single machine or dramatically accelerate token generation by spreading computation across up to N nodes with a single CLI flag.
⢠Run trillion-parameter models (e.g., Kimi 2.6 at ~1 TB quantized) that exceed a single machine's memory by distributing weights across multiple Macs connected via Thunderbolt 5
⢠Achieve ~3à inference throughput for 27B-parameter models on a 4-node cluster compared to a single M3 Ultra, with near-zero code changes using mlx.launch
⢠JACCL automatically selects mesh vs. ring topology based on message size, so developers get optimal latency and bandwidth without manual tuning
Demonstrates how to configure a multi-node MLX cluster hostfile programmatically in Swift and launch a distributed language model inference job across four M3 Ultras using MLX's Swift API.
import Foundation
// MARK: - Cluster Node Configuration
struct MLXClusterNode: Codable {
let ssh: String
let ips: [String]
let rdma: [String]
var env: [String: String]?
}
// MARK: - Hostfile Generator
struct MLXHostfileGenerator {
static func buildHostfile(nodes: [MLXClusterNode]) throws -> URL {
let encoder = JSONEncoder()
encoder.outputFormatting = [.prettyPrinted]
let data = try encoder.encode(nodes)
let url = FileManager.default
.temporaryDirectory
.appendingPathComponent("mlx_cluster.json")
try data.write(to: url)
return url
}
}
// MARK: - Distributed Job Launcher
struct MLXDistributedLauncher {
let hostfileURL: URL
/// Launches a distributed MLX LM chat session across the cluster.
/// Equivalent to: mlx.launch --hostfile cluster.json -- /path/to/mlx_lm.chat --model Qwen3-6 --max-tokens 2048
func launchDistributedChat(model: String, maxTokens: Int) throws -> Process {
let process = Process()
process.executableURL = URL(fileURLWithPath: "/usr/local/bin/python3")
process.arguments = [
"-m", "mlx.launch",
"--hostfile", hostfileURL.path,
"--",
"/usr/local/bin/mlx_lm.chat",
"--model", model,
"--max-tokens", String(maxTokens)
]
process.environment = ProcessInfo.processInfo.environment.merging(
["MLX_METAL_FAST_SYNCH": "1"],
uniquingKeysWith: { _, new in new }
)
try process.run()
return process
}
}
// MARK: - Example Usage
func runDistributedInferenceExample() throws {
// Define 4-node M3 Ultra cluster in a full mesh topology
let nodes: [MLXClusterNode] = [
MLXClusterNode(
ssh: "mac-ultra-1.local",
ips: ["192.168.1.101"],
rdma: ["rdma0", "rdma1", "rdma2"]
),
MLXClusterNode(
ssh: "mac-ultra-2.local",
ips: ["192.168.1.102"],
rdma: ["rdma0", "rdma1", "rdma2"]
),
MLXClusterNode(
ssh: "mac-ultra-3.local",
ips: ["192.168.1.103"],
rdma: ["rdma0", "rdma1", "rdma2"]
),
MLXClusterNode(
ssh: "mac-ultra-4.local",
ips: ["192.168.1.104"],
rdma: ["rdma0", "rdma1", "rdma2"]
)
]
// Write hostfile to disk
let hostfileURL = try MLXHostfileGenerator.buildHostfile(nodes: nodes)
print("Hostfile written to: \(hostfileURL.path)")
// Launch distributed inference job
let launcher = MLXDistributedLauncher(hostfileURL: hostfileURL)
let job = try launcher.launchDistributedChat(
model: "mlx-community/Qwen3-6-8bit",
maxTokens: 2048
)
print("Distributed inference job started with PID: \(job.processIdentifier)")
job.waitUntilExit()
print("Job finished with status: \(job.terminationStatus)")
}
// Entry point
try runDistributedInferenceExample()Foundation Models is a new Apple framework introduced in iOS 27 that gives developers on-device access to the same Apple Intelligence language model powering system features, enabling text generation, structured output, and tool-calling entirely on-device without a network connection.
Visual Intelligence brings iOS 17's Visual Look Up capabilities to a new developer-facing API surface in iOS 27, letting apps pipe live camera frames or static images through on-device scene understanding to extract subjects, text, barcodes, and rich semantic labels without any cloud round-trip.
iOS 27 opens the Foundation Models framework to third-party LLM providers via a new public LanguageModel protocol, allowing anyone to integrate server-based or local models (e.g. Claude, Gemini, CoreAI, MLX) using the same API as Apple's on-device system model.
In-depth guide
iOS 27 On-Device AI & Apple Intelligence āRDMA over Thunderbolt requires a reboot after enabling in System Settings. All nodes must have identical Python/Swift MLX installations and the executable must be on the same path on every machine. Tensor parallelism requires low-latency mesh topology ā ring topology is unsuitable for it. MLX_METAL_FAST_SYNCH=1 environment variable is critical for performance. mlx.launch orchestrates via SSH so passwordless SSH access between nodes must be configured in advance.
Requires Apple Silicon Macs with Thunderbolt 5 ports connected via Thunderbolt 5 cables; RDMA must be enabled in System Settings on every node; only available on macOS, not iOS/iPadOS
iOS 27 opens the Foundation Models framework to third-party LLM providers via a new public LanguageModel protocol, enabling anyone to integrate custom, server-based, or open-source models using the same Swift API as Apple's on-device system model.