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.

unproven

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

AccessOpen codeRuns onLinuxLicenseMIT

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

  1. Nov 26
    Qwen3-0.6B inference in x86-64 assembly with no libc, plus a bootable bare-metal OS
    Maker's claimalesha-proviaHacker NewsAlexey Fateevviarahlquist
  2. Nov 26
    14.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 Fateevviarahlquist
  3. Nov 25
    README 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-proviaHacker News
  4. Nov 25
    README says prefill is token-by-token GEMV, while llama.cpp uses batched GEMM, so the comparison is for decode only.
    Maker's claimalesha-proviaHacker News
  5. Nov 25
    Bare-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-proviaHacker News
Show all 7
  1. Nov 25
    Commenters 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 reportHacker News
  2. Nov 25
    A 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 reportHacker News

Everything said about llm.asm, on the wire

Cost to run

Alternatives

More llm.asm
Works with
Made for llm.asm