Foundation
A tensor type, an arena/allocator strategy, and memory-mapped file reading.
How an n-dimensional array is really just a flat buffer plus shape and stride — and why memory layout is the first thing that governs performance.
zigllm is read like a textbook. Each layer depends only on the layers beneath it, so you build real understanding in order — from a flat buffer of floats to a streaming generation loop. Nothing below is a paid course: it is a free, MIT-licensed code-along you follow in the repository and the docs.
A tensor type, an arena/allocator strategy, and memory-mapped file reading.
How an n-dimensional array is really just a flat buffer plus shape and stride — and why memory layout is the first thing that governs performance.
SIMD matrix-multiply kernels and the K-quant / IQ-quant decode paths.
Why matmul dominates the flops, how quantization trades bits for memory bandwidth, and what @Vector buys you over a scalar loop.
Activation functions, normalization, and rotary positional encoding.
The small, exact operations a transformer repeats thousands of times — SwiGLU, GELU, RMSNorm, and how RoPE rotates query/key vectors by position.
Multi-head attention, feed-forward networks, and a full transformer block.
How attention scores are computed, scaled, softmaxed and mixed — and how a block wires attention and FFN together with residual connections.
18 architecture families, GGUF loading, and tokenization.
How real model families differ — where they place norms, how they scale embeddings, what they do with attention — and how to read a pre-trained GGUF file into your own tensors.
The generation loop, KV caching, streaming, and the full family of samplers.
How next-token prediction becomes "generation": autoregression, the KV cache that makes it fast, and every sampler from greedy to Mirostat and grammar-constrained decoding.
Set up Zig, run the tests, and start at Layer 1.