Imagine turning on a computer and in less than a tenth of a second landing directly inside an AI chat prompt. No Windows desktop, no Linux background services, no Python environment, and no browser eating up your memory. Just pure code talking straight to your processor.
That is the magic behind llm.asm, an open-source project created by developer Alexey Fateev. Written 100% in pure x86-64 assembly language, it strips away almost everything we normally think a computer needs to run AI models
Even if you have never touched assembly code in your life, you can test this on your own machine in about ten minutes. Below is the complete, hype-free guide to setting it up in three simple ways.
What Is llm.asm?
llm.asm is a lightweight, open-source AI inference engine written entirely in x86-64 assembly by Alexey Fateev that runs the Qwen3-0.6B language model without C, Python, or standard system libraries. It compiles into two ultra-small programs: a 14 KB Linux terminal app (asm-llm) and a 24 KB bootable operating system (asm-llm-os.elf) that boots into an AI chat in under 0.1 seconds.
To keep expectations realistic, think of the 24 KB file as the engine, while the AI's "brain" (the converted Qwen3-0.6B model weights) is loaded separately into your RAM and takes up about 614 MB.
5 Quick Rules Before You Start
Before copying a single command, keep these five ground rules in mind so you do not hit a wall later:
It runs one model only:
llm.asmis hardwired for Qwen3-0.6B (a compact 0.6-billion-parameter model). You cannot load Llama, DeepSeek, or giant ChatGPT-sized models into it.Intel and AMD x86-64 CPUs only: Your processor must support AVX2, FMA, and F16C instructions. Apple Silicon Macs (M1 through M4) and ARM devices cannot run it.
Linux is required to build: All build commands are tested on Ubuntu 24.04. If you use Windows, you will need a Linux machine or a virtual machine.
Test inside a Virtual Machine: When the 24 KB OS boots, nothing else runs—no Wi-Fi, no mouse, no desktop. Always test it safely inside QEMU or Proxmox rather than wiping a real PC.
Only use the official repository: Never boot a random
.isofile someone sends you. Always build directly from the official MIT-licensed GitHub repo .
Step 1: Check Your Computer Hardware First
Spending two minutes checking your specs now will save you an hour of confusing error messages later. Open your Linux terminal and verify three things:
1. Check CPU Instructions
Run this command:
grep -o -w 'avx2\|fma\|f16c' /proc/cpuinfo | sort -uWhat to look for: All three words (avx2, f16c, and fma) must appear in the output. Most Intel processors from 2013 onward (4th Gen Haswell or newer) and all AMD Ryzen chips pass, while older budget Pentium or Celeron chips may miss AVX2.
2. Check RAM and Disk Space
Free RAM: At least 2 GB (the model uses 614 MB, and the OS reserves 449 MB as working memory).
Free Disk Space: About 3 GB (1.5 GB for the raw Hugging Face download, ~614 MB for the converted model, and ~626 MB if you create a bootable ISO).
Step 2: One-Time Setup and Build
You only need to do these five steps once. All three run methods below share the exact same converted model file.
1. Install the Build Tools
sudo apt update
sudo apt install -y git make nasm binutils python3-venv2. Clone the Official Repository
git clone https://github.com/alesha-pro/llm.asm.git
cd llm.asm(Make sure you run all remaining commands from inside this llm.asm folder.)
3. Download Qwen3-0.6B (~1.5 GB)
Modern Ubuntu releases block global pip installs, so create a clean local virtual environment first:
python3 -m venv .venv
source .venv/bin/activate
pip install numpy huggingface_hub
hf download Qwen/Qwen3-0.6B config.json model.safetensors tokenizer.json \
--local-dir models/qwen3-0.6b-bf16(Tip: If you close your terminal and come back later, run source .venv/bin/activate again. If hf isn't recognized, use huggingface-cli download instead.)
4. Convert the Model to .asmbin Format
llm.asm reads weights from a custom, memory-aligned binary format rather than standard .safetensors files. Convert the model in a few seconds with:
python3 scripts/export_weights.py --model-dir models/qwen3-0.6b-bf16 \
--out models/qwen3-0.6b-q8_0.asmbin --scale-dtype fp165. Compile the 14 KB App and 24 KB OS
make inference os
ls -l build/asm-llm build/asm-llm-os.elfCheck the file sizes in your terminal output: 14,712 bytes for build/asm-llm and 24,252 bytes for build/asm-llm-os.elf.
3 Simple Ways to Run llm.asm
Choose the method that matches how deep you want to go:
| Method | Best For | Needs VM? | File Used |
| Way 1: Linux Terminal App | Quick testing on your daily Linux machine | No | build/asm-llm (14 KB) |
| Way 2: QEMU Virtual Machine | Watching the 24 KB OS boot with zero Linux | Yes (QEMU) | build/asm-llm-os.elf (24 KB) |
Way 3: Bootable .iso Disc | Deploying on Proxmox or homelab servers | Yes (Proxmox/VM) | build/asm-llm-os.iso (~626 MB) |
Way 1: Run the 14 KB App on Linux (Easiest)
Want to test the assembly engine right inside your regular terminal without rebooting or launching a VM?
Ask a single question:
./build/asm-llm -m models/qwen3-0.6b-q8_0.asmbin \
-p "Explain how a CPU cache works in 3 concise sentences." -n 128 -t $(nproc)Here, -n 128 limits the answer to 128 tokens, and -t $(nproc) automatically puts all your CPU cores to work.
Start a multi-turn chat:
./build/asm-llm -m models/qwen3-0.6b-q8_0.asmbin --chat -t $(nproc)Once inside the chat, you can use /clear to wipe memory, /think or /nothink to toggle Qwen3's step-by-step reasoning mode, and /quit (or Ctrl-D) to exit.
Way 2: Boot the 24 KB OS in QEMU (Zero Linux Underneath)
QEMU emulates a full PC hardware environment so the 24 KB operating system can take complete control of the virtual CPU, memory, and screen.
1. Install QEMU and verify KVM hardware acceleration:
sudo apt install -y qemu-system-x86
ls /dev/kvmImportant: Do not skip
/dev/kvm. If that file is missing, reboot into your PC's BIOS and enable Intel VT-x or AMD-V virtualization. Without KVM, software emulation crawls at roughly 0.08 tokens per second taking over four minutes just to write one sentence.
2. Boot the AI OS right inside your terminal:
qemu-system-x86_64 -enable-kvm -cpu host -m 2G -smp $(nproc) \
-kernel build/asm-llm-os.elf \
-initrd models/qwen3-0.6b-q8_0.asmbin \
-nographic-nographic with -vga std -serial stdio.)In less than 100 milliseconds, your terminal will flash the asm-llm OS v2.0 banner and drop you straight into the asm-llm> prompt. Inside the bare-metal OS, you can type /bench to test your tokens-per-second speed, /clear to reset the 2,048-token context window, or /halt to shut down the virtual machine. (To force-exit QEMU at any time, press Ctrl-A, release, then press X.)
Way 3: Build a Bootable ISO for Proxmox & VM Hosts
If you run a Proxmox homelab, you can bundle the 24 KB OS and the 614 MB model into a single ~626 MB .iso image that boots with zero virtual hard drives.
1. Build and test the ISO locally:
sudo apt install -y grub-pc-bin grub-efi-amd64-bin grub-common mtools xorriso
make os-iso MODEL=models/qwen3-0.6b-q8_0.asmbin
qemu-system-x86_64 -enable-kvm -cpu host -m 2G -smp $(nproc) \
-cdrom build/asm-llm-os.iso -vga std -serial stdio2. Deploy on Proxmox:
Upload build/asm-llm-os.iso to your Proxmox node (local → ISO Images → Upload), then run these commands in your Proxmox shell (adjust VM ID 250 and --cores 12 to fit your server):
qm create 250 --name asm-llm-os --machine pc --bios seabios --cpu host \
--cores 12 --memory 2048 --balloon 0 --vga std --serial0 socket \
--ide2 local:iso/asm-llm-os.iso,media=cdrom --boot order=ide2
qm start 250Open your Proxmox web Console or run qm terminal 250 to start chatting. Make sure you keep --bios seabios (UEFI mode throws a video mode error on screen), --cpu host (so AVX2 passes through), and --balloon 0 (to lock all 2 GB of RAM for the model).
Quick Troubleshooting Cheat Sheet
[FATAL] CPU lacks AVX2+FMA+XSAVE: You forgot-cpu hostin QEMU (or--cpu hostin Proxmox). If it is already set, your physical processor is too old.[FATAL] Missing .asmbin Multiboot module: You omitted the-initrd models/qwen3-0.6b-q8_0.asmbinflag or mistyped the file path.[FATAL] Invalid .asmbin magic (expected ASML): You pointed the engine at the raw Hugging Face.safetensorsfile instead of the converted.asmbinfile.[FATAL] Not enough free physical RAM: Give your VM at least 2 GB (-m 2Gor2048MB) of memory.[chat] context full, resetting KV-cache: Not an error! The built-in 2,048-token memory window filled up and automatically reset so you can keep chatting.
Is llm.asm Really "54% Faster Than llama.cpp"? (The Honest Truth)
You may have seen viral headlines claiming this 24 KB OS runs AI 54% faster than llama.cpp. While those numbers are real on an AMD EPYC 7642 server CPU, here is what is actually happening behind the curtain:
The engine drives the speed, not deleting Linux: The 14 KB Linux terminal app already beats
llama.cppby 18% to 36% during text generation. Removing Linux adds roughly another 10% boost mainly because the bare-metal OS uses 2 MiB huge pages (a memory optimization Linux can also enable).Hand-tuned 8-bit math: The speedup comes from pairing 8-bit quantized weights with 8-bit activations inside custom AVX2 instructions. If you turn off fast 8-bit mode and run full precision,
llm.asmis actually slower thanllama.cpp.Text generation vs. reading long prompts: That 54% lead only applies to generating output tokens one by one. When reading long prompts (prefill),
llama.cppprocesses batches in parallel and crushesllm.asm(reaching up to 1,113 tokens/sec compared tollm.asm's 160.8 tokens/sec).
Frequently Asked Questions (FAQ)
Can llm.asm run on Windows or macOS?
Not natively. It requires an x86-64 processor with AVX2, FMA, and F16C instructions and a Linux environment to build. Apple M1–M4 Macs use ARM architecture and cannot run it.
Why shouldn't I install the 24 KB AI OS on my main physical PC?
Because asm-llm-os.elf is an experimental bare-metal demonstration. It has no Wi-Fi or Ethernet drivers, no storage drivers, no USB keyboard support (only legacy PS/2 keyboards), and UEFI Secure Boot on modern PCs will block unsigned bootloaders.
Does the 24 KB OS include the AI model inside those 24 kilobytes? No. The 24,252-byte binary contains only the bootloader initialization, hardware setup, tokenizer, and inference math engine. The Qwen3-0.6B weights are loaded separately into RAM and occupy ~614 MB.
Want to dive into the assembly source code or build it yourself? Check out Alexey Fateev's open-source repository at