explainx.ai350K+ learn from us
TrendingAI News TodayExplainx for Business
Pricing
explainx.ai

Upskill in AI — 16 free pathways, live workshops & bootcamps, and 50+ courses from practitioners. Plus the skills, tools, and MCP servers to practice on.

follow us

follow on google

Add explainx.ai as a preferred source

corporate training

support@explainx.ai

get started

Find your pathTake Free Evaluation

community

Join the community

learn

mind: share how you thinkpathways — start freeworkshopsbootcampscoursescompare Explainxcertificationsmock testsexplainx universitycorporate traininglearn skills & mcp

discover

skillsmcp serversexplainx mcpestacktoolsmdx readeragentsllmsdesignsdictionarypeopleagi trackerfelony benchranks

company

aboutvisionmissionteaminstructorsteach on explainxpartnershipscommunityhackathonscareers

content

daily AI newsstate of AI — live resultsblogreleasespromptsgeneratorsresource libraryfor LLMsexplainx.ai kids

solutions

all solutionsdeveloper upskillingmarketing upskillingproduct manager upskillingleadership upskilling

newsletter · weekly

Get AI news, tools, and insights in your inbox.

supportcontactprivacytermsdata rightshow we create contentsubmission guidelines

© 2026 AISOLO Technologies Pvt Ltd

explainx.ai

On this page

  • TL;DR: what is claimed and what to do with it
  • What is llm.asm and what is inside the repo?
  • How does it compare with llama.cpp, and what is the evidence?
  • Why does a 0.6B model make this possible?
  • The bare-metal LLM OS: what is real about it?
  • Training a GPT in assembly
  • How to try it
  • What are the limits?
  • Why it matters
  • Related reading
← Back to blog

explainx / blog

llm.asm: Qwen3-0.6B Inference in a 14 KB Pure Assembly Binary

Local LLM, Open Source, Qwen, GitHub Trending, AI News

Part of Local AI

llm.asm runs Qwen3-0.6B in 14.7 KB of x86-64 assembly and claims 18 to 36 percent faster CPU decode than llama.cpp. What is measured, what is not, how to try it.

Nov 26, 2026·9 min read·Yash Thakker
add explainx.ai
go deep
llm.asm: Qwen3-0.6B Inference in a 14 KB Pure Assembly Binary

llm.asm is a GitHub repo that runs a real language model, Qwen3-0.6B, from a 14,712-byte program written entirely in x86-64 assembly. It gained 1,352 stars in a single day on GitHub's trending list. Its README claims 18 to 36 percent faster CPU decode than llama.cpp on the author's AMD EPYC test machine. That claim comes from the repo itself, on one machine and one model, so this post separates what is measured from what is generalized.

The repo, alesha-pro/llm.asm, is MIT licensed and bundles three projects: the inference engine, a bootable operating system that chats with the model, and a GPT trainer. It is a showpiece, and a good one. It is not a replacement for the runtimes most people use.

TL;DR: what is claimed and what to do with it

table · 2 cols
QuestionAnswer
What is it?Three LLM programs in pure x86-64 NASM assembly: inference, a bootable LLM OS, a Mini-GPT trainer
Which model?Qwen3-0.6B, converted to a custom Q8_0 file called .asmbin
Binary sizes?14,712 B inference, 24,252 B OS, 32,944 B trainer (README figures)
Speed claim?18 to 36 percent faster decode than llama.cpp Q8_0, 1 to 40 threads, on an AMD EPYC 7642
Where llama.cpp wins?Prompt prefill: llm.asm runs token by token, llama.cpp batches
License?MIT
Needs?x86-64 with AVX2, FMA and F16C; Linux; nasm; Python with numpy once for weight export
Use it for?Learning how a transformer runs on a CPU. Not for production

What is llm.asm and what is inside the repo?

The README describes "three complete LLM projects written in 100% pure x86-64 NASM assembly" with no C, C++, Rust, libc or libm. The author hand-wrote every part a normal runtime borrows from a library: the math kernels for exp, sine and cosine, RMSNorm, RoPE, SiLU and softmax; an AVX2, FMA and F16C matrix engine; a byte-pair-encoding tokenizer; a thread pool built on raw clone and futex system calls; and, for the trainer, a backward pass and the AdamW optimizer. The README counts 17,252 lines across all three projects, of which 3,857 are a shared core.

table · 3 cols
ProjectBinaryWhat it does
01-qwen3-inference14,712 BStatic Linux ELF that runs Qwen3-0.6B at Q8_0, with single-shot and multi-turn chat modes and a KV cache
02-baremetal-os24,252 BMultiboot kernel that boots into long mode and chats with the model on VGA and keyboard, no OS underneath
03-minigpt-train32,944 BFP32 Mini-GPT trainer and sampler with a live Braille-character terminal chart

