Kimi K3 in C is a portable C99 inference engine built to run the 2.78-trillion-parameter Kimi K3 model on CPUs without BLAS, machine-learning frameworks, or GPUs. It demonstrates inference from a roughly 1.56 TB checkpoint with measured memory use as low as 8.24 GB. The runtime streams model trunk layers and routed experts from disk instead of keeping all weights resident in memory. Memory presets balance pinned layers and an expert LRU cache for laptops, desktops, workstations, and servers. Incremental generation preserves KV cache and recurrent state between tokens. The repository also includes tokenization, safetensors loading, diagnostics, benchmarks, trace replay, and comparisons against a PyTorch reference.
Features
- Portable C99 CPU inference engine
- Disk-streamed model layers and experts
- Low-memory execution starting near 8 GB
- Configurable memory and caching presets
- Incremental KV and recurrent-state generation
- Benchmarks and PyTorch reference validation