This book emerged from a simple observation: while Large Language Models (LLMs) have become ubiquitous, their mathematical foundations remain opaque to many practitioners, students, and enthusiasts. This book bridges that gap by presenting LLMs from first principles – not as a black box, but as an elegant mathematical construction.