Helldez/BigMoeOnEdge
Run MoE models bigger than your RAM. Frontier-size MoE on a phone, laptop, edge. Lossless, on stock llama.cpp. An adaptive streaming optimizer. Any hardware, any OS, any model, any quantization, behind a local OpenAI-compatible server.
BigMoeOnEdge — Run AI models too big for your device
What it is. A tool that lets you run Mixture-of-Experts (MoE) AI models that are larger than your device's memory. It works on Android phones, iPhones, Macs, Windows and Linux machines. It's built on llama.cpp, a well-known open-source AI engine.
The core trick. MoE models are structured so that for each piece of text they process, they only need a few "expert" sub-models out of many. BigMoeOnEdge keeps the most-used experts in memory and reads the rest from the device's flash storage (like an SSD) on demand. The output is identical to running the whole model in memory — the project's tests verify this.
What you get.
- Models that don't fit: The main selling point. The README shows a 21 GB model running in real time on a 12 GB phone, and a 284B-parameter model (91 GB on disk) running on a 12 GB Android phone at 1 token per second.
- Auto-setup: The
--autoflag measures your machine and model, then picks cache sizes, thread counts, and which device (CPU, GPU, NPU) does what. A "Plan" screen shows each choice and the reasoning. - Works with any MoE model: As long as it's in GGUF format (the standard llama.cpp format), any quantization, no per-model code needed.
- Many hardware backends: CPU, Metal (Apple), CUDA (NVIDIA), HIP (AMD), Vulkan, OpenCL, and Qualcomm's Hexagon NPU. On a graphics card, the most-used experts stay in its VRAM.
- Apps and a server: A desktop app, phone apps, and a server that speaks the OpenAI and Anthropic APIs — so coding agents like opencode, Claude Code, and Codex CLI can use it.
- Vision: If you place a model's projector file (
mmproj) next to it, the server can read images through any API, and the CLI supports--mmprojand--image.
Performance examples (from the README's table):
| Hardware | Model | Decode speed |
|---|---|---|
| 12 GB Android phone | 284B model (91 GB on disk) | 1 tok/s |
| 12 GB iPhone | 21 GB model | 3 tok/s |
| 16 GB Apple laptop | 21 GB model | 18–24 tok/s |
| 24 GB NVIDIA GPU + 96 GB RAM | 125B model | 70 tok/s |
| 24 GB NVIDIA GPU | 21 GB model (fits in GPU) | 217 tok/s |
How it works. For each token, the model's router picks a few experts. The engine looks for them in three tiers, each a cache for the one below:
- VRAM (graphics card memory): weights every token reads, plus the most-used experts.
- RAM: a cache of experts; also holds the always-needed weights if there's no GPU.
- Flash (the drive): the entire model.
If an expert is missing from VRAM, it's copied from RAM; if missing from RAM, it's read from flash. On phones and Apple-silicon Macs, the GPU shares RAM with the CPU, so there are only two tiers. Streaming only reads from the drive, so it doesn't wear it out.
The planner. Reads the model's header and measures your machine — memory, storage speed, each CPU, GPU, and NPU. Its rules don't name specific devices, so the same code produces different plans for a phone vs. a desktop. Values you set yourself are respected.
Installation. Pre-built packages for macOS (a .dmg), Windows (a setup exe, no admin rights), Linux (an AppImage), and Android (an APK). iOS requires building from source with Xcode (experimental). Command-line tools can be installed via a one-line curl or PowerShell script.
Usage examples.
bmoe-cli -m model.gguf --auto -p "Explain MoE routing." # plan and run
bmoe-server -m model.gguf -c 32768 # server + web UI on port 8765
The server supports streaming, tool calls, and reasoning. You can register it as a login service so it starts with your machine and reloads its model when a request arrives.
Coding agents. The README shows config snippets for opencode, Claude Code, and Codex CLI pointing at the local server. The desktop app also has its own built-in agent that works in a folder you choose — it reads/edits files, runs commands, and asks before changing anything unless you allow it.
Comparison to alternatives. The README's table claims advantages over Strata, ds4, colibri, and KTransformers: phone support (including NPU), iPhone support, any MoE model in GGUF (vs. only a few models for others), and self-configuration. It also notes where it's slower: on a gaming GPU with enough RAM, Strata is 2–4× faster; when streaming from flash, all engines are in single digits and the drive sets the pace.
Building from source. Clone with --recursive, build the UI with npm, then run a build script. A llama.cpp backend is a CMake flag passed through (e.g., -DGGML_VULKAN=ON). Tests run via ctest.
License. Apache-2.0. The binaries also bundle llama.cpp, ggml, and other libraries under MIT, BSD, Apache-2.0, and SIL OFL 1.1 licenses.
Prior art. The README credits AirLLM, Apple's "LLM in a flash," FlexGen, PowerInfer, EdgeMoE, and flash-moe as inspirations.
Related
- Project
- Dispatch
- Project
- Project
- Project