https://www.manning.com/books/build-a-large-language-model-from-scratch
"In Build a Large Language Model (from Scratch), you’ll discover how LLMs work from the inside out. In this book, I’ll guide you step by step through creating your own LLM, explaining each stage with clear text, diagrams, and examples.
The method described in this book for training and developing your own small-but-functional model for educational purposes mirrors the approach used in creating large-scale foundational models such as those behind ChatGPT. The book uses Python and PyTorch for all its coding examples."
By Sebastian Raschka
Book Repo: https://github.com/rasbt/LLMs-from-scratch/