The model file is not part of those sizes. The converted Qwen3-0.6B weights are about 614 MiB, so the "14 KB LLM" headline describes the engine, not the whole system. That is how every runtime works. llama.cpp is also small next to the weights it loads. Still, a complete Qwen3 forward pass in 14 KB of machine code is a striking engineering result.

How does it compare with llama.cpp, and what is the evidence?

The README publishes a table measured on one machine: an AMD EPYC 7642, CPU only, Qwen3-0.6B at Q8_0, 34 prompt tokens, 64 generated tokens, three-run average. Here are the decode speeds it reports for the default fast mode.

Inference speed gauge showing llm.asm decode throughput on CPU against llama.cppInference speed gauge showing llm.asm decode throughput on CPU against llama.cpp

table · 4 cols
Threadsllama.cpp Q8_0llm.asm FAST_Q8=1Reported gain
116.63 tok/s20.70 tok/s1.24x
451.08 tok/s69.24 tok/s1.36x
880.79 tok/s103.64 tok/s1.28x
16103.03 tok/s121.86 tok/s1.18x
40105.08 tok/s125.86 tok/s1.20x

Source: the llm.asm README, author's own measurements. We have not reproduced them.

Three things are worth knowing before you repeat that headline.

First, the comparison is decode only. The README itself notes that llama.cpp uses batched matrix multiplication for prompt prefill, while llm.asm processes the prompt token by token. For long prompts, llama.cpp would be expected to do better.

Second, the two runs are not doing identical arithmetic. The fast mode quantizes activations to int8 and uses the AVX2 vpmaddubsw and vpmaddwd instructions, with FP16 block scales. The README reports a cosine similarity of 0.99965 against a PyTorch FP32 reference and 64 of 64 matching greedy tokens. That is good evidence of accuracy on a short test. It is not a full quality evaluation, and it does not say how a 0.6B model behaves on your task.

Third, the model is tiny. Qwen3-0.6B decode is bound by memory bandwidth and by how well the code keeps the CPU fed. A hand-tuned path for one fixed shape can beat a general runtime there. The same trick does not automatically carry to a 7B or 70B model, to other architectures, or to ARM. llama.cpp's optimization work on other hardware is a different story: see our coverage of the llama.cpp RDNA patches claimed to reach 35 to 55 tokens per second and the AMD benchmark dashboard for llama.cpp.

Why does a 0.6B model make this possible?

Qwen3-0.6B is the smallest model in the Qwen3 family, published openly on Hugging Face. Its 28 layers, grouped-query attention, QK-norm, rotary embeddings and SwiGLU feed-forward blocks fit in a few thousand lines of code, which is what the repo's shared transformer file implements. A frontier-scale model needs mixture-of-experts routing, long-context tricks, many quantization formats and GPU kernels. That is why mainstream runtimes grow large, and why a single author can match one model end to end.

The takeaway for builders is about scale, not about assembly. When a model is small enough, the runtime is a small program, and the real cost is memory bandwidth. That fits a broader pattern we have covered: small models doing real work, such as distilling a larger model into Qwen3-4B, and aggressive CPU and consumer-hardware tricks such as running an 800B model on consumer hardware with llama.cpp.

Daily briefFrom Yash · 350K+ students taught

Catch up on AI

One AI story explained in plain English, plus one thing to try. Every day, free. Unsubscribe anytime.

The bare-metal LLM OS: what is real about it?

The second project is the one that drew attention. The README describes a kernel that is loaded by a Multiboot bootloader, builds four-level page tables, enters long mode, turns on AVX2 and FMA, brings up the other CPU cores through ACPI and the local APIC, and then runs the same transformer code as the Linux build. Input comes from a PS/2 keyboard, output goes to VGA text mode and a serial port, and a chat loop with commands such as /clear, /think and /bench runs the model.

The reported numbers are 74 to 94 ms boot time, 134.9 tokens per second under KVM on the EPYC machine, and 55.4 tokens per second on a Proxmox virtual machine with a Xeon E5-2670 v3 and no disk. The repo includes screenshots of both runs in its assets folder. As with the rest, these are the author's figures.

It is a clear demonstration that an LLM does not need an operating system, a filesystem or a Python stack. It also shows why nobody ships this way: with no drivers for network, storage or GPU, the machine can do exactly one thing.

Training a GPT in assembly

The third project is a from-scratch FP32 trainer. The README says its analytical backward pass matches PyTorch on all 21 gradient tensors with a cosine of 1.0000000000, that it reaches 27,662 training tokens per second, and that validation loss on the TinyShakespeare dataset falls from 4.19 to 1.51 in four minutes. It has a terminal chart drawn with Unicode Braille characters.

A 2.7 million parameter model trained on Shakespeare is a teaching exercise. The value is the gradient check: writing a backward pass by hand and matching a reference framework to ten decimal places is the best way to learn what a training framework does for you.

