🎉 Giảm 20% cho đơn hàng đầu tiên!✦🚚 Miễn phí vận chuyển cho đơn trên 500.000₫✦⚡ Flash Sale — Số lượng có hạn!✦🎁 Quà tặng kèm cho đơn từ 1.000.000₫✦🎉 Giảm 20% cho đơn hàng đầu tiên!✦🚚 Miễn phí vận chuyển cho đơn trên 500.000₫✦⚡ Flash Sale — Số lượng có hạn!✦🎁 Quà tặng kèm cho đơn từ 1.000.000₫✦
A Developer Just Deleted Linux, Stuffed Qwen3-0.6B Into a 24 KB Assembly OS, and It Runs Up to 54% Faster Than llama.cpp
Quay lại Blog

A Developer Just Deleted Linux, Stuffed Qwen3-0.6B Into a 24 KB Assembly OS, and It Runs Up to 54% Faster Than llama.cpp

26 tháng 11, 202611 phút đọcVũ Khôi
English
#English#Lập trình#Phần cứng & Thiết bị
Vũ Khôi

Vũ Khôi

Tác giả tại Wotech Electronics Blog

Terminal screen of asm-llm OS v2.0: Bare-Metal Qwen3-0.6B in 100% Pure x86-64 Assembly, booting in 84.89 ms

A Developer Just Deleted Linux, Stuffed Qwen3-0.6B Into a 24 KB Assembly OS, and It Runs Up to 54% Faster Than llama.cpp

Alexey Fateev (GitHub: alesha-pro) decided on a rather unusual move: instead of optimizing AI on an existing operating system, he threw the operating system away and wrote a new one in Assembly. No Linux, no Windows, no C, no Rust, not even libc. The entire asm-llm-os.elf file weighs exactly 24,252 bytes — lighter than a Facebook profile picture — and according to the author's own published benchmarks, it runs up to 54% faster than llama.cpp on Linux.

Quick answer: The llm.asm project (GitHub repo alesha-pro/llm.asm) by Alexey Fateev is a bare-metal operating system written 100% in x86-64 assembly, built to run exactly one model: Alibaba's Qwen3-0.6B. The asm-llm-os.elf executable weighs 24,252 bytes (.text code 17,143 bytes, .rodata 2,772 bytes), boots in 74–94 ms straight into 64-bit Long Mode, wakes every CPU core via APIC, maps the 614 MiB Q8_0 weights directly from physical RAM, and drops the user into a multi-turn AI chat with full KV-cache, over VGA, a PS/2 keyboard and serial. In head-to-head benchmarks against llama.cpp (Q8_0, -ngl 0, i.e. fully CPU-bound) on the same AMD EPYC 7642 CPU, the author reports: 1 thread 23.67 vs 16.63 tok/s (+42%); 4 threads 78.89 vs 51.08 (+54%); 8 threads 118.08 vs 80.79 (+46%); 16 threads 134.94 vs 103.03 (+31%, peak 136.6 tok/s). On a Proxmox VM with a 2014 Intel Xeon E5-2670 v3, 12 cores, 2 GiB RAM and no hard disk, the system still boots to the chat screen in under 5 seconds, reaching 78 tok/s decode and 111.5 tok/s prefill, with an ISO builder supporting BIOS and UEFI included. The Linux ELF build, only 14.7 KB (FAST_Q8=1, INT8xINT8 AVX2+F16C), also beats llama.cpp by 18–36% across 1–40 threads; enabling 2 MiB huge pages on bare metal adds about another 10% of performance. Accuracy is not casually sacrificed: output is bit-exact across thread counts, matching 64/64 greedy tokens against PyTorch FP32, with a cosine similarity of 0.99965. Two points need careful reading: 24 KB is the size of the operating system, not including the AI model weights (614 MiB); and all benchmark figures were published by the author himself on X and in his repo, with no independent verification yet. The repo, ISO builder and Proxmox guide are all public under the MIT license, and the project gathered a few hundred GitHub stars within its first day.

A bare-metal OS is an operating system that runs directly on the hardware, with no other operating system underneath — no Linux below, no hypervisor. Q8_0 is a form of quantization: model weights are compressed to 8 bits per parameter instead of 32, so a 0.6-billion-parameter model shrinks to about 614 MiB while keeping almost all of its answer quality.

