Build Your Own LLM, Lesson 12: Quantize and Run Your Model Locally
Shrink models with quantization: fp32 to int8 with PyTorch dynamic quantization, size and speed trade-offs, GGUF and 4-bit formats, and running open models locally…
Read article →Excel, SAP, Oracle & automation tips — plus wacky facts
A step-by-step course: tokenizer, embeddings, attention and a tiny GPT you train yourself.
A step-by-step course: tokenizer, embeddings, attention and a tiny GPT you train yourself.
📄 13 articles⬇️ 13 with practice files🕒 Updated 28 Sep 2026
🎓 Start here: Vibe Coding Course → 🎓 Start here: AI Agents & RAG Course → 🎓 Start here: AI for Office Work Course →Shrink models with quantization: fp32 to int8 with PyTorch dynamic quantization, size and speed trade-offs, GGUF and 4-bit formats, and running open models locally…
Read article →Turn a text predictor into an assistant: instruction-response data, chat templates with role tokens, masking the loss on prompts, and why each model needs…
Read article →Fine-tune efficiently with LoRA: freeze the base model, add low-rank adapter matrices to attention layers, train under 2% of the parameters, and how the…
Read article →Measure a language model: cross-entropy loss, perplexity and what it means, validation sets, fixed test prompts, and why benchmarks and human checks are both…
Read article →How a language model picks the next token: greedy decoding, temperature, top-k and nucleus (top-p) sampling, implemented in a dozen lines and compared side…
Read article →Stack transformer blocks into a GPT, add token and position embeddings, train it on a text file with AdamW on a laptop CPU, watch…
Read article →Extend single-head self-attention to multi-head attention, add the feed-forward network, layer norm and residual connections, and test the causal mask — the full transformer…
Read article →Understand and code the attention mechanism behind transformers: queries, keys, values, the causal mask and softmax — first with NumPy on four tokens, then…
Read article →Rebuild the bigram model as a neural network in PyTorch, train it with gradient descent, and add embeddings — the vectors that let language…
Read article →Build a bigram language model with plain Python dictionaries, generate text from it, and measure it with loss — the same number every LLM…
Read article →Build the byte-pair encoding tokenizer used by GPT-style models from scratch in about 40 lines of Python: training merges, encoding, decoding and why the…
Read article →A plain-English tour of what happens inside ChatGPT-style models: tokens, probabilities, training on next-token prediction, and why a model that only guesses the next…
Read article →Bones are stronger than steel of the same weight.
Weight for weight, bone is remarkably strong, especially under compression, because of its mix of collagen and mineral.