Enthusiast removed Linux for a 24 KB pure assembly OS that runs a neural network faster than llama.cpp
Developer Alexey Fateev, known on GitHub as alesha-pro, ditched Linux. In its place, he wrote a tiny bootable system from scratch in assembly with a single job – running a language model.
The resulting binary weighs 24 KB, boots in 74–94 milliseconds, and runs inference up to 54% faster than the usual Linux and llama.cpp combo.
The system runs in bare-metal mode, directly on the hardware. Between the processor and the neural network there is no Linux kernel, no Windows, no drivers, and no background services. According to Fateev, he used no C, Rust, or standard libc library during development – all the code is handwritten in NASM assembly.
The asm-llm-os.elf binary takes up exactly 24,252 bytes and loads via the Multiboot standard. Popular bootloaders like GRUB understand it, so there is no need to write custom boot code for each platform. Next to modern operating systems that require tens of gigabytes, the size looks almost symbolic.
For some historical context, there is the legendary Commodore 64. Its 20 KB ROM held the system kernel, a BASIC interpreter, and a character generator. Fateev creation is slightly larger, but it supports SMP – it can spread computation across multiple processor cores.
Input and output are kept to the bare minimum:
80x25 character color VGA text mode
Support for PS/2 keyboards
Serial port operation
A built-in multi-turn chat interface with the model
Once the computer powers on, the system immediately opens a dialogue window where users can chat with the context of previous messages preserved. From pressing the power button to being ready to talk to the AI takes less than a tenth of a second.
The neural network is Qwen3-0.6B from Alibaba, with 600 million parameters. The model loads in Q8_0 format, meaning 8-bit weight quantization, and takes up 649 MB. By language model standards that is a very compact option, but it is roughly 28,000 times larger than the operating system that runs it.
That is exactly the ratio Fateev was after. Almost all of the machine resources go to the useful workload, while the OS itself barely spends any memory or processor time.
To gauge performance, the developer compared his system with his previous Linux installation, where the same model ran through llama.cpp. Tests were done on a server with an AMD EPYC 7642 processor – a 48-core chip built on the Zen 2 architecture. The best result looks like this:
4 threads hit 78.89 tok/s vs 51.08 (+54%)
That figure was the maximum, but not a one-off outlier. Even the most modest gain in the tests was 31%, when using 16 threads. The difference comes partly from the absence of overhead typical for a full-fledged OS – the task scheduler, context switches, background processes, and interrupts that distract the processor from computation.
Fateev published all the source code on GitHub under the MIT license. The llm.asm repository includes an ISO image builder and detailed setup instructions, so anyone can repeat the experiment or tweak the code.
For those who don't need direct-to-hardware booting, there is a version that runs on top of Linux. The same asm-llm inference engine fits into 14 KB there. The 10 KB savings come from dropping the system boot and processor initialization code, while keyboard input and monitor output are handled by Linux in that case.
Fateev solution is unlikely to suit everyday work, since the system can only run one model. Still, the experiment shows clearly how much performance in local neural network runs gets eaten by operating system infrastructure.