What is inside the 24 KB OS?

24 KB sounds like it cannot hold anything — but because the entire system is hand-written in assembly, with no C, no libc and no external libraries, every byte has a purpose. According to the project's README, the bare-metal part is about 4,167 lines of OS code, combined with shared modules (math, matmul, tokenizer, transformer) compiled with the BARE_METAL flag:

  • Kernel: Multiboot 1 boot, immediate switch to 64-bit Long Mode, all CPU cores woken via APIC using the INIT-SIPI-SIPI sequence, lock-free synchronization.
  • Tokenizer + Transformer + GEMM engine: the model's entire inference pipeline — tokenization, matrix multiplication, transformer blocks — all written in assembly, tuned for AVX2+FMA.
  • Memory: model weights bound zero-copy directly from physical RAM on 2 MiB huge pages — no copying back and forth, no filesystem, no disk driver (there is no disk).
  • Interface: multi-turn chat right on the VGA console, PS/2 keyboard, serial port, persistent KV-cache across turns, plus built-in commands such as /think, /nothink, /bench, /halt and /help.

The 24,252-byte file breaks down as: .text 17,143 bytes (code), .rodata 2,772 bytes (read-only data), .bss 2.1 MiB NOBITS (uninitialized memory region — takes no file space). The whole OS plus model is packaged into a self-contained ~661 MiB ISO that boots on both BIOS and UEFI — and because everything runs from RAM, the virtual machine needs no hard disk at all.

The benchmark table: faster than llama.cpp at every thread count

A direct comparison on the same AMD EPYC 7642 CPU, the same Qwen3-0.6B Q8_0 model, llama.cpp running CPU-only (-ngl 0):

Threads asm-llm-os llama.cpp on Linux Difference
1 23.67 tok/s 16.63 tok/s +42%
4 78.89 tok/s 51.08 tok/s +54%
8 118.08 tok/s 80.79 tok/s +46%
16 134.94 tok/s (peak 136.6) 103.03 tok/s +31%

Beyond the bare-metal build, the Linux ELF version, only 14.7 KB, also beats llama.cpp by 18–36% across 1–40 threads — meaning most of the advantage comes from the assembly-written inference code itself, not just from removing Linux. Enabling 2 MiB huge pages on bare metal adds about another 10% on top.

Proxmox VE interface: the qwen3-asm-os VM, 12 CPUs, 2 GiB RAM, 0 B disk

Running on a 2014 Proxmox VM: no disk, still chatting happily

The second impressive point is that the system runs well on old hardware. On a Proxmox VM with a 2014 Intel Xeon E5-2670 v3, 12 cores, 2 GiB RAM and no hard disk, it still boots to the chat screen in under 5 seconds (95 ms kernel boot), reaching 78 tok/s decode and 111.5 tok/s prefill — fast enough for a live conversation, not waiting for tokens to trickle out.

The Proxmox screenshot in the original post shows VM 250 (qwen3-asm-os) on node pve-node-1 with 12 CPUs, 2 GiB RAM and 0 B of disk — a configuration any homelab can reproduce, since the ISO builder and Proxmox guide are included in the repo.

Why is removing Linux faster? And what does it cost?

The performance advantage comes from removing intermediate layers — exactly as the author summarized: sometimes the best optimization is removing layers of code that are not needed.

  • No scheduler, no context switching: on Linux, the OS constantly interrupts, switches between processes and handles hardware interrupts. On bare metal, the entire CPU does exactly one thing: inference.
  • No libc, no syscalls: every system call on Linux has a cost; here the code talks directly to the hardware.
  • Direct memory: model weights are mapped zero-copy from physical RAM on 2 MiB huge pages — fewer TLB misses, no copying through OS buffers.
  • Specialized code: a hand-written GEMM engine for exactly one model on exactly one CPU architecture — not general-purpose code that must serve hundreds of cases like llama.cpp.

But the price is clear too, and this article does not hide it:

  • It runs exactly one model: the system is packaged for Qwen3-0.6B. Running another model means redoing much of the work.
  • No network, no GPU, no multitasking: no network drivers, no CUDA, no running two things at once — this is a dedicated chat machine, not a general-purpose OS.
  • Hand maintenance: every new feature must be written in assembly. llama.cpp has a community of thousands of contributors; llm.asm currently has one author.
  • Author-reported figures: the benchmarks ran on the author's hardware, with no independent verification. The 54% is real on that configuration — but do not treat it as a universal conclusion for every machine.

The fairest comparison: llama.cpp is a general-purpose tool that runs hundreds of models on all kinds of hardware; asm-llm-os is an extreme demonstration of how fast specialized code can be when everything unnecessary is removed. Both have their place — and the lesson lies in between.

The post's question: where does a developer's value lie when AI writes code?

The original post ends with a question worth reflecting on: when AI can write thousands of lines of code in a few minutes, does a developer's real value still lie in the ability to write code, or in understanding a system so deeply that you know which lines of code do not need to be written?

Fateev is a living example of the second answer: he did not write more code — he wrote less code, but at the deepest layer of the system, where every line decides performance. While the whole industry pours billions into chips, GPUs and data centers, one developer sat down and hand-wrote the kernel, tokenizer and GEMM engine in assembly to squeeze more performance from hardware that already exists — and the result is +54% on the same CPU.

This shares a spirit with an earlier Wotech article about AevumOS (share 38) — but the two are fundamentally different: AevumOS is a self-driving agent operating system running on Gemini, aimed at autonomous agents; llm.asm is a minimalist bare-metal OS whose only goal is the fastest possible inference on available hardware. Two projects, two completely different optimization philosophies.

Apply it now: optimize by removing, not by adding

  1. Measure before optimizing: benchmark on the same hardware, same model, same configuration before and after a change — as Fateev did head-to-head with llama.cpp on the same CPU. Without comparative numbers, every "faster" is just a feeling.
  2. Find the redundant layer, not the missing one: before adding a cache, more workers or another machine, ask: which layer in the system is burning time without creating value? Sometimes removing one middle layer beats adding a new one.
  3. Specialize the hottest spot: general-purpose code serving every case is always slower than code written for your case. Identify the 5% of code that runs 95% of the time, and optimize exactly there — like a hand-written GEMM engine for one model.
  4. Understand memory before algorithms: 2 MiB huge pages added 10% performance without changing a single line of logic. How data sits in RAM — zero-copy, fewer TLB misses, correct alignment — often decides speed more than the algorithm.
  5. Accept trade-offs consciously: removing Linux gained +54% but lost networking, GPU and multitasking. Every optimization decision is a trade — write down what you traded away, so nobody (including your future self) imagines there was no price.

1. What is asm-llm-os, and who made it? It is the llm.asm project (GitHub repo alesha-pro/llm.asm) by Alexey Fateev, announced on X on November 26, 2026: a bare-metal operating system written 100% in x86-64 assembly, built to run Alibaba's Qwen3-0.6B model. The executable weighs 24,252 bytes, is MIT-licensed, and gathered a few hundred GitHub stars within its first day.

2. Does the 24 KB include the AI model? No — 24 KB is only the operating system. The Qwen3-0.6B Q8_0 model weights weigh 614 MiB, mapped directly from physical RAM. The whole OS plus model is packaged into a ~661 MiB ISO.

3. How much faster than llama.cpp, and on what hardware? According to the author's published benchmarks, on the same AMD EPYC 7642 CPU with the same Q8_0 model: +42% at 1 thread, +54% at 4 threads, +46% at 8 threads, +31% at 16 threads (peak 136.6 tok/s). On a Proxmox VM with a 2014 Xeon E5-2670 v3, 12 cores, 2 GiB RAM and no disk: 78 tok/s decode, 111.5 tok/s prefill. The figures have no independent verification yet.

4. Can it replace llama.cpp? Not really. llama.cpp runs hundreds of models on all kinds of hardware, with GPU support, networking and a large community. asm-llm-os runs exactly one model, with no network, no GPU and no multitasking — but it proves that specialized code, with all redundant layers removed, can be much faster on the same hardware.

5. What is the biggest lesson for developers? Sometimes the best performance optimization is not writing more code, but removing layers of code that are not needed. When AI can write thousands of lines in minutes, a developer's value lies in understanding the system deeply enough to know which lines do not need to be written — and daring to delete them.

Sources: the Hỏi Dân it Offical post (November 26, 2026); figures and details were additionally cross-checked against Alexey Fateev's original X post (@superalesha), the GitHub repo alesha-pro/llm.asm, the Level1Techs forum and the README mirror on DevPlace.