When you run a local large language model on your PC today, what is your computer actually busy doing behind the scenes?
Windows or Linux is busy managing network cards, updating fonts, scheduling background notifications, and juggling virtual memory pages. Meanwhile, your AI compute hardware is stuck waiting in line behind layers of “administrative bureaucracy.” Recently, an extreme experiment in the open-source community tore up that rulebook: developer Alexey Fateev (alesha-pro) released llm.asm, stripping away Linux entirely and writing a 24,252-byte (~24KB) bootable micro-OS (asm-llm-os.elf) in 100% pure x86-64 NASM assembly to run Alibaba’s Qwen3-0.6B directly on bare-metal memory.
The results are brutal. On identical hardware, this 24KB system—smaller than a single high-res thumbnail—achieves 54% faster token generation than standard Linux running llama.cpp at 4 threads.
This experiment rips the band-aid off modern software engineering: how many bloated “middlemen” have we stacked on top of our hardware just for developer convenience?
Core Architecture: The Bare-Metal Express Without Middlemen
Running AI on a traditional PC is like shopping at a massive department store. A customer (an inference request) has to pass the front-door security (BIOS/UEFI), take a ticket at the service desk (OS kernel scheduler), and follow floor managers (C/Rust runtimes and libc libraries) before finally reaching the sales clerk (CPU execution units). Every layer takes a cut, burning memory bandwidth and clock cycles.
The 24KB assembly OS takes a violent shortcut: it demolishes the department store and sets up a stall right at the warehouse door.
- 64-Bit Long Mode in 74 Milliseconds: After booting via GNU Multiboot, the system switches directly into 64-bit Long Mode within 74 to 94 milliseconds. It skips complex drivers and filesystems, keeping only minimal VGA text output, PS/2 keyboard, and serial port support.
- ACPI / APIC Multi-Core Wakeup: Through the CPU’s built-in Advanced Programmable Interrupt Controller (APIC), the kernel wakes up all dormant CPU cores (SMP) directly, assigning each core a slice of matrix math with zero OS thread scheduling or context-switch latency.
- 2 MiB Huge Pages & Direct RAM Mapping: Roughly 614 MiB of
Q8_0quantized weights sit directly in physical RAM, mapped with 2 MiB huge pages to slash page-table traversal overhead. The CPU crunches them straight through AVX2, FMA, and F16C instructions—complete with a built-in BPE tokenizer, GQA, QK-Norm, RoPE, SwiGLU, and a KV-cache multi-turn chat REPL. Zerolibctranslation, zero C or Rust runtime tax.

