Build the engine: tiny-llm and learning local models from the bottom
@oliviscusAI posted about tiny-llm on Nov 4, and Ivan Fioravanti (@ivanfioravanti) passed it along the next day. It's an open-source course by Alex Chi Z (@iskyzh): github.com/skyzh/tiny-llm. The README calls it "a hands-on course for systems engineers who want to understand LLM inference end to end," the serving counterpart to CMU's Needle project.
What you build
It's a four-week path, and per the README it goes like this:
- Week 1. Build a Qwen3 model straight from
mlx.corearray operations: attention, RoPE, grouped-query attention, RMSNorm, the MLP, sampling and the autoregressive loop. - Week 2. Make one request fast: a KV cache, keeping 4-bit weights packed, SIMD matrix prefill and tiled prefill.
- Week 3. Build a mini vLLM: continuous batching, chunked admission and a paged KV cache that attention reads directly.
- Week 4. Build a small coding agent: a validated agent loop with approved edits, checkpoint-and-resume and context compaction.
The rule that makes it a course and not a tutorial: when a chapter teaches an operator, you write it yourself in Python, C++ or Metal instead of calling the optimized MLX version. MLX stays around as the answer key and the speed baseline. As @oliviscusAI put it, you have to measure the improvements yourself.
It runs on Apple Silicon, so no NVIDIA GPU. One honest note: the README's roadmap still marks some Week 2 chapters as in progress, and Week 4 is being published one reviewed day at a time, with Days 1 through 9 out now.
Why I'd do this
A lot of what I post about local models is tok/s. I posted going from 30 to 70 TPS on Qwen 3.8 Flash Next on my M3 MacBook Pro. tiny-llm is the layer under numbers like that: what a KV cache actually saves, why packed 4-bit weights matter, what batching does to memory.
Week 4 is the part I care about most. I already wrote up a small agent running on my old Mac with LFM3 and tool calls. tiny-llm has you build that agent loop on an engine you wrote yourself, with checkpoints and context compaction as real code instead of a config flag.
I haven't taken the course yet, so this isn't a review. It's where I'd point anyone who asks how local models actually work on a Mac. Clone it, run Week 1 and see how far you get.
Credit for the course: Alex Chi Z, tiny-llm. Found via @oliviscusAI's post.
Tags: Local inference MLX Quantization