explaingit

datawhalechina/happy-llm

30,388Jupyter NotebookAudience · developerComplexity · 3/5ActiveSetup · moderate

TLDR

Free, open-source course teaching how large language models work and how to build one from scratch using PyTorch, with theory and hands-on coding in Jupyter Notebooks.

Mindmap

mindmap
  root((happy-llm))
    What it does
      Teaches LLM internals
      Build models from scratch
      Theory and practice
    Learning path
      Transformer architecture
      Pre-training fundamentals
      Fine-tuning techniques
    Hands-on projects
      Implement LLaMA2 model
      Train with PyTorch
      RAG and Agents
    Tech stack
      PyTorch
      Jupyter Notebooks
      Python
    Audience
      Students and researchers
      Developers learning AI
      LLM enthusiasts

Things people build with this

USE CASE 1

Learn how transformer models and LLMs work by studying theory and implementing them step-by-step.

USE CASE 2

Build and train your own language model from scratch using PyTorch without paying for a course.

USE CASE 3

Understand fine-tuning techniques like LoRA to adapt pre-trained models to specific tasks efficiently.

USE CASE 4

Implement advanced LLM features like RAG and Agents to make models that retrieve information and take actions.

Tech stack

PythonPyTorchJupyter NotebookTransformerLLaMA2

Getting it running

Difficulty · moderate Time to first run · 30min

PyTorch installation and Jupyter environment setup required; GPU optional but recommended for training examples.

License could not be detected automatically. Check the repository's LICENSE file before use.

In plain English

Happy-LLM is a free, open-source learning course that teaches people how large language models (LLMs), the technology behind AI chat tools, actually work under the hood, and how to build one from scratch. The course is written in Chinese and uses Jupyter Notebooks to combine explanations with runnable code. The course is divided into two parts. The first part covers the foundational theory: what natural language processing (NLP) is, how the Transformer architecture works (Transformer is the core design pattern used by virtually all modern AI language models), and how pre-trained language models are structured. The second part is hands-on: learners implement a complete LLM based on the LLaMA2 design, train it from scratch using PyTorch (a programming framework for machine learning), then apply it using techniques like RAG (Retrieval-Augmented Generation, where the model looks up external information before answering) and Agents (systems where the model takes actions, not just answers questions). The course also covers fine-tuning, taking an existing pre-trained model and adapting it to a specific task, using methods like LoRA and QLoRA, which are efficient techniques that reduce the computing resources needed. Someone would use this if they want to go beyond just using AI tools and actually understand how they work internally, or if they are a student, researcher, or developer who wants a structured, hands-on path into LLM development without paying for a course.

Copy-paste prompts

Prompt 1
Walk me through the happy-llm course structure: what are the main topics covered in part 1 and part 2?
Prompt 2
Show me how to implement the LLaMA2 model from scratch using the happy-llm notebooks and PyTorch.
Prompt 3
Explain the LoRA and QLoRA fine-tuning methods covered in happy-llm and why they reduce computing costs.
Prompt 4
How do I use the happy-llm course to build a RAG system that retrieves external information before answering questions?
Prompt 5
What are the prerequisites I need before starting the happy-llm course, and which notebook should I begin with?
Open on GitHub → Explain another repo

Generated 2026-05-18 · Model: sonnet-4-6 · Verify against the repo before relying on details.