Bare Metal Qwen: Running LLMs Without an Operating System

The Bare Metal Qwen project, part of the llm.asm repository, provides a standalone, bootable x86-64 operating system capable of running the Qwen3-0.6B model directly on hardware or KVM. By eliminating the need for Linux, Windows, C, Rust, or libc, the project achieves a cold boot time of 74–94 ms and demonstrates high-performance inference through direct hardware access.

Technical Architecture

The kernel is a 24 KB stripped static Multiboot 1 executable written in pure assembly. It bypasses traditional OS overhead by managing hardware resources directly:

  • Boot and Memory Management: The system uses 2 MiB huge pages to identity-map guest RAM, avoiding 4 KiB page-table walks. This allows the model to be bound zero-copy from physical RAM.
  • SMP Support: The kernel parses ACPI tables to bring all available CPU cores online, using a lock-free cache-line-isolated spin-barrier to coordinate parallel inference.
  • Hardware Drivers: It includes custom drivers for COM1 serial output, 80x25 VGA console, and PS/2 keyboard input. It also utilizes PIT channel 2 and RDTSC for high-precision profiling.
  • Power Management: The system implements ACPI S5 poweroff for clean shutdowns, allowing it to function as a self-contained, diskless appliance.

Performance and Deployment

The project is designed for efficiency, particularly in virtualized environments. On an AMD EPYC 7642 with 16 vCPUs, it achieves 134.9 tokens per second. Because the entire OS and model reside in memory, it can be deployed on diskless Proxmox VE VMs, requiring only an ISO image to boot.

Benchmarks

vCPUs Boot Ready (ms) Decode (tok/s)
1 73.47 23.46
8 84.54 118.97
16 84.88 134.94

Community Perspectives

The project has sparked discussion regarding the future of "LLM-OS" architectures. While some users view the project as a technical curiosity or a "brain in a jar," others see potential in specialized data center applications where removing the OS layer eliminates attack vectors and syscall overhead.

"I was just ruminating as a sort of joke on HN a couple of days ago that LLMs could in the near future be the 'OS' in a sense, directly running on metal and launch other programs, perhaps even generate them from scratch on the fly."

However, critics note that for frontier models, the resource footprint of a host OS is negligible compared to the model's requirements. Others pointed out the security implications of such low-level execution:

"Raw asm no libc/syscall dependencies... that means it can run in SMM ('ring negative 2'), and inject its binary into a hypervisor."

Despite the debate over real-world utility, the project serves as a significant proof-of-concept for high-performance, minimalist AI deployment.

Sources