Bare Metal Qwen
A standalone, 24 KB x86-64 assembly operating system boots Qwen3-0.6B directly on bare metal or KVM with no underlying kernel, C, or Rust.
read it The detailed architecture breakdown of pure assembly boot, SMP handling, and zero-copy huge page memory mapping offers rare systems-level insight into LLM execution.
summary
This project packages a custom 24 KB x86-64 assembly kernel that boots directly into an interactive Qwen3-0.6B chat interface without any operating system layer like Linux or Windows. It utilizes Multiboot 1, 4-level 2 MiB huge-page identity mapping for zero-copy weight loading, and a lock-free spin-barrier for SMP core utilization. Achieving cold boots under 100 milliseconds and high token throughput via KVM or bare metal, the implementation demonstrates extreme hardware-level optimization. The comment thread explores potential applications as a dedicated token appliance, security implications of eliminating syscalls, and broader musings on LLM-driven operating systems.
key points
- The bootable kernel is written entirely in x86-64 assembly with zero dynamic dependencies, C, or Rust, sizing in at under 25 KB.
- It maps the 614 MiB Qwen3-0.6B model zero-copy from physical RAM using 2 MiB huge pages to eliminate page-table overhead.
- It features bare-metal symmetric multiprocessing (SMP) via local APIC INIT-SIPI-SIPI wakeups, scaling decode throughput up to 134.9 tokens per second on 16 vCPUs.
who should read it
Low-level systems engineers, assembly programmers, and enthusiasts interested in bare-metal performance optimization for AI inference.
discussion positive
consensus
Commenters find the project a fascinating technical feat and an efficient token appliance, though many question the practical utility of running small models on bare metal without a broader user harness.
pushback
Some question whether the reported token throughput is unusually low for a 0.6B model compared to heavily optimized CPU inference frameworks like llama.cpp.
Right, this setup is perfect. You just send in your prompts and get your output, same as you do with any regular llama.cpp setup. All the harness etc is on your desktop. This essentially is just a Token Appliance. I think it's a great idea to remove almost all the OS bits that aren't needed.
It highlights why a bare-metal model runner makes architectural sense as a pure token appliance even if the harness runs elsewhere.
Generated by an LLM from the article and thread. Check the sources before relying on it.