gl00m

← All projects

nibble

4-bit LLM inference on CPU, from scratch

2026 · in progress · C++20 · AVX2 · POSIX threads

What it is

A from-scratch C++20 inference engine that runs a 4-bit Llama model (TinyLlama-1.1B-Chat, Q4_0 GGUF) on a laptop CPU. No ML, BLAS, or tokenizer libraries: only the C++ standard library, POSIX, and threads.

Why

Local AI on any laptop, built under a hard constraint and held to real proof. Every claim is checked against two references: PyTorch for the exact math, llama.cpp for file-format behaviour and speed.

How it works

Every generated token streams all 555 MiB of weights once, so decode speed is set by bytes moved. That is why 4-bit weights matter.

Results

Decisions