▲ 1.4k today1.4k starsAssemblyNew · 1d old
LLM Inference and Trainer Written Entirely in x86-64 Assembly
What is llm.asm?
It provides a Qwen3-0.6B inference binary, a bootable OS that runs the model, and a Mini-GPT trainer, all written in pure NASM assembly with no C or libraries. The binaries are under 35 KB, run on standard x86-64 CPUs using AVX2/FMA, and include a Braille-style TUI for training.
Who it is for
Assembly enthusiasts and low-level AI developers should care because it shows you can run and even train LLMs without any high-level language or OS dependencies.
How llm.asm works
The repository contains three programs written entirely in NASM x86-64 assembly and linked with ld. A shared core supplies raw Linux syscalls, SIMD math kernels, an AVX2/FMA GEMM engine, a BPE tokenizer and a clone/futex based thread pool. The inference binary loads a quantized Qwen3-0.6B model, creates a contiguous KV cache and runs the transformer layers with parallel GQA attention. The OS version boots via Multiboot 1, configures long mode, ACPI and APIC, then executes the same transformer core directly on bare metal. The training program uses a register-blocked AVX2 SGEMM, analytical backward pass and AdamW optimizer, all displayed through a Unicode Braille terminal UI.
What you can do with it
- Run Qwen3-0.6B inference on a Linux host with a 14 KB static ELF binary.
- Boot a self-contained operating system that provides a multi-turn chat interface for Qwen3-0.6B.
- Train a Mini-GPT model from scratch on CPU without any Python dependencies.
- Monitor training loss and sample generated text in real time using the Braille TUI.
Good to know
- Requires a CPU that supports AVX2, FMA and F16C instructions.
- Runs only on x86-64 Linux or bare-metal hardware; no support for other architectures or GPUs.
- Provides no standard C library, so only low-level syscalls are available.
Written from the project's own README.
Try it in 60 seconds
You need: Linux system with nasm and ld installed
No one-line install. The README has the setup steps.
MIT licenseUpdated yesterdayAssembly7 open issues
New projects are not vetted. Skim the code, and run it in a fresh folder or a container before giving it your files or keys.
The story so far
Early Signal first spotted alesha-pro/llm.asm on November 26, 2026, when it had 497 GitHub stars. It has since grown to 1.4k, 2.8 times as many. On its busiest day it gained 1,400 stars. The project is 1 day old and written mainly in Assembly. It is published under the MIT license and has 147 forks. Early Signal files it under LLMs, Inference.
Questions about llm.asm
- Is llm.asm free and open source?
- Yes. alesha-pro/llm.asm is open source under the MIT license, and the code is on GitHub at https://github.com/alesha-pro/llm.asm.
- What do I need to run llm.asm?
- Linux system with nasm and ld installed