@GitHub_Daily: Want to understand the underlying principles of large language models? Most resources only cover theory or provide source code, leaving you still confused. Stumbled upon this open-source tutorial, EveryonesLLM, which guides us step by step to build a complete large language model from scratch on Google Colab, writing code throughout. The whole tutorial is divided into...
Summary
EveryonesLLM is an open-source tutorial that provides 29 chapters of Colab notebooks. It teaches users step by step to build a complete large language model from scratch on Google Colab, including pre-training and instruction fine-tuning, and supports Chinese.
View Cached Full Text
Cached at: 06/16/26, 01:38 PM
If you want to understand the underlying principles of large language models, most resources only introduce theoretical knowledge or provide source code, leaving you confused.
I stumbled upon the open-source tutorial EveryonesLLM, which guides you step by step to build a complete large language model from scratch on Google Colab, writing all the code yourself.
The entire tutorial is divided into 29 chapters, starting from basic data loading and word embeddings, gradually building up to attention mechanisms, Transformer modules, and finally completing pretraining and instruction fine-tuning.
GitHub: http://github.com/HayatoHongo/EveryonesLLM
Each chapter is an independent Colab notebook — just open it in your browser and run it; no need to fuss with a local environment.
It also adopts a “practice + answer” format, where you write the code yourself first and then check your answers. This helps you learn more thoroughly.
The tutorial is continuously updated, and recently added a chapter on Vision LLM.
After completing the tutorial, you will be able to train a small conversational AI and even try it out online.
HayatoHongo/EveryonesLLM
Source: https://github.com/HayatoHongo/EveryonesLLM
🌐 Select Language / 日本語 🇯🇵 (https://github.com/HayatoHongo/EveryonesLLM/tree/ja) | 中文 🇨🇳
Build LLM on Google Colab from scratch

🎉 Click → AI YOU build in Chapter29😘 (https://huggingface.co/spaces/HayatoHongoEveryonesAI/EveryonesGPT_SFT)
Table of Contents

WebApp Released (Now only in Japanese) (https://EveryonesAI-v2.created.app/)
EveryonesLLM
| Chapter | Estimated Time | Notebook |
|---|---|---|
| Chapter 00: Start Tutorial | 1-2 hours | Open in Colab |
| Chapter 01: Dataloader | 1-2 hours | Open in Colab |
| Chapter 02: TokenEmbedding | 0.5-1 hour | Open in Colab |
| Chapter 03: PositionEmbedding | 0.5-1 hour | Open in Colab |
| Chapter 04: EmbeddingModule | 0.5-1 hour | Open in Colab |
| Chapter 05: LayerNorm | 1-2 hours | Open in Colab |
| Chapter 06: AttentionHead | 3-4 hours | Open in Colab |
| Chapter 07: MultiHeadAttention | 1-2 hours | Open in Colab |
| Chapter 08: FeedForward | 1-2 hours | Open in Colab |
| Chapter 09: TransformerBlock | 0.5-1 hour | Open in Colab |
| Chapter 10: VocabularyLogits | 0.5-1 hour | Open in Colab |
| Chapter 11: nanoGPT | 1-2 hours | Open in Colab |
| Chapter 12: Trainer | 1-2 hours | Open in Colab |
| Chapter 13: Tokens per second (CPU) | 1-2 hours | Open in Colab |
| Chapter 14: Tokens per second (T4 GPU) | 0.5-1 hour | Open in Colab |
| Chapter 15: Train nanoGPT with GPU | 0.5-1 hour | Open in Colab |
| Chapter 16: Make only the model size bigger | 0.5-1 hour (+ 1 hour model training) | Open in Colab |
| Chapter 17: Make the dataset bigger | 1-2 hours (+ 1 hour model training) | Open in Colab |
| Chapter 18: tiktoken | 1-2 hours (+ 1 hour model training) | Open in Colab |
| Chapter 19: Long Train | 1-2 hours (+ 6 hours model training) | Open in Colab |
| Chapter 20: Learning rate | 0.5-1 hour | Open in Colab |
| Chapter 21: Scaling Law | 1-2 hours | Open in Colab |
| Chapter 22: TinyStories (Main) | 1-2 hours | Open in Colab |
| Chapter 22: TinyStories (Model Training) | 1 hour | Open in Colab |
| Chapter 23: RPE (OverSimplified) | 2-3 hours | Open in Colab |
| Chapter 24: RPE (Simplified) | 1-2 hours (+ 1 hour model training) | Open in Colab |
| Chapter 25: LR schedule | 1 hour | Open in Colab |
| Chapter 26: Checkpoint | 1 hour | Open in Colab |
| Chapter 27: Pretraining | 0.5 hour (+ 20 hours model training) | Open in Colab |
| Chapter 28: Instruction Tuning | 0.5 hour (+ 0.5 hour model training) | Open in Colab |
| Chapter 29: Magpie (Prompt mask) | 1.5 hours (+ 2 hours model training) | Open in Colab |
2026/6/5 Vision LLM beta is now available!
Explanations and exercises are not available yet. Evaluation on major benchmarks is also not available yet.
Please use it for early preview learning. We plan to update it from time to time, so we recommend working on it after future updates.
| Chapter | Estimated time | Notebook |
|---|---|---|
| Chapter 30: Vision Pretraining (Beta) | 3 hours model training | Open in Colab |
| Chapter 31: Vision Instruction Tuning (Beta) | 2 hours model training | Open in Colab |
Link to Web App (Vision LLM) (https://huggingface.co/spaces/HayatoHongoEveryonesAI/EveryonesGPT_Vision_Instruct_noRoPE)
Tensor Map (Full Tensor Overview)
Try making the tensor map below by yourself!
Do not worry, I prepared lots of hints for you.
View the full-resolution Tensor Map of the nanoGPT model on Canva

About the Development Environment
To keep setup easy, please try running all the samples on Google Colab.
However, Google Colab does not save checkmarks in checkboxes.
If you want to track your progress, or if you want to work little by little, say every 30 minutes, I recommend VS Code.
In that case, fork this repository and clone it to your own PC.
Just use the Google Colab extension for VS Code, then you can use Colab CPU and GPU.
Answers
| Chapter | Estimated Time | Notebook |
|---|---|---|
| Chapter 00: Start Tutorial | 1-2 hours | Open in Colab |
| Chapter 01: Dataloader | 1-2 hours | Open in Colab |
| Chapter 02: TokenEmbedding | 0.5-1 hour | Open in Colab |
| Chapter 03: PositionEmbedding | 0.5-1 hour | Open in Colab |
| Chapter 04: EmbeddingModule | 0.5-1 hour | Open in Colab |
| Chapter 05: LayerNorm | 1-2 hours | Open in Colab |
| Chapter 06: AttentionHead | 3-4 hours | Open in Colab |
| Chapter 07: MultiHeadAttention | 1-2 hours | Open in Colab |
| Chapter 08: FeedForward | 1-2 hours | Open in Colab |
| Chapter 09: TransformerBlock | 0.5-1 hour | Open in Colab |
| Chapter 10: VocabularyLogits | 0.5-1 hour | Open in Colab |
| Chapter 11: nanoGPT | 1-2 hours | Open in Colab |
| Chapter 12: Trainer | 1-2 hours | Open in Colab |
| Chapter 13: Tokens per second (CPU) | 1-2 hours | Open in Colab |
| Chapter 14: Tokens per second (T4 GPU) | 0.5-1 hour | Open in Colab |
| Chapter 15: Train nanoGPT with GPU | 0.5-1 hour | Open in Colab |
| Chapter 16: Make only the model size bigger | 0.5-1 hour (+ 1 hour model training) | Open in Colab |
| Chapter 17: Make the dataset bigger | 1-2 hours (+ 1 hour model training) | Open in Colab |
| Chapter 18: tiktoken | 1-2 hours (+ 1 hour model training) | Open in Colab |
| Chapter 19: Long Train | 1-2 hours (+ 6 hours model training) | Open in Colab |
| Chapter 20: Learning rate | 0.5-1 hour | Open in Colab |
| Chapter 21: Scaling Law | 1-2 hours | Open in Colab |
| Chapter 22: TinyStories (Main) | 1-2 hours | Open in Colab |
| Chapter 22: TinyStories (Model Training) | 1 hour | Open in Colab |
| Chapter 23: RPE (OverSimplified) | 2-3 hours | Open in Colab |
| Chapter 24: RPE (Simplified) | 1-2 hours (+ 1 hour model training) | Open in Colab |
Similar Articles
@GitHub_Daily: Want to understand how Large Language Models actually work? Existing resources are either too academic and hard to digest, or too superficial, focusing only on concepts, with nothing that clearly explains the entire process from start to finish. Similarly, I came across the 'how-llms-work' project, which turns the complete workflow of LLMs into a visual interactive webpage, based on Andrej Karpathy’s...
An interactive visual guide, 'how-llms-work', breaks down the entire lifecycle of Large Language Models based on Andrej Karpathy's lectures, covering data collection to post-training.
@GitHub_Daily: How do large language models work internally, why do they hallucinate, and why do they sometimes give irrelevant answers? For a deeper understanding, check out the Awesome LLM Interpretability resource collection, which provides a systematic path to unpack the AI black box. It covers attention visualization, neuron analysis, and more.
Introduces the Awesome LLM Interpretability resource collection, which gathers various interpretability tools, papers, and community resources to help understand the internal workings of large language models.
@Jolyne_AI: An open-source hands-on book: "Hands-On Large Language Models". The book has 12 chapters, progressing from language model fundamentals to prompt engineering, semantic search, model fine-tuning, and multimodal applications, covering the key paths to deploying large models in practice. GitHub: h…
An open-source hands-on book "Hands-On Large Language Models", with 12 chapters covering language model fundamentals, prompt engineering, semantic search, model fine-tuning, and multimodal applications. It provides runnable code examples, ideal for practical learning.
@Xx15573208: I've read many articles about Transformers and understand the theory, but when I actually sit down to write code, I have no idea where to start. LLMs-from-scratch is specifically designed to solve this problem: it accompanies the book "Build a Large Language Model" and guides you through implementing GPT from scratch using PyTorch…
LLMs-from-scratch is a GitHub repository that accompanies the book "Build a Large Language Model," providing complete code to implement GPT from scratch with PyTorch, covering the full pipeline including pretraining, fine-tuning, and RLHF. It has gained 93K+ stars and is ideal for developers who want to deeply understand the principles behind large language models.
@XAMTO_AI: Stop bookmarking those flashy but useless AI tutorials. This 'Hands-On Large Models' is what you really need—open source, free, and code that runs. The book covers 12 chapters, guiding you step by step through the complete workflow of deploying large models: ① Language Model Basics ② Prompt Engineering ③ Semantic Search ④ Model Fine-Tuning ⑤ Multimodal…
Recommend an open-source free tutorial 'Hands-On Large Models', covering 12 chapters including language model basics, prompt engineering, semantic search, model fine-tuning, multimodal applications, etc. All code can be run directly in Colab.