Tarek Ziadé published a Hugging Face blog post on November 18, 2026 describing how he made Transformers run a model that does not fit in memory by streaming its mixture-of-experts (MoE) weights from an SSD. His target was Qwen3.8-Flash-Next, a roughly 180B-parameter model with 48 layers of 512 experts (10 active) and 121 GB of experts in FP8, on a MacBook with an M5 chip and 32 GB of unified memory.
The key idea is a slot pool: one preallocated device tensor shared by all layers, plus a per-layer table from expert id to slot. Remapping the router’s expert ids to slots lets the existing grouped_mm kernel run on the pool without a custom expert matmul. On the small OLMoE-1B-7B test model this reached 34.6 tokens per second against 38.1 for vanilla Transformers. The feature is an experts_offload option for from_pretrained in the open pull request huggingface/transformers#50717; the post says the API is still being discussed with the maintainers.
For the large model the experts are quantized to 3 bits (49 GB on disk, a 12 GiB cache on the device), the dense layers to 8 bits, and a 51 GB n-gram table stays on disk. Conversion takes about five hours, and the post reports roughly 18 GiB in use after loading and 25.4 GiB at the peak on a 6K-token prompt. The first version decoded at about 10 tokens per second against 14.8 for Strata, an inference engine that does similar expert offloading. After optimizations, including Metal kernels and switching to Strata’s GGUF weights, the post reports decode of 13.9 against 14.8 tokens per second, prefill of 228 against 220 tokens per second on a 4K prompt, and 12.4 against 13.7 tokens per second decoding after a 6K document. These are the author’s own measurements on one machine, and he notes the speed is still too slow for how he uses coding agents. He also says the code was written with AI assistance.
Source: Hugging Face.