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["1. project<br/>q k v beta z"] --> C["2. ShortConv<br/>+ SiLU"]
C --> N["3. L2Norm<br/>q and k only"]
N --> B["4/5. beta<br/>and decay"]
B --> R["6. recurrence<br/>per head"]
R --> G["7/8/9. norm,<br/>gate, project"]
R -.->|"state carried"| S["one matrix<br/>per head"]
style P fill:#ECE8E0,stroke:#8C8477,color:#3B372F
style C fill:#E4ECF3,stroke:#5C7C9B,color:#3B372F
style N fill:#F2E9D4,stroke:#C0913E,color:#3B372F
style B fill:#F4E7D3,stroke:#C07A42,color:#3B372F
style R fill:#EAE4F1,stroke:#7E6E9C,color:#3B372F
style G fill:#E7ECDD,stroke:#6E9160,color:#3B372F
style S fill:#DDEBE7,stroke:#4E8E86,color:#3B372F