DeepSeek-V4-Flash has 284 billion parameters and takes up about 160GB on disk. My laptop does not have 160GB of RAM. It doesn't even have 32GB.

It ran the model anyway. Peak memory: 3.23GB. With a GPU and a bit more headroom, it generates at 1.6–1.7 seconds per token. No quantizing the model down to fit, no renting a multi-GPU box. Just C99, streaming weights off NVMe as they're needed.

This post is about how deepseek-v4-in-c actually works, and — more usefully — about three bugs I hit building it that taught me more than the parts that went smoothly.

The trick that makes this possible at all

DeepSeek-V4-Flash is a mixture-of-experts model: 256 experts per layer, 43 layers, but only the top 6 experts per layer actually fire on any given token. That's the whole game. You don't need 160GB resident in memory — you need whatever fraction of the checkpoint this specific token's routing decisions touch, which works out to about 3.2GB per forward pass.