Running Kimi K3 in Pure C99: Low-Config Inference on 8GB RAM
FareedKhan557 · reddit · 2026-08-02
To experiment with massive models locally, a developer built a minimalist inference engine in pure C99 for the 1.56TB Kimi K3 model, successfully running it on a single CPU with just 8GB of RAM.
Core Implementation:
- On-Demand Loading: 93% of K3's parameters are routed experts, and only 16 out of 896 experts fire per token. Thus, expert layers are never resident in memory; they are read directly from NVMe on demand.
- No Dequantization: The packed 4-bit weights are multiplied straight out of their packed form without a dequantization step. The dense trunk is packed into a single file, streamed layer by layer using known offsets.
Performance:
- On a dual EPYC 7763 machine, peak memory usage was limited to 8.24GB, achieving 33 seconds/token.
- Allocating 128GB of memory maxed out the speed at 20 seconds/token, with byte-identical output across all memory budgets.
The author admits this isn't practical for serving (requiring 1.7TB of disk and being very slow), but was built purely to understand the MoE architecture by implementing it. The project uses no BLAS or frameworks, achieving this with just six C files and a 176KB binary.
Related event: Open-source engines run Kimi K3 on low-end devices(7 posts)→
More from Infra
- Data centers cluster in America's richest counties, chart shows — sudoraohacker · 2026-12-02
- Fully open-source FPGA toolchain lands for the $4 Vicharak Shrike board — Obijuan_cube · 2026-12-02
- Running torch nightly with CUDA 13.5 on 8x V100 via volta-forever, agent-driven setup — QuixiAI · 2026-12-02
- DeepSeek's Claimed 83.4% Ascend 950DT Margin Debunked: Losing ¥36.6/Hour at 60% Utilization — teortaxesTex · 2026-12-02
- One number = +27%: raising MLX's 20-op CUDA graph cap on DGX Spark boosts Qwen3 to 430 tok/s — AIFlow_ML · 2026-12-02
- Polymarket: Jensen Huang admits under oath Nvidia AI chips were diverted to China — Polymarket · 2026-12-02