This file runs Moon-Beam-8B-A1B-Preview, an 8B mixture-of-experts model, at 3.5 tok/s on a 2013 iPad Air. The iPad has an Apple A7 (2 cores, no dotprod), 1 GB of RAM, and runs iOS 12.5.7 (jailbroken). Stock llama.cpp can't even load the model there: iOS 12 lets a process map at most about 1.7 GB, and the file is 2.75 GB. It is laid out so that only the first 474 MB is mapped. Each layer keeps 14 experts in RAM and reads the others from flash when the router picks them.
From the 🤏 smolmaxxing project. The full write-up is in EXPERIMENT.md §21.8-21.10. It's made from the TV-box file in hyperionaidev/Moon-Beam-8B-A1B-tvbox-GGUF, through the experts-last file in hyperionaidev/Moon-Beam-8B-A1B-ipad-xl-GGUF, which keeps the stock Q2_K layout.
⚠️ This file needs the patched llama.cpp from the smolmaxxing repo (the iOS 12 patch, see Run). It has a pruned output head (60,000 of 157,184 vocabulary rows plus an
output_idstensor), and its experts are repacked for the iPad's lookup-table kernel: to any other llama.cpp they are scrambled Q2_K and the output is garbage. Stock llama.cpp, LM Studio and Ollama will not run it correctly.
| File | mb-q2-h60-lut.gguf, 2,753,180,224 bytes (2.75 GB) |
| SHA-256 | acf1cb561a612eca491ef66aa9b60abb8ed9c84a56a89392902daa413694b976 |
| Made from | mb-q2-h60-xl.gguf with tools/gguf_q2lut.py |
| Layout | experts last; each expert's Q2_K blocks regrouped as 16 rows × 256 columns for a vqtbl1q lookup-table kernel (key ipad.expert_layout = "q2lut"), same size, same offsets |
iPad speed against the -xl file (top-4 prefetch, same settings) |
3.06 vs 2.94 tok/s |
What's inside, as in the TV file:
data/head-ids-ling-60k.txt). Prompts can use every token, but the model can only generate tokens in the head.Repacking the experts for the lookup-table kernel changes perplexity by +0.1 % on the full eval text against the stock kernel (E151).
Speeds are on a 220-token story prompt, with pool 14, prefetch and frequency-based eviction. Perplexity is on the Mac, over 3,072 tokens, one token at a time like generation, against 18.62 for 8 experts and no bias.
| Experts per token | Cache bias | iPad tok/s | Perplexity | vs 8 experts |
|---|---|---|---|---|
| 8 (recommended) | 0.03 | 3.47-3.60 | 18.52 | ±0 |
| 7 | 0.05 | 4.02-4.04 | 18.70 | +0.4 % |
| 6 | 0.05 | 4.32 | 19.33 | +3.8 % |
| 5 | 0.03 | 4.54 | 20.54 | +10 % |
| 4 | 0.03 | 4.92-5.12 | 23.60 | +27 % |
This model is the 8B MoE row: stock llama.cpp can't load it, the first pager run did 1.6 tok/s, and it now does 3.5.
On a jailbroken iOS 12 device:
1945793 with ipad-air/patches/llama.cpp-ios12.patch applied, using ipad-air/build.sh from the repo. ipad-air/README.md has the steps: Xcode 15.4's iPhoneOS SDK, signing with ldid -Sent.xml, and SSH over USB.GGML_MOE_PAGER=1 GGML_MOE_POOL=14 GGML_MOE_BIAS=0.03 GGML_MOE_PREFETCH=1 GGML_MOE_LFU=0.95 \
./smolchat -m mb-q2-h60-lut.gguf -c 512 -b 64 --no-think --repeat-penalty 1.15 --repeat-last 256
# faster: add --experts 7 (about 3.8 tok/s; 4.0 with GGML_MOE_BIAS=0.05) or --experts 6 (about 4.2-4.3); --experts 4 reaches 5 tok/s at +27 % perplexity
Settings:
GGML_MOE_POOL: experts kept in RAM per layer.GGML_MOE_PREFETCH=1: reads the next layer's likeliest experts early.GGML_MOE_LFU=0.95: evicts the least frequently used expert, with recent uses counting more. About 9 % fewer reads than least recently used.GGML_MOE_BIAS: how strongly routing prefers experts already in RAM.GGML_MOE_STATS=1: prints hits, misses and flash time at exit.The experts-last file without the repack is hyperionaidev/Moon-Beam-8B-A1B-ipad-xl-GGUF. It runs with the same command and patch, about 4 % slower.