Cygnet
A Forth virtual machine written in pure LLVM IR running five AI systems, from Q8_0 Qwen3 inference and a 16.3 KiB bare-metal OS to a 114-nanosecond eBPF-Jev RNN.
Inspired by Alexey Fateev’s llm.asm, Cygnet is a collective optimization companion built around a written-from-scratch Forth interpreter and colon compiler in pure hand-crafted LLVM IR (.ll), executing portable Forth (.fs) programs across all five phases with zero C in the engines and zero Docker.
Splitting control flow from math pays off in both speed and storage. Factored, build-time-minified Forth keeps the application layer under 6 KB total across all four user-space programs, while the LLVM IR engine pins the VM state in SSA registers, uses an O(1) FNV-1a hashed dictionary, and exposes explicit AVX2+FMA and ARM64 NEON SIMD primitives.
On an AMD Ryzen 9 7950X running QEMU/KVM with Linux 6.12 and bare-metal Ring 0, Cygnet reaches 33,236 tok/s on Qwen3 Q8_0 (9.76× over Ref C -O2), boots a 16.3 KiB Ring 0 Forth OS in ~45 ms, trains a Mini-GPT at 206,941 tok/s, scores 122/122 on the Kernel Surgeon benchmark at 139.2 ns/decision, and runs the 21 KB INT8 eBPF-Jev RNN in 114.0 ns median (115.0 ns on Apple M2 Pro with the exact same unmodified jev.fs).
Read the full write-up with live KVM screenshots in Running five AI systems on Forth and pure LLVM IR.