llm.asm implements Qwen3 inference, bare-metal OS boot, Mini-GPT training, hypervisor, and eBPF components in NASM assembly with no libc. Binaries are measured in tens of kilobytes.
Overview
llm.asm is a collection of low-level projects for running and training small language models entirely in x86-64 NASM assembly, without C, libc, or conventional runtime dependencies. Phases include a static Qwen3-0.6B inference binary, a bootable bare-metal OS that runs the same model, a Mini-GPT trainer with a Braille TUI, a Ring -1 hypervisor experiment, Linux eBPF LSM hooks, and a larger zero-application OS demo.
Weights are exported to a custom .asmbin format from Python tooling. Build flows include make targets, ISO builds for USB boot, and QEMU or KVM testing. CPU features such as AVX2, FMA, and F16C are required for main paths, with SSE2-only bare-metal builds available separately.
Benchmarks compare decode throughput against llama.cpp on CPU and report parity checks against PyTorch for inference and training steps. The work targets researchers and systems programmers exploring minimal ML stacks rather than a typical application server.
Quick-start commands run compiled binaries from the build directory after exporting model weights locally.
Key features
- Qwen3-0.6B static ELF inference binary
- Bootable bare-metal OS with LLM
- Mini-GPT trainer with terminal UI
- Ring -1 hypervisor and eBPF LSM phases
- Custom .asmbin weight container
- AVX2-focused CPU kernels
- Verification harnesses vs PyTorch
- USB-bootable hybrid BIOS and UEFI ISO path
Use cases
- Experiment with tiny assembly LLM inference
- Boot a diskless OS that runs a local model
- Compare CPU decode speed to llama.cpp
- Study from-scratch transformer training loops
- Explore hypervisor and eBPF ML security demos