Deployment: There Is No “Installation”—Just Boot and Compute
Anyone used to clicking “Next” in an installer will be lost here—because there is no installer. The binary is the operating system.
The llm.asm repository ships three pure-assembly sub-projects: alongside the 24KB bare-metal OS 02-baremetal-os (asm-llm-os.elf), it includes a 14.7KB static Linux ELF binary (01-qwen3-inference) and a ~32.9KB from-scratch Mini-GPT trainer (03-minigpt-trainer) featuring a live Braille TUI.
For bare-metal inference, deployment feels more like plugging in a classic game cartridge:
- Instant VM Testing (Proxmox / QEMU): In a hypervisor like Proxmox VE or QEMU/KVM, you need 0GB of disk space. Spin up a VM with 2GiB of RAM, point the boot target to the image, and hit power—base boot finishes in under 95 milliseconds, and the system is ready to generate text within 5 seconds.
- Bare-Metal Boot: Flash the image to a USB drive with GRUB or Multiboot. Reboot from the USB stick, and your entire PC instantly transforms into a single-purpose “AI calculator.”
- The Compromise (Standalone Linux ELF): If you don’t want to reboot your machine just to run a model, the 14.7KB static Linux binary (built with
FAST_Q8=1and 2 MiB huge pages) runs directly in your existing Linux terminal—still squeezing out 18% to 36% higher throughput than standardllama.cpp.
Benchmarks: Real-World Feedback on EPYC and Decade-Old Xeon
The hardware benchmarks shatter the myth that running local AI requires the latest flagship GPU. Below are the published Qwen3-0.6B (Q8_0) token-generation (decode) benchmarks comparing asm-llm-os against llama.cpp (-ngl 0 CPU-only):
| Test Platform | Core / Thread Config | asm-llm-os Speed | llama.cpp Speed | Key Observation |
|---|---|---|---|---|
| AMD EPYC 7642 | 4 Threads | 78.89 tok/s | 51.08 tok/s | ~54.4% faster, showcasing the massive edge of zero OS overhead at lower thread counts. |
| AMD EPYC 7642 | 8 Threads | 118.08 tok/s | 80.79 tok/s | ~46.2% faster, maintaining strong multi-core scaling. |
| AMD EPYC 7642 | 16 Threads | 134.94 tok/s | 103.03 tok/s | ~31.0% faster; doubling cores only adds ~14% throughput, hitting the memory bandwidth wall. |
| Intel Xeon E5-2670 v3 (2014 CPU) | 12 Cores (Proxmox VM, 2GiB RAM) | 24 ~ 111.5 tok/s | — | Decade-old server silicon running smoothly in a diskless 0GB VM. |
The engineering truth behind these numbers is crystal clear: at 4 threads on the EPYC 7642, asm-llm-os leads by 54%. Push to 16 threads, and while raw speed climbs to 134.94 tok/s, the gain over 8 threads (118.08 tok/s) flattens out and the lead over llama.cpp narrows to 31%.
Once every software bottleneck is stripped away, the true physical ceiling appears: Memory Bandwidth. No matter how fast the CPU cores compute, if RAM cannot feed weights into cache fast enough, extra cores sit idle. (Note: While bare-metal excels at token generation, prompt prefill speeds can still favor llama.cpp depending on specialized BLAS/SIMD routines.)
Real-World Scope: Physical Limits and Where It Actually Shines
At this point, a natural question pops up: “If an AI already lives inside the system, why not let the AI write its own network drivers and filesystem on the fly?”
It is a romantic idea, but three hard physical and engineering walls stand in the way:
- No Initial Key, No Hardware Access: A network card is physical silicon. The CPU must read and write vendor-specific registers over the PCIe bus just to send a packet. Without pre-loaded drivers, the AI is locked inside a room without doorknobs—it has no instruction path to even touch the NIC.
- A 0.6B Brain Cannot Engineer a Kernel: A 600M-parameter model handles classification and basic chat well, but writing bug-free, memory-safe NIC drivers and a TCP/IP stack from scratch is far beyond its reasoning depth. One bad memory pointer crashes the entire bare-metal machine.
- Add the Features, Lose the Speed: Even if you pre-compile networking and filesystems into the image, the CPU must start handling network interrupts (IRQs) and buffer queues, constantly thrashing the CPU cache. You end up with a “crippled Linux,” and that 54% bare-metal bonus evaporates.
Recognizing those three boundaries defines the true battlefield for llm.asm—it is not a general-purpose PC, it is a dedicated compute engine:
- Extreme Edge & Offline Terminals: Industrial sensors, drone flight controllers, and bedside medical devices that need millisecond semantic decisions offline with minimal power. At 24KB, it can even be flashed directly into motherboard firmware.
- Repurposing Legacy Server Clusters: Data centers full of decade-old Xeon servers don’t need expensive GPUs. Load them with RAM and pair a lightweight Linux front-end (handling network I/O) with a 24KB bare-metal back-end communicating over UART or shared memory for pure, low-cost inference.
- Zero-Attack-Surface Enclaves: No network stack, no filesystem, no shell. Attackers have zero interface to exploit—physically, the machine only knows how to multiply matrices.

Verdict
Modern tech loves masking architectural laziness by throwing more hardware at the problem: hardware gets 10x faster, software gets 12x fatter. This 24KB pure-assembly AI kernel is a sharp slap in the face—proving that when you return to first principles and strip away unnecessary abstractions, even decade-old silicon still packs astonishing power.
True engineering wisdom isn’t forcing one tool to do everything; it is knowing its physical limits, cutting the fat, and placing it where it delivers maximum leverage.
References
Support Independent Perspectives & In-Depth Insights
Every thoughtful analysis and candid critique comes from our dedication to truth and quality. We choose not to follow sensational algorithms or clickbait headlines.
Sustaining independent research requires reader support. Make a one-time or monthly contribution, securely processed by Google.
Payments secured by Google · Manage or cancel anytime in your Google Account




Comments