llm.asm: Qwen3-0.6B inference in 12 KB of pure x86-64 assembly — zero C, zero libc, zero dependencies
🔎 An LLM runtime with no Linux, no C, no GPU — and it runs faster than llama.cpp
A complete inference engine for Qwen3-0.6B written 100% in NASM x86-64 assembly. Not a single line of C. No libc. No dependencies. A 14,712-byte binary — roughly the size of three WhatsApp photos — that loads a language model, runs attention, RMS normalization, and sampling, and spits out tokens. It's alesha-pro's llm.asm project, and it sent GitHub's counters soaring this week: roughly 4,286 stars in six days, including 443 in twenty-four hours, plus a front-page spot on Hacker News.
Why is everyone getting excited about a 0.6-billion-parameter model when mainstream runtimes are churning through 7B, 27B, and bigger? Because llm.asm isn't a gimmick stunt: it's a feasibility demonstration. Hard, reproducible proof that an LLM can run without a software stack, without a framework, and — in its bare-metal variant — without even a host operating system. For CPU-only self-hosting, embedded AI, and minimal machines, it's a signal you can't afford to ignore.
And the detail that pushes this project from "neat hack" to "seriously worth watching": llm.asm is faster than llama.cpp on pure CPU on the same model, the same quantization format, and the same machine. More on that below.
The Essentials
- Three projects in one repo: a pure-assembly Qwen3-0.6B inference engine, a bootable 22 KB bare-metal OS that runs the model without Linux, and a from-scratch Mini-GPT training loop with live visualization.
- Zero dependencies: no C, no libc, no Python, no PyTorch, no CUDA. Just NASM, a Makefile, and a CPU with AVX2 + FMA + F16C.
- Measured performance, not marketing: 20.70 tok/s at 1 thread with FAST_Q8=1 on an AMD EPYC 7642, versus 16.63 tok/s for llama.cpp in Q8_0 — a +24.5% gain. At 4 threads: +35.6%. At 8 threads: +28.3%.
- Exact determinism: 64/64 identical outputs across the tested configurations — a level of reproducibility rarely seen in the ML ecosystem.
- An honest limitation: 0.6 billion parameters. Nothing comparable to the 7B+ models of mainstream runtimes. This is a demonstration project, not an Ollama replacement.
- Modest hardware requirements: Intel Haswell (2013) or AMD Excavator and newer. No need for AVX-512 or VNNI instructions.
Recommended Tools
| Tool | Main Use | Price (December 2026) | Ideal For |
|---|---|---|---|
| llm.asm | Qwen3-0.6B inference in pure assembly, bare-metal OS, Mini-GPT training | Free (open source) | Curious minds, low-level tinkerers, embedded research |
| Ollama | Local inference of 7B+ models with model management | Free | Classic self-hosting on CPU/GPU |
| LM Studio | Local inference with a graphical interface | Free | Beginners who want local LLMs without the terminal |
| Hostinger | VPS to host your LLM experiments and demos | Starting at a few euros per month (December 2026, check hostinger.com) | Testing CPU-only setups remotely |
If you're just getting started with local LLMs, begin with our guide to installing a local LLM before diving into assembly. llm.asm is an exploration project, not a production tool — and that's perfectly fine.
What exactly is llm.asm?
llm.asm is a GitHub repository containing three complete ML projects, all written in 100% NASM x86-64 assembly for Linux, without a single line of C and with no external dependencies: an inference engine for Qwen3-0.6B, a bootable 22 KB bare-metal operating system, and a Mini-GPT training loop built from scratch. Everything is cloneable and buildable via a simple Makefile, as documented in the project's presentation on dev.to.
Concretely, the main component — Qwen3-0.6B inference — produces a default binary of 14,712 bytes (roughly 12 to 15 KB depending on build options). For perspective: the curl binary typically weighs in at several hundred kilobytes. Here, in 12 KB, there's the tokenizer, the embedding lookup, the attention layers, the MLPs, RMS normalization, the logits, and the sampling.
Why "zero libc" is an achievement, not a gimmick
Almost every "assembly" program you'll come across cheats: they call printf, malloc, or memcpy from libc. llm.asm does not. Memory management is done by hand, writing to stdout goes through direct Linux syscalls, and the vector operations are implemented instruction by instruction in AVX2, FMA, and F16C. This is what makes the bare-metal variant possible: if your code doesn't depend on the kernel or libc, it can run directly on the metal, without an OS.
This is also what explains the compactness. Every byte of this binary is there for a reason: either it computes, or it orchestrates. No runtime, no garbage collector, no abstraction layer.
The hardware prerequisite, in plain terms
You need a CPU with AVX2, FMA, and F16C — that is, an Intel Haswell (2013) or an AMD Excavator and newer. No need for AVX-512 or VNNI, which considerably widens compatibility. An AVX1 build even exists for Sandy Bridge and Ivy Bridge, the machines of 2011-2012. In other words: if your machine is more than ten years old, it can probably run an LLM in pure assembly. The GPU, meanwhile, is of absolutely no use here — everything happens on the CPU.
The numbers: llm.asm beats llama.cpp on pure CPU
This is the point that got the Hacker News thread reacting, and it deserves to be taken seriously because it is sourced and reproducible. The official benchmarks from the repo compare llm.asm to llama.cpp on CPU, with the same Qwen3-0.6B model in Q8_0 quantization, on an AMD EPYC 7642.
| Configuration | llm.asm (FAST_Q8=1) | llama.cpp (Q8_0) | Gap |
|---|---|---|---|
| 1 thread | 20.70 tok/s | 16.63 tok/s | +24.5% |
| 4 threads | 69.24 tok/s | — | +35.6% |
| 8 threads | 103.64 tok/s | — | +28.3% |
| 16 threads | 121.86 tok/s | — | — |
| 40 threads | 125.86 tok/s (peak 126.81) | — | +19.8% |
Three important observations.
First, scalability saturates quickly. Between 16 and 40 threads, throughput goes from 121.86 to 125.86 tok/s — a 3% gain for 2.5 times more cores. The workload is essentially memory-bandwidth bound, like all LLM inference on CPU. The lesson for self-hosting: on a many-core machine, there's no point allocating everything to the model.
Second, determinism is total. The repo documents 64/64 outputs exactly identical across all tested configurations. In an ecosystem where results vary depending on threading, batching, and kernel version, a bit-exact deterministic engine is a valuable property — for debugging, for scientific reproducibility, for critical embedded systems.
Finally, methodological caution. These benchmarks come from the repo itself, not from an independent third party. The numbers are precise, documented, and plausible — the absence of abstraction overhead and total control over memory naturally explain the advantage — but wait for independent replications before concluding that an assembly engine will systematically beat optimized runtimes. llama.cpp is an extraordinarily optimized project; the 20–35% gap probably comes down to implementation choices specific to this model and this quantization.
The repo's three projects: inference, bare-metal OS, Mini-GPT
1. The Qwen3-0.6B inference engine — the heart of the project
This is the centerpiece, the one described above: a complete engine in ~12 KB of binary, with tokenizer, full forward pass, and sampling, running on any post-2013 x86-64 CPU with AVX2. The choice of Qwen3-0.6B is no accident: it's a model with a publicly documented architecture, small enough to fit within a hand-managed memory budget, and representative of the small models found throughout the Alibaba ecosystem — a family that has grown considerably since, as we can see with the new Qwen3.6 models.
2. The 22 KB bare-metal OS — an LLM without Linux
This is the most mind-boggling project in the repo: a bootable 22 KB operating system that runs model inference directly on the hardware — no Linux kernel, no distribution, nothing. You flash the image, you boot, and your 2015 machine becomes an LLM appliance.
Why does this matter? Because it's the conceptual proof of extreme embedded AI. A router, an industrial board, a kiosk, a control system: all those environments where you can't — or don't want to — install a full software stack. Today, it's just a 0.6B as a demo. But the trajectory is clear: if inference fits in 12 KB of code and a 22 KB OS, the software cost of embedded AI trends toward zero. All that remains is the cost of the model itself.
3. The Mini-GPT trainer — and its live Braille TUI
Third project: a Mini-GPT training loop built from scratch, again in pure assembly, with a terminal interface that displays training progress in real time — activations and loss visualized as Braille characters in the terminal. It's both an engineering feat (implementing backpropagation by hand in NASM is unapologetic masochism) and a unique teaching tool: watching a neural network learn, Braille pixel by pixel, with no layer of abstraction between you and the math.
Why it matters for self-hosting and minimal machines
Direct answer: llm.asm proves that the minimal software stack needed to run an LLM is radically smaller than what the ecosystem has led us to accept. Between PyTorch (several gigabytes), Ollama (hundreds of megabytes), and llm.asm (12 KB), there are four orders of magnitude — and the question is how much of that mass is actually necessary.
For classic self-hosting on a CPU-only VPS — the kind of setup you'd put together on a small Hostinger server or equivalent — established runtimes remain the right choice: our roundup of the best local LLMs covers models like DeepSeek V4 Flash, Qwen3.6-27B, or GLM-5, which no 12 KB engine will be running anytime soon. But llm.asm opens up three concrete avenues:
- Constrained embedded systems: connected devices, industrial systems, automotive — anywhere the 2 GB of RAM required by a Python runtime is disqualifying.
- Instant boot: a 22 KB OS boots in a fraction of a second. Imagine an appliance going from power-on to inference in under a second.
- Total auditability: 12 KB of code can be audited line by line. In a context of trust in AI inference chains, an engine that can be fully verified by a human is a value proposition in itself.
This is the same underlying trend as the current wave of small specialized models: models optimized for Ollama are shrinking in size, and llm.asm pushes that logic all the way down to the software floor.
The honest limit: 0.6 billion parameters replaces nothing
Let's be clear, because tech journalism has a bad habit of turning every viral hack into a revolution: Qwen3-0.6B is a very small model. It handles simple text, basic completion, lightweight tasks. It doesn't compete with 7B models, let alone with today's heavyweights — a Qwen3.6-27B (74 on the open source leaderboard), a DeepSeek V4 Pro (88) or, on the proprietary side, a GPT-5.5 or a Gemini 3.1 Pro. The capability gap is one or two orders of magnitude depending on the task.
So what llm.asm demonstrates is not "here's a better local chatbot". It's "here's proof that the runtime can be as small as the model requires". If tomorrow a 3B or 7B model with a compatible architecture is targeted, the conceptual groundwork — the absence of dependencies, manual memory control, hand-written AVX2 kernels — is already in place. But that's a work in progress, not a given: the complexity of a forward pass scales with model size, and the 12 KB would become tens of KB, all still written by hand.
In the meantime, if your goal is to have a genuinely useful local assistant, stick with proven tools — our guide to installing a local LLM remains the entry point. llm.asm is the project to watch, not the project to adopt.
How to test llm.asm on your own machine
The project can be cloned and built via a Makefile, with no dependencies to install beforehand — that's precisely the point. The essential commands:
git clone https://github.com/alesha-pro/llm.asm
cd llm.asm/01-qwen3-inference
make
Checks before running:
- CPU: AVX2 + FMA + F16C required. On Linux,
cat /proc/cpuinfo | grep avx2will confirm this in a second. - OS: Linux x86-64. The bare-metal variant boots from a disk image — test it in a VM or on a dedicated machine, not on your workstation.
- Model: the Qwen3-0.6B weights need to be downloaded separately, as with any local runtime.
If you don't have a compatible machine on hand, a basic VPS is enough — the model runs entirely on CPU and doesn't require a GPU. It's actually a good use case for a small Hostinger server: a disposable environment for experimenting without touching your main machine.
The context: Qwen, the open source ecosystem, and the race for small models
The choice of Qwen3-0.6B as a target is no accident. Alibaba's Qwen family has become one of open source's favorite playgrounds, with a range spanning from micro-models to giants. The recent release of the Qwen3.6 family shows the direction: models ranging from 27B to 397B on the high end, but also MoE variants like Qwen3.6-35B-A3B that activate only 3 billion parameters per token — exactly the kind of architecture that makes CPU-only inference increasingly viable.
In that same Alibaba galaxy, work on language world modeling with Qwen-AgentWorld shows the other end of the spectrum: models trained to simulate environments for autonomous agents. Between the two — the 0.6B that fits in 12 KB of assembly and the simulated worlds for agents — lies the full range of what a model family does today.
And if you're wondering what a small multimodal model can already do, our feature on AI vision and image analysis by LLMs covers the real capabilities of compact models on visual tasks.
The underlying trend is clear: while frontier models battle it out on agentic benchmarks — GPT-5.5 at 98.2, Gemini 3 Pro Deep Think at 95.4, Claude Opus 4.7 Adaptive at 94.3 — another race is playing out at the bottom of the curve: the race for the most useful model per byte of stack. llm.asm is the most radical manifesto of this second race.
❌ Common Mistakes
Mistake 1: Believing that llm.asm is a replacement for Ollama
What's wrong: the hype around the project leads some to present it as "Ollama in assembly". That's false and counterproductive. llm.asm targets only one model (Qwen3-0.6B), has no model management, no server API, no ecosystem.
The solution: use llm.asm for what it is — an engineering demonstration and a base for exploration — and use established runtimes for real-world use. The two are not in competition.
Mistake 2: Running the build on a CPU without AVX2
What's wrong: the default binary requires AVX2 + FMA + F16C. On an older CPU, it will crash with an illegal instruction, without any explicit message if you don't know how to read a SIGILL.
The solution: check grep avx2 /proc/cpuinfo first. On Sandy/Ivy Bridge, use the AVX1 build designed for those generations.
Mistake 3: Generalizing the benchmarks to all models and all machines
What's wrong: the numbers in the repo (+24.5% to +35.6% vs llama.cpp) concern one model, one quantization (Q8_0 / FAST_Q8=1), one CPU (EPYC 7642), and one specific version of both engines. Extrapolating from that to "assembly is faster than C in general" is a fallacy of reasoning.
The solution: read the benchmarks as a one-off data point, wait for independent replications, and keep in mind that memory bandwidth — not the language — is the limiting factor for CPU inference.
Mistake 4: Booting the bare-metal OS on your main machine
What's wrong: it's an experimental 22 KB OS. Booting it on your work machine means taking an unnecessary risk.
The solution: a VM or a dedicated machine. Period.
❓ Frequently Asked Questions
Can llm.asm run models larger than 0.6B?
Not today. The repo targets Qwen3-0.6B only. Supporting a 7B would require rewriting and extending the kernels by hand, with more complex memory management. It's feasible in principle, but it's a massive undertaking, not an existing option.
Do you need to know assembly to use llm.asm?
Not to use it: clone, make, run. Yes to contribute or to understand the code: the whole project is NASM x86-64, with no comments to abstract away the complexity. It's also an excellent — and demanding — resource for learning low-level programming.
Why choose assembly over optimized C?
Three reasons put forward by the project: extreme compactness (12 KB), total control over memory and vector instructions, and the ability to target bare metal without depending on an OS. The measured performance gain is a side effect of that control, not necessarily the primary goal.
Are the benchmarks independent?
No, they come from the repo itself. They are detailed and reproducible in theory, but no third-party validation has been published to date. The Hacker News thread raised the question; wait for replications before citing the numbers as established.
What's the minimum hardware to try it?
An x86-64 CPU with AVX2, FMA, and F16C — Intel Haswell (2013) or AMD Excavator or newer — and Linux. No GPU, no large amounts of RAM: the 0.6B model in Q8 fits within a very modest memory budget.
What's the connection to embedded AI?
That's the most interesting prospect in the long run: a 22 KB OS that runs LLM inference without Linux proves that the software cost of embedded AI can approach zero. The applications — connected devices, industrial systems, appliances — remain conceptual for now, but the feasibility barrier has fallen.
✅ Conclusion
llm.asm won't be replacing your local stack this year — but it has just proven, with numbers to back it up, that an LLM can run in 12 KB of code without C, without libc, without a GPU, and even without an OS, faster than the reference runtime. This is exactly the kind of assumption-shattering that self-hosting needs. To dig deeper into the practical side, head over to our guide to installing a local LLM and the comparison of the best local LLMs — and keep an eye on the repo, which is probably only just getting started.