Inference engine that runs a 397B-parameter Mixture-of-Experts model on a MacBook by streaming experts from SSD.

CCM score
48 of 100
skills.sh installs
1.1K
GitHub stars
98
last updated
Jul 14, 2026
View on GitHub

Own this skill? Claim it

What it does

  • Covers building and running Qwen3.5-397B-A17B in pure C, Objective-C, and hand-tuned Metal shaders, with no Python runtime
  • Includes infer, chat, and main binaries, weight extraction and 4-bit/2-bit expert repacking scripts, and a tokenizer
  • Loads only the 4 active experts per layer via parallel pread(), requiring 48GB+ unified memory and about 210GB free disk
  • Designed for Apple Silicon Macs on macOS 26+ that need to run very large models locally

Install

$ npx -y skills add reason-machines/trending-skills --skill flash-moe-inference -y

Installs into .agents/skills for every agent it finds here, and .claude/skills for Claude Code.

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

Details

Repository
github.com/reason-machines/trending-skills
Category
AI Agents & LLM Apps
First seen
Apr 16, 2026

More from reason-machines/trending-skills

All 163

Similar to Flash Moe Inference

More AI Agents & LLM Apps