
Flash Moe Inference
This is a pure C/Metal inference engine that runs Qwen3.5-397B (397B parameters, 209GB on disk) on a MacBook Pro with 48GB RAM at 4.4 tokens per second. It streams expert weights from SSD on demand using parallel pread calls, no Python or ML frameworks at runtime. The repo includes hand-tuned Metal shaders with fused dequantization FMA kernels and uses Accelerate BLAS for the GatedDeltaNet attention layers. You'll need an M3 Max or similar, 1TB SSD, and patience for the weight extraction and repacking process. There's an optional 2-bit quantization path that's faster but breaks tool calling. This is what happens when someone decides PyTorch is too slow and writes 7000 lines of Objective-C instead.
- skills.sh installs
- 1.1K
- GitHub stars
- 61
- last updated
- Jul 14, 2026
Install
$ npx -y skills add aradotso/trending-skills --skill flash-moe-inference --agent claude-codeInstalls into .claude/skills of the current project.
Files
Flash-MoE Inference Engine
Skill by ara.so — Daily 2026 Skills collection.
Flash-MoE is a pure C/Objective-C/Metal inference engine that runs Qwen3.5-397B-A17B (397B parameter Mixture-of-Experts) on a MacBook Pro with 48GB RAM at 4.4+ tokens/second. It streams 209GB of expert weights from NVMe SSD on demand — no Python, no ML frameworks, just C, Objective-C, and hand-tuned Metal shaders.
Requirements
- Hardware: Apple Silicon Mac (M3 Max or similar), 48GB+ unified memory, 1TB+ SSD with ~210GB free
- OS: macOS 26+ (Darwin 25+)
- Tools: Xcode Command Line Tools, Python 3.x (for weight extraction only)
- Model: Qwen3.5-397B-A17B safetensors weights (download separately from HuggingFace)
Installation & Build
# Clone the repo
git clone https://github.com/danveloper/flash-moe
cd flash-moe/metal_infer
# Build everything
make
# Verify build artifacts
ls infer chat main
The Makefile compiles infer.m, chat.m, main.m with Metal shader compilation for shaders.metal.
Weight Preparation
Step 1: Extract non-expert weights
Sponsors
Details
- Repository
- github.com/aradotso/trending-skills
- First seen
- Apr 16, 2026
More from aradotso/trending-skills
All 251- Ghostling Libghostty Terminal1.1K
- 724 Office Ai Agent1K
- Claude Peers Mcp1K
- My Brain Is Full Crew1K
- Weixin Agent Sdk1K
- Dingtalk Workspace Cli941
- Polymarket Arbitrage Trading Bot927
- Awesome Phd Cv916
- Web Access Claude Skill916
- Weclaw Wechat Ai Bridge911
- Awesome Free Llm Apis904
- Cc Connect Ai Bridge884
- Filmkit Fujifilm Camera879
- Opencli Rs Web Scraper874
- Vercel Labs Emulate873
- Creationix Rx Data Store862
- Agent Flow Visualization840
- Microsoft Rust Training837
- Tg Ws Proxy Telegram Socks5837
- Wewrite Wechat Ai Publishing836
- Jkvideo Bilibili React Native835
- Ai Scanner Garak834
- Bazi Skill Chinese Astrology833
- Career Ops Job Search830