How to try it

You need a Linux x86-64 machine with AVX2, FMA and F16C. The README's quick start is short.

bash
sudo apt install nasm binutils
git clone https://github.com/alesha-pro/llm.asm.git
cd llm.asm
make all

For inference, download Qwen3-0.6B, export it once to the repo's custom format, then run the binary.

bash
python3 scripts/export_weights.py --model-dir models/qwen3-0.6b-bf16 --out models/qwen3-0.6b-q8_0.asmbin --scale-dtype fp16
make inference FAST_Q8=1
./build/asm-llm -m models/qwen3-0.6b-q8_0.asmbin --chat -t 16

To check the speed claim yourself, run the same Q8_0 model through llama.cpp with -ngl 0 on the same machine and compare decode speed, not prompt speed, at several thread counts. If your CPU has fewer cores or a different cache layout than an EPYC 7642 with 256 MiB of L3, expect different ratios. A fair test also reports prompt processing time separately.

What are the limits?

  • One model, one path. It runs Qwen3-0.6B only. There is no GGUF loader, no other architecture and no GPU backend.
  • x86-64 only. It needs AVX2, FMA and F16C, so it does not run on Apple Silicon or other ARM machines.
  • Young project. The repository shows three commits at the time of writing. Star counts reflect curiosity, not production use.
  • Self-reported benchmarks. One machine, one author, no independent reproduction that we found.
  • Prefill is slower by design. The README says so itself.
  • Maintenance. Hand-written assembly is hard to extend. Adding a new activation or attention variant means writing and verifying new kernels.

Why it matters

For most readers the practical advice is simple. Keep using a maintained runtime for real work: llama.cpp 1.0 now has stable library versioning, which matters more to a product team than a 20 percent decode gain on one model. Use llm.asm to learn. If you want to understand how int8 dot products, KV caches and thread pools produce tokens, a readable 17,000-line codebase with reference checks is a rare resource.

There is also a lesson for teams tuning inference. Much of the gain the author reports comes from known techniques: int8 activations, compact scales, prefetching the next weight row, and contiguous head-major KV layout. Teams working on their own CPU deployments can try the same ideas in a maintained stack, and the approach of hill-climbing on measured speed is covered in our post on an inference optimisation skill for local LLMs.

Related reading

  • llama.cpp 1.0: stable libllama and libggml, what changes
  • llama.cpp RDNA patches: 35 to 55 tokens per second, claimed vs verified
  • llama.cpp AMD benchmark dashboard
  • Running an 800B model on consumer hardware with llama.cpp
  • Inference optimisation skill: hill-climbing local LLM speed
  • Distilling a larger model into Qwen3-4B
  • Official sources: the llm.asm repository, the Qwen3-0.6B model card and the llama.cpp repository

Figures, versions and repository details are accurate as of November 26, 2026 and may change as the project evolves.

Spotted something out of date? Let us know.
Daily briefFrom Yash · 350K+ students taught

Catch up on AI

One AI story explained in plain English, plus one thing to try. Every day, free. Unsubscribe anytime.

  • ✓ Free
  • ✓ One email a day, no spam
  • ✓ Unsubscribe anytime
Yash Thakker

Written by

Yash Thakker

Yash is an AI expert with over 300K learners. Join his workshops →

View Yash Thakker in People in AI →

Related posts

Oct 30, 2026

Nesformer: A Nintendo NES CPU Compiled Into Qwen3.5 4B Weights Runs Super Mario Bros.

Drew Breunig released nesformer, an MIT-licensed project that compiles the NES processor into the weights of a stock Qwen3.5 model. Nobody trained anything: a compiler set the weights, and the model predicts the CPU execution log one token at a time. Here is how it works, how to run it, and what it says about hybrid attention models.

Nov 23, 2026

PeakCut: Self-Hosted AI Clipper for Live Streams and Long Videos (1.8k GitHub Stars)

PeakCut by haziqahmedqasmi is a trending MIT-licensed stack that turns long uploads and live streams into vertical shorts with word-level captions. It runs on FastAPI with local sherpa-onnx transcription, accepts a dozen AI providers, and can record streams into a rolling buffer. This guide follows the official README and DEPLOY.md as of November 23, 2026.

Nov 22, 2026

NeonClipping: Local Open-Source YouTube-to-Shorts Clips With Ollama and No Upload

iamajmeena/neonclipping hit GitHub trending in November 2026 with a local clipping engine: paste a link, score loud moments with audio-first analysis, title hooks with Ollama, and export vertical MP4s without uploading source video. The README measures an 85-minute YouTube stream clipped in 97 seconds on an RTX 2060. Here is how it works, how it differs from AutoClip, and what to verify before you ship clips.