A 2.78-trillion-parameter Kimi K3 running inference on a single CPU in 8.24 GB of RAM. Portable C99: no BLAS, no framework, no GPU.
C avx2c99cpu-inferencedeep-learningfrom-scratchinference-enginekimi-k3linear-attentionllmllm-inferencemachine-learningmemory-efficientmixture-of-expertsmoemxfp4quantizationsimdsystems-programmingtransformerzero-dependencies
flowchart LR
P["prompt"] --> PF["step 0: prefill<br/>53 s, 89 GB read"]
PF --> ST["step n: one token<br/>8.9 s, 25.83 GB"]
ST --> TOK["append id"]
TOK --> ST
ST --> TXT["decode at the end<br/>never mid-token"]
style P fill:#ECE8E0,stroke:#8C8477,color:#3B372F
style PF fill:#F5E2DB,stroke:#B75845,color:#3B372F
style ST fill:#E4ECF3,stroke:#5C7C9B,color:#3B372F
style TOK fill:#F2E9D4,stroke:#C0913E,color:#3B372F
style TXT fill:#E7ECDD,stroke:#6E9160,color:#3B372F