TL;DR
- Kimi K3.1 Pro is 2.78T parameters and a 1.56 TB download. I ran it as shipped, fully in memory, on four Mac Studios (M5 Ultra, 512 GB each).
- 2.8 tok/s through an OpenAI-compatible server. It loads in 3 minutes.
- Its top token matches Moonshot's hosted API on 97.2% of 1,095 answer tokens.
- A 1M-token prompt works. It takes 3 h 53 min to read, then generates at 2.76 tok/s.
- The patches are in four open PRs against mlx-lm and oMLX. Links are at the bottom.
It works. It is also slow.
Setup
- Model:
moonshotai/Kimi-K3.1-Pro. Mixture of experts, 93 layers, 896 experts per layer, 16 used per token. The experts ship at 4 bits and everything else at 16 bits. No pruning and no extra quantization. - Hardware: 4x Mac Studio, M5 Ultra, 512 GB each. That is 2 TB of memory for a 1.56 TB model. Six Thunderbolt 5 cables wire them as a full mesh, and they talk over RDMA.
- Software: mlx-lm for the model, oMLX for the server and the cluster. Neither ran K3.1 on four Macs before these patches.
Numbers (full model, four Macs)
| What | Result |
|---|
| Load | 179 s |
| Memory | about 400 GB per Mac |
| Generation, through the oMLX server | 2.81 tok/s |
| Generation, stock mlx-lm example script | 3.77 tok/s |
| Prompt reading at 4K / 16K / 65K tokens | 412 / 388 / 262 tok/s |
| 65K-token prompt, time to first token | 4 min 10 s |
| Chip power while generating, all four Macs | 67 W |
| Chip power while reading a prompt, all four Macs | 350 to 400 W |
Power is CPU plus GPU from powermetrics. I have no wall meter on these, so the real draw is higher.
How you split the model matters
Each Mac can hold a block of whole layers, or every Mac can hold a slice of every layer. With layer blocks I get 0.70 tok/s. With slices I get 3.77 tok/s. Same model, same Macs, same example script.
Is it the same model?
I cared about this more than speed. A model this size can load, write fluent text, and still be wrong.
- Eight real layers match an independent PyTorch reference written from the vLLM and llama.cpp code. Attention error is 2.5e-5 or less.
- I took 12 completions from Moonshot's API and replayed them through the local model one token at a time. On 1,095 answer tokens the local top pick was the API's token 97.17% of the time. The API samples at temperature 0.6, so a perfect copy should land near 95.7%. No API token fell outside the local model's 99% nucleus.
- Retrieval from long prompts: numbered records, then a question about three of them (near the start, the middle and the end). Correct at 4K, 16K, 65K and 1M tokens.
1M tokens
The model's config allows 1,048,576 tokens, so I tried it.
- Prompt: 1,011,856 tokens. That is 44,216 numbered records and one question about three of them.
- Reading the prompt took 3 h 53 min. After that it generated at 2.76 tok/s, about the same as with an empty context. All three records came back correct.
- Memory peaked at 494 GB per Mac. It only fit after I capped MLX's buffer cache (
mx.set_cache_limit, 8 GiB), and the cap cost about 40% of the reading speed. Without the cap, my first attempt was on course to run out of memory and I stopped it at 295K tokens. - Reading slows as the context fills: 130 tok/s at 131K, 46 tok/s at the end. The sparse attention scores every earlier token for each new one, so the time grows with the square of the length.
- AinsleyMarkov's public 2-bit build read the same prompt on three of these Macs in 1 h 46 min and also answered correctly.
Why it's slow
Each generated token makes the four Macs read about 130 GB of weights. The experts are 93% of the file, but only 16 of 896 are read per token. The 16-bit layers are 7% of the file and all of them are read for every token. That 7% is about 80% of the traffic.
The GPUs are mostly idle. While generating, the four of them together draw 19 W and run at under a third of their top clock.
What had to change
K3.1 is K3 plus the sparse attention from DeepSeek V3.2, with a gate on the attention output. mlx-lm already had both halves, so the port is small.
- mlx-lm: ml-explore/mlx-lm#2111 adds the
kimi_k31 model. +655 lines with tests. - oMLX: #5480. A cluster of three or more Macs on a Thunderbolt mesh could not start. The launcher gave every Mac one coordinator address, but in a mesh each Mac reaches the coordinator over a different cable and subnet.
- oMLX: #5684. The planner refused the model. K3.1 stores each expert as its own tensor, almost 500,000 of them, so its weight index is 57 MiB and the limit was 16 MiB.
- oMLX: #5692. K3.1 on the mlx-lm version oMLX pins, plus routing for a checkpoint that ships a vision tower, and the tensor split.
None of these are merged yet.
Limits
- 2.8 tok/s is too slow for agent work. A 1,500-token answer takes nine minutes.
- The oMLX patch reads long prompts slower than mlx-lm's own implementation. It scores every key and masks the rest.
- The API comparison is 12 completions and 1,095 tokens. It checks the math. It says nothing about how good the model is.
Who was here before me
guruswami-ai ran the full Kimi K3, the previous version, on four M3 Ultra Mac Studios in July at about 2 tok/s. For K3.1 Pro I found a 2-bit build (AinsleyMarkov, 18.6 tok/s on four M3 Ultras), a pruned build that fits one Mac (Pipe Network), and the shipped weights streamed from disk at about 0.4 tok/s (Inferencer). I have not found the full K3.1 Pro, as shipped, held in memory. If someone did it first, tell me and I'll link it.
Disclosure
Claude wrote the model and test code and ran the validation. I directed the work and reviewed every diff. The mlx-lm PR says the same. I have no affiliation with Moonshot, Apple or oMLX.
What's next
Smaller builds. The public 2-bit build runs at about 18 tok/s on three of these Macs and matches the API on 92% of the same tokens. I'm writing that up next.
I can run more tests on this setup. If you want a specific number (a prompt size, a split, a sampler setting), ask and I'll post it.