All three subprojects of llm.asm are written entirely in x86-64 NASM assembly: a 14,712-byte static Linux program that runs Qwen3-0.6B (Q8_0) for single-shot generation and multi-turn conversations with KV cache retention; a 24,252-byte bare-metal system that boots directly into Qwen3-0.6B chat without installing Linux or Windows, which can be packaged as an ISO to launch in QEMU or Proxmox; and a 32,944-byte Mini-GPT trainer featuring full backpropagation, AdamW, and real-time loss curves in the terminal. The author claims that decoding on AMD EPYC 7642 is 18%–36% faster than the CPU version of llama.cpp, with 64 greedy tokens matching PyTorch FP32 exactly.
Why it matters Without relying on C libraries or any runtime, the math kernels, tokenizer, and thread pool are all hand-written assembly, making it suitable for understanding exactly what is being computed at each step of inference and training.
Stars 155 (+44 / 24h)
Reasons
- 44 new stars in 24 hours, total stars 155 (indicating attention only); MIT license, created on 11 25
- The README provides a line-by-line comparison with llama.cpp by thread count, lists the test machine model, and includes numerical validation against PyTorch
Usage
- Linux x86-64, CPU supporting AVX2 + FMA + F16C; after installing nasm, git clone the repository and run make all; before inference, use the Python script in the repository to export Qwen3-0.6B weights to .asmbin, then run ./build/asm-llm -m <model_file> --chat
Risks
- Supports only x86-64 Linux (the bare-metal version requires QEMU/KVM or a virtual machine), and runs only the Qwen3-0.6B model; speed comparisons cover only decoding, whereas llama.cpp uses batched computation during the prefill stage
- The repository was created just one day ago, and all performance figures are self-tested by the author