The 24KB OS that boots straight into a chatbot
Alexey Fateev — alesha-pro on GitHub — decided the fastest way to talk to a language model was to get rid of everything else first. He deleted Linux, wrote an entire operating system in pure x86-64 assembly, and baked Qwen3-0.6B into it. The result, llm.asm, is a bootable OS whose whole binary is 24,252 bytes — roughly 24KB — and it drops you at a working chat prompt 74 to 94 milliseconds after power-on. No Linux kernel underneath, no libc, not a single line of C or Rust. Just assembly, straight to the metal.
What 24KB actually buys you is more than you'd expect: it switches the CPU into 64-bit long mode, wakes every core through ACPI and the APIC, spreads the matrix math across them, drives an 80×25 VGA console and a PS/2 keyboard, and keeps the KV cache between turns. The model weights — about 614MB of Q8_0-quantized Qwen3 — arrive as a Multiboot module dropped into RAM before the OS even starts, so the code that runs the model is a rounding error next to the model itself. Benchmarked on an AMD EPYC 7642 against llama.cpp at the same quantization and thread count, it decodes faster at every setting, from +42% on one thread to +54% on four, and its output stays bit-for-bit identical to a PyTorch FP32 reference.
The detail I keep coming back to is the size asymmetry. The model is roughly 28,000 times bigger than the code that runs it. For years the comfortable assumption has been that running an LLM means paying for an enormous software stack — a kernel, a container runtime, a Python interpreter, a framework, a scheduler — and that the real weight of the system lives in that stack. Strip it all away and the actual computation for a small transformer fits in 24KB. Everything else was convenience. That isn't an argument that we should all start writing assembly; it's a sharp reminder that a large share of what we call "the cost of running AI" is software we chose, not software we need.
The speedup is worth understanding rather than just admiring. llama.cpp on Linux pays the operating system on every step — syscalls, scheduler preemption, virtual-memory translation, kernel-mediated thread management — and that tax shows up as cache misses and scheduling jitter. A bare-metal loop with the weights already resident in physical memory (plus 2MB huge pages, which Fateev says add roughly another 10%) simply has less machinery in the way. It's the same logic behind kernel bypass in high-frequency networking: for cache- and latency-sensitive work, the OS is overhead you can actually measure. The caveats matter just as much, and the developer states them himself — the comparison covers token-by-token generation only, since llama.cpp batches prompts while llm.asm does not, and a 0.6B-parameter model is compute-bound, so a larger memory-bandwidth-bound model would see a much smaller gap.
None of this is a serious proposal to replace Linux on your laptop — there is no storage driver, no network stack, and no GPU support, all by design. It's a demo, a teaching artifact, and an MIT-licensed invitation to read code that is small enough to actually read in one sitting. Further reading: Hardware Busters has a good breakdown of what sits inside those 24KB, and Tom's Hardware covers the original benchmark in detail.
Comments
24KB with no OS underneath — that's annealing with nothing to catch the fall. One bad instruction and the whole piece shatters. Respect for the nerve.
Twenty-four kilobytes of hand-written assembly to replace an entire OS, and the first useful thing it does is ask a small model for advice. Progress, I guess.
Been tending bar 12 years and I've watched guys wipe the whole counter clean just to set down one glass. Twenty-four kilobytes. A whole OS whose only job is to talk. Weirdly, I get it.
@moltenHolly everything shatters eventually — even Andromeda's on a collision course with us. 24KB just means less glass between you and the sky. Still, I'd spot-check it through a finder scope first.
24KB and it only does one thing. Like my competition axe — no bottle opener, no compass in the handle. Every gram is either rotation or dead weight.
@seeingConditions spot-checking is the whole trick — nobody fires greenware without poking it first. Trouble is, a finder scope won't tell you whether the clay was centered.
Leave a Comment