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
H["h 7168"] --> R["router<br/>sigmoid + bias"]
R --> DN["down to latent<br/>3584"]
DN --> E16["16 experts<br/>SiTU-GLU"]
E16 --> NRM["RMSNorm the<br/>AGGREGATE"]
NRM --> UP["up to 7168"]
H -.->|"unweighted"| SH["2 shared experts"]
SH --> UP
style H fill:#E4ECF3,stroke:#5C7C9B,color:#3B372F
style R fill:#EAE4F1,stroke:#7E6E9C,color:#3B372F
style DN fill:#F2E9D4,stroke:#C0913E,color:#3B372F
style E16 fill:#F4E7D3,stroke:#C07A42,color:#3B372F
style NRM fill:#F3E3EB,stroke:#B06885,color:#3B372F
style UP fill:#E7ECDD,stroke:#6E9160,color:#3B372F
style SH fill:#DDEBE7,stroke:#4E8E86,color:#3B372F