Qwen3-0.6B inference engine, bootable bare-metal LLM OS and Mini-GPT trainer written in pure x86-64 NASM assembly with no libc
- Language
- Assembly
- License
- MIT
- Stars
- 1.6K
- Try it
git clone https://github.com/alesha-pro/llm.asm.git && cd llm.asm && make all
llm.asm is a new open-source project that runs Qwen3-0.6B, Alibaba's smallest Qwen3 chat model, from a program written entirely in x86-64 assembly language, with no C, no standard library and no runtime dependencies. A second part of the project boots the same model as a tiny operating system of its own, with no Linux or Windows underneath. The repository, alesha-pro/llm.asm, was created on November 25 by Alexey Fateev and is MIT-licensed. GitHub's API showed 1,633 stars and 245 forks when we checked at about 04:00 UTC on November 27.
Why it matters: most local AI runs on large stacks such as llama.cpp, PyTorch or Ollama. llm.asm is a rare complete, readable example of everything a small language model needs, from the tokenizer to the attention maths to the thread pool, done at the lowest level a programmer can work at. It is also a fast-rising repo. Trendoday estimated it gained about 583 stars in 24 hours and ranked it as high as #2 on its "rising today" list early on November 26.
What's in the repo
The README calls it a trilogy. We read the README files and source tree from a clone of the repository (latest commit 48feccb, November 25). The repo has three commits, all on its first day.
| Part | What it does | Binary size (README) |
|---|---|---|
| 01-qwen3-inference | Linux command-line chat with Qwen3-0.6B, including a multi-turn mode | 14,712 bytes (default fast build); 14,008 bytes (original exact mode) |
| 02-baremetal-os | Bootable kernel that loads the model and opens a chat prompt on screen or serial port | 24,252 bytes |
| 03-minigpt-train | Trains a small GPT on text from scratch, with a live text-mode loss chart | 32,944 bytes |
The README puts the total at 17,252 lines of hand-written assembly. Our own count of the .asm and .inc files in the clone came to about 17,200, close enough to support the claim.
The program sizes don't include the model. The weights are converted once, with a Python script, into a roughly 614 MiB file that the program loads into memory. Only that one-time conversion needs Python and NumPy.
The size claim, corrected
The repository's tagline and first commit say 12 KB for the inference engine and 22 KB for the OS. A later commit on the same day added a faster integer maths path, and the current README lists 14,712 bytes and 24,252 bytes for the default builds. Fresh Weights' headline repeats the old 12 KB figure. Either way, almost all of the memory a user needs goes to the model weights.
The speed claims
The README's headline benchmark compares llm.asm with llama.cpp, the most widely used local inference engine, running the same model at 8-bit (Q8_0) on CPU only.
| Threads | llama.cpp (README) | llm.asm fast build (README) |
|---|---|---|
| 1 | 16.63 tok/s | 20.70 tok/s |
| 8 | 80.79 tok/s | 103.64 tok/s |
| 16 | 103.03 tok/s | 121.86 tok/s |
| 40 | 105.08 tok/s | 125.86 tok/s |
Put that in context before quoting it:
- One machine, one model, the author's own run. All the numbers come from an AMD EPYC 7642 server, with 34 prompt tokens and 64 generated tokens, averaged over three runs. None of the pages we read reported anyone else reproducing them. Fresh Weights says Hacker News commenters compared it with llama.cpp but gives no results. We could not read that thread.
- Generation speed only. The README itself notes that llama.cpp processes the prompt in batches, while llm.asm handles it one token at a time. The comparison covers token generation, not prompt processing, which matters more for long inputs.
- A different number format. llm.asm's fast build converts activations to 8-bit integers. The README reports a 0.9997 cosine similarity and 64 of 64 identical greedy tokens against a full-precision PyTorch reference. That is close, but it isn't the same calculation llama.cpp runs.
- For the OS, the README claims a 74–94 ms boot to the chat prompt and 134.9 tokens per second on a 16-core KVM virtual machine. It also claims 55.4 tokens per second on a 12-core Xeon virtual machine in Proxmox, booted from an ISO with no disk.
Who can run it
- x86-64 only, with AVX2, FMA and F16C. That means an Intel Haswell or AMD Excavator chip or newer. It won't run on Apple Silicon Macs or Arm machines.
- Linux for the inference and training programs, because they call the Linux kernel directly. The OS needs QEMU/KVM, another hypervisor or a real PC. Building the bootable ISO needs GRUB tools.
- One model. The engine is written for Qwen3-0.6B's exact layout. It isn't a general model loader.
Fresh Weights calls it "a striking demo rather than a production engine." That's fair. Unlike much AI tooling, though, it is small enough to audit line by line.
What to watch
The repo is two days old, has three commits and no releases, and had 17 open issues and pull requests on November 27. The things to look for next are independent benchmark runs on other CPUs, especially consumer desktop chips. Also watch whether prompt processing gets the same treatment as generation. Hobbyists can try the OS in QEMU without touching their main system. Anyone who wants a local chatbot for daily use is still better served by llama.cpp or Ollama.
Sources
- GitHub — alesha-pro/llm.asm (README, per-phase READMEs, LICENSE, commit history) github.com
- Trendoday — alesha-pro/llm.asm trending stats trendoday.com
- Fresh Weights — llm.asm: Qwen3 inference and a bootable OS in 12 KB of pure assembly freshweights.com
- MindPattern — llm.asm boots Qwen3-0.6B as its own operating system from a 24 KB kernel mindpattern.ai