llm.asm
by Alexey Fateev · Runtime · Text & code
Runs a small Qwen language model for text generation on a plain x86-64 CPU, written in assembly with no libraries, either as a Linux program or a bootable bare-metal OS.
Impressive assembly demo of a tiny model; speed lead over llama.cpp is self-reported
Latest · Nov 26Open repo with 12 KB Qwen3-0.6B inference, bootable bare-metal OS and Mini-GPT trainer with Braille TUI, all in NASM assembly with no libc; includes ISO builder and Proxmox guide
Why we say so
Alexey Fateev (alesha-pro) reports Qwen3-0.6B decode beating llama.cpp by 18-36% on an AMD EPYC 7642, with about 10% more on bare metal, and says prefill is slower and not compared. Hacker News saw little practical use for such a small model and doubted that llama.cpp is beaten so easily, but nobody has published a rerun of the benchmark.
Evidence
- Nov 26Qwen3-0.6B inference in x86-64 assembly with no libc, plus a bootable bare-metal OSMaker's claimalesha-provia
Hacker NewsAlexey Fateevvia
rahlquist - Nov 2614.7 KB Linux ELF build (FAST_Q8=1, INT8xINT8 AVX2+F16C) beats llama.cpp by 18% to 36% from 1 to 40 threads; bare metal with 2 MiB huge pages adds about 10%Maker's claimAlexey Fateevvia
rahlquist - Nov 25README reports CPU decode of Qwen3-0.6B Q8_0 on AMD EPYC 7642 at 20.70 vs 16.63 tok/s with 1 thread, and 125.86 vs 105.08 with 40.Maker's claimalesha-provia
Hacker News - Nov 25README says prefill is token-by-token GEMV, while llama.cpp uses batched GEMM, so the comparison is for decode only.Maker's claimalesha-provia
Hacker News - Nov 25Bare-metal OS build reportedly boots in 74–94 ms and decodes about 134.9 tok/s on KVM with 16 vCPUs on EPYC; needs AVX2, FMA and F16C.Maker's claimalesha-provia
Hacker News
Show all 7
- Nov 25Commenters see little practical use for such a small model without an agent harness, and little gain for large models where OS overhead is minor.Community report
Hacker News - Nov 25A commenter notes the bare-metal setup runs on the CPU only, and another asks whether llama.cpp is really that optimized, given many projects claim to beat it.Community report
Hacker News