Leanpub Book LAUNCH 🚀 LM from First Principles: A Notebook-Driven Guide to Building and Deploying Language Models by Amarpreet Singh Bassan

LM from First Principles is a notebook-driven guide to building and deploying language models from the ground up. Starting from a 9,025-parameter bigram that predicts one character at a time, each chapter adds one layer of capability — feedforward context, sampling strategies, self-atte...

Welcome to the Leanpub Launch video for LM from First Principles: A Notebook-Driven Guide to Building and Deploying Language Models by Amarpreet Singh Bassan!

LM from First Principles: A Notebook-Driven Guide to Building and Deploying Language Models
LM from First Principles: A Notebook-Driven Guide to Building and Deploying Language Models by Amarpreet Singh Bassan — available as an ebook on Leanpub.

About the Book

Book cover image of LM from First Principles by Amarpreet Singh Bassan
LM from First Principles: A Notebook-Driven Guide to Building and Deploying Language Models by Amarpreet Singh Bassan

LM from First Principles is a notebook-driven guide to building and deploying language models from the ground up. Starting from a 9,025-parameter bigram that predicts one character at a time, each chapter adds one layer of capability — feedforward context, sampling strategies, self-attention, scaling — until you have a model you can push to Hugging Face. Every concept is grounded in a runnable Jupyter notebook, so you do not just read about how language models work; you watch them train, fail, improve, and generate. The book is written for practitioners who want to understand what is happening inside the model, not just call an API. You need Python and curiosity. Everything else is built from first principles.

About the Author

Amarpreet Singh Bassan is a senior software engineer with 19 years of experience building reliable software systems. His current work focuses on production debugging and improving the reliability of production systems at scale. Outside of his core engineering work, he builds open-source proof-of-concept projects to explore AI engineering, agentic workflows, memory, observability, grounded retrieval, and practical debugging support. He is an IEEE Senior Member and writes about his learning journey in software engineering, AI systems, and reliable production architecture.

Follow the author here!

Watch Clips from the Full Video


Leanpub
Publish Early, Publish Often