# kimi-k3-in-c

A portable C99 inference engine that runs the 2.78-trillion-parameter Kimi K3 model on a single CPU with no GPU, BLAS library or ML framework.

kimi-k3-in-c is a from-scratch C99 implementation that runs inference for the 2.78-trillion-parameter Kimi K3 model on ordinary CPU hardware, with no BLAS library, ML framework or GPU. The engine itself is 176 KB, and the model's 1.56 TB checkpoint streams from disk during generation on machines with less RAM than the checkpoint's size.

On an 8 GB laptop it produces about 26.5 seconds per token, reading the model from disk on every step; more RAM lets more of the model stay resident in memory, cutting time per token to roughly 5.6 seconds on a machine with 128 GB or more, while producing the same, byte-identical output regardless of hardware. A companion preset system (laptop, server, and others) selects how much of the model to keep in memory.

It ships as a command-line binary with batch and incremental generation modes, and an interactive REPL for multi-turn, chat-capable use of the official Kimi K3 checkpoint.

Website: https://medium.com/@fareedkhandev/building-kimi-k3-in-c-to-run-a-2-8t-model-on-consumer-hardware-a5792cbf3b59
