llm.asm: Qwen3 inference and Mini-GPT training in pure x86-64 assembly
llm.asm is a set of dependency-free programs written in x86-64 NASM assembly that run the Qwen3-0.6B language model, boot it on bare metal, and train a small GPT model from scratch.
llm.asm contains three programs written in x86-64 NASM assembly, with no C, no libc and no runtime dependencies. The first, asm-llm, runs Qwen3-0.6B from a Q8_0 weight file that a Python script exports from a Hugging Face checkpoint. It offers single prompts and a multi-turn chat mode. According to the README, its CPU decode reaches 126.8 tok/s at 40 threads on an AMD EPYC 7642, and it beats llama.cpp by 18% to 36% across 1 to 40 threads on the same machine. The second phase boots the same model on bare metal, using its own Multiboot loader and SMP setup. The README reports boot times of 74 to 94 ms in QEMU KVM. The third is a Mini-GPT trainer with a live Braille terminal display. The README says it matches PyTorch CPU gradients on all 21 parameter tensors.
Building requires nasm and binutils on a CPU with AVX2, FMA and F16C, and the inference binary runs on any Linux x86-64 kernel. The model weights are not included, so readers must download Qwen3-0.6B and run the export step first. The Mini-GPT run uses TinyShakespeare, and the author reports validation loss falling from 4.19 to 1.51 in four minutes. The repository also holds a fourth project, a Ring -1 hypervisor that runs MiniCPM5-2B. The code is MIT licensed.
In the author's words
Three complete LLM projects written in 100% pure x86-64 NASM assembly.
From the README or the author's post. We checked that the sentence is there, not that it is true.
When to reach for it
The trainer is a useful read for anyone who wants a small, dependency-free reference on how transformer layers map onto SIMD code. It hand-writes the backward pass and checks it against PyTorch. The inference engine can serve as a baseline for comparing a CPU runtime against llama.cpp.
See it
AI wrote this entry from the project's own README or its author's post. What the project does, and that AI built it where the entry says so, are the author's statements, quoted here. Nobody at IKANGAI ran or tested it. How this list is made