FareedKhan-dev/kimi-k3-in-c ? reverse-engineered prompt

Reverse engineered prompt

Build me a fast but very small C app that can run Kimi K3 style model inference on a single Linux CPU, even on around 8 GB of RAM, with no GPU and no extra ML framework.

I want it written in portable C99, with AVX2 support where available, and it should be able to load a huge checkpoint from disk, keep only the important parts in memory, and stream the rest so the memory use stays low. It should include a simple command line tool that can take a prompt, generate text, and print basic timing and memory stats.

Please also add the tokenizer, config reading, a few example commands, and a test suite that proves the outputs stay consistent across different memory budgets. If you need to check current implementation details or docs for any tricky parts, look them up online and keep the code clean and self contained.

Are you gonna build this?

make sure you review the code using coderabbit

Try freeSponsored — opens CodeRabbit in a new tab