A developer has built a hand-crafted, 25 KB operating system in assembly language dedicated to running a language model, enabling text generation speeds up to 54% faster than the popular llama.cpp on Linux. However, analysis shows the majority of the performance boost does not require removing Linux entirely.
- Custom OS runs a language model with a 25 KB footprint.
- Up to 54% speed increase over llama.cpp on Linux, but 66% of gain occurs with Linux.
- Speed boost mainly from memory management, not OS removal.
What happened
In late November 2026, developer Alexey Fateev announced a project replacing Linux with a custom operating system written entirely in x86-64 assembly code focused solely on running an AI language model. The kernel is extremely compact at about 25 KB and boots quickly into 64-bit mode, launching Alibaba's Qwen3-0.6B model for text generation. Fateev demonstrated that this bare-metal approach produced token generation speeds up to 54% faster than running llama.cpp, a widely used AI inference engine on Linux, on a powerful AMD EPYC 7642 CPU.
The new OS, included in the MIT-licensed llm.asm repository, uses no conventional system libraries or languages other than assembly. It boots from a multiboot binary, bypasses typical OS functions like storage, networking, or GPU use, and runs the AI model directly in RAM loaded beforehand with GRUB. Testing involved comparing native Linux runs of llama.cpp, a Linux-hosted inference engine from the llm.asm repository, and the custom minimal OS kernel. The highest speed gain (54%) was observed in a constrained four-thread test.
Why it matters
Though the headline figure of a 54% speed improvement suggests a dramatic advantage in removing Linux entirely, deeper analysis reveals that about two-thirds of this gain also occurs with Linux running. Most of the benefit is actually due to technical optimizations like mapping memory with large 2 MiB pages, a feature Linux supports through transparent huge pages or hugetlbfs but was apparently not utilized in the llama.cpp benchmarking.
This finding tempers claims that eliminating a general-purpose OS is critical for substantial AI inference speedup. Memory bandwidth and efficient handling of large AI model weights remain bottlenecks. The new kernel also runs inside a virtual machine on Linux-based hypervisors, so the direct hardware advantage may differ in a physical bare-metal environment. Additionally, the minimal OS only supports a single, relatively small dense model and does not handle network or storage functions, limiting broader practical use.
What to watch next
Future developments should explore applying Fateev’s optimizations, such as large page mappings and lean inference engines, directly within Linux or other full-featured environments to combine speed with system flexibility. Measuring performance on unvirtualized hardware will also clarify the true bare-metal gains possible without general OS overhead.
Additionally, expanding support beyond the current single small model to include larger AI models and more comprehensive hardware support like GPUs or networking would be critical to gauge real-world utility. The project highlights ongoing trade-offs between minimalism and functionality in AI system deployment, which will continue to evolve as models grow and specialized inference requirements change.