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<br/>The capital of France is"] --> E["tokenize<br/>5 ids"]
E --> F["93 layers<br/>69 KDA + 24 MLA"]
F --> L["163,840 logits<br/>one per token"]
L --> A["argmax<br/>17374"]
A --> D["decodes to<br/>Paris"]
L -.->|"greedy only,<br/>no sampling"| X["the other 163,839<br/>are discarded"]
style P fill:#ECE8E0,stroke:#8C8477,color:#3B372F
style E fill:#E4ECF3,stroke:#5C7C9B,color:#3B372F
style F fill:#F2E9D4,stroke:#C0913E,color:#3B372F
style L fill:#F4E7D3,stroke:#C07A42,color:#3B372F
style A fill:#EAE4F1,stroke:#7E6E9C,color:#3B372F
style D fill:#E7ECDD,stroke:#6E9160,color:#3B372F
style X fill:#DDEBE7,stroke:#4E8E86,color:#3B372F