There is a GitHub repository with more than 565,000 stars that is not a tool, not an app, and not a model. It is a list — a curated collection of step-by-step guides for rebuilding famous technologies from scratch: your own Git, your own Docker, your own database, your own operating system. It is called build-your-own-x, and its philosophy is a line from physicist Richard Feynman: "What I cannot create, I do not understand." For AI learners, its most valuable corner is the AI Model section — seven free Python guides that take you from a blank file to a working LLM. The best place to start is the lead guide, LLMs-from-scratch, the official code for Sebastian Raschka's book Build a Large Language Model (From Scratch). Here is the complete guide: what it is, what you actually build, and exactly how to run it free.
What build-your-own-x actually is
First, the honest framing: build-your-own-x is a list of links, not software you install. Each entry points to a free tutorial, book, or course that rebuilds one technology from first principles. It covers around 33 categories — 3D renderers, BitTorrent clients, blockchains, databases, Docker, emulators, game engines, operating systems, search engines, shell, text editors, web browsers and more. The repository itself is free; CodeCrafters, the company behind it, sells guided coding challenges separately, but the list costs nothing. With 565,872 stars and 52,865 forks (checked 27 November 2026), it is one of the most-starred repositories on GitHub — and a roadmap for anyone who wants to truly understand how the software they use every day works.
The AI Model section: 7 free guides
All seven guides are in Python, and all are linked from the AI Model section of the list:
| Guide | What you build |
|---|---|
| A Large Language Model (LLM) | A ChatGPT-like GPT model in PyTorch, from scratch |
| A Reasoning Model | An LLM with inference-time scaling, GRPO and distillation |
| Diffusion Models | Image generation models, from scratch |
| An LLM Evaluation Harness | Test cases, a runner, and rule-based and LLM judges |
| RAG for Document Search | Retrieval-augmented generation over your own documents |
| A Coding Agent | An agent that writes and edits code, from scratch |
| Sparse Autoencoders | Toy models of superposition, then train your own SAE |
Start here: LLMs-from-scratch
The LLM guide is the repository rasbt/LLMs-from-scratch — 109,119 stars, 16,869 forks — and it is the official code for the book Build a Large Language Model (From Scratch). The code is free; the book and the 17-hour-15-minute companion video course are paid, and this post says so plainly, because the distinction matters. What you build, chapter by chapter:
| Chapter | What you do |
|---|---|
| Ch 1 — Understanding LLMs | How large language models work (no code) |
| Ch 2 — Working with Text Data | Build a tokenizer and a data loader |
| Ch 3 — Coding Attention Mechanisms | Implement attention, then multi-head attention |
| Ch 4 — Implementing a GPT Model | Assemble a working GPT model from scratch |
| Ch 5 — Pretraining on Unlabeled Data | Train your small model on text |
| Ch 6 — Finetuning for Classification | Teach the model to classify text (e.g. spam) |
| Ch 7 — Finetuning to Follow Instructions | Instruction-tune it so it follows directions |
Appendices cover a PyTorch introduction (Appendix A) and parameter-efficient finetuning with LoRA (Appendix E). There is also a free 170-page quiz PDF from Manning with around 30 questions per chapter, so you can test yourself as you go.
How to run it free, step by step
The README states the code is "designed to run on conventional laptops within a reasonable timeframe and does not require specialized hardware" — a GPU speeds it up, but you do not need one. Here is the full path:
- Clone the repo:
git clone --depth 1 https://github.com/rasbt/LLMs-from-scratch.git— or click Download ZIP on the GitHub page. - Set up Python: read the
setupfolder's README in the repo for the recommended Python setup and package installation. You need a solid Python foundation; PyTorch basics help, and Appendix A covers PyTorch from the start. - Open the notebooks: each chapter is a Jupyter notebook (
ch02.ipynb,ch03.ipynband so on). Open them in Jupyter on your laptop, or upload them to Google Colab for a free GPU — Colab's free tier gives you a GPU that makes the training chapters run much faster. - Work chapters 2 to 4 in order: tokenizer, then attention, then the full GPT model. Do the exercises — solutions are in Appendix C and in each chapter folder.
- Pretrain a small model (Ch 5): start with the small educational model in the chapter, not a ChatGPT-scale one. Full pretraining takes time even for a small model; let it run and watch the loss fall.
- Finetune it (Ch 6–7): first a spam classifier, then instruction tuning — and you have a model that follows directions, built entirely by you.
Honest limits — read before you start
- This is intermediate level, not for absolute beginners. You need a strong Python foundation before chapter 2 makes sense.
- The book and video course are paid; the code is free. You can follow the code and the chapter notebooks without buying anything, but the book's explanations are what make the code click.
- No GPU is required, but a GPU helps. The code uses a GPU automatically if one is available; on a plain laptop, use the small models and be patient — or use Colab's free GPU.
- We did not run the notebooks end to end for this post. The laptop-friendly claim is the README's own statement, and the code is tested on Linux, Windows and macOS in the repo's CI. Start small, expect debugging, and treat the first run as learning, not a race.
What to build after your LLM
Once your model trains and answers, go back to the AI Model section of build-your-own-x and pick the next guide: the Reasoning Model guide (a sequel book by the same author, Build a Reasoning Model (From Scratch), covers inference-time scaling and reinforcement learning), the RAG guide to search your own documents, or the Coding Agent guide. And the list does not stop at AI — the same "build it to understand it" method works for Git, Docker, databases and operating systems, all free, all in the same repository.
Bottom line
Build-your-own-x is the most-starred learning roadmap on GitHub for a reason: it turns "how does ChatGPT actually work?" from a mystery into a weekend project. Start with LLMs-from-scratch, work chapters 2 to 4 on your laptop or free on Colab, and you will have written every line of a working GPT model yourself. Nobody who has done that ever looks at AI the same way again.
Sources: GitHub — codecrafters-io/build-your-own-x (565,872 stars, 27 Nov 2026) · GitHub — rasbt/LLMs-from-scratch (109,119 stars, 27 Nov 2026) · Book (paid, labelled): Manning — Build a Large Language Model (From Scratch). Hero photo: a developer writing code on a laptop, free stock photo via Shopify Burst.
