← all repositories
datawhalechina/tiny-universe

Build a toy LLM cosmos from scratch, no black boxes allowed

A Chinese-language tutorial collection that rebuilds a full LLM pipeline from raw PyTorch, because API wrappers teach you nothing about what happens inside.

tiny-universe
Not currently ranked — collecting fresh signals.
star history

What it does

Tiny-Universe is a set of Jupyter-based tutorials that walk you through hand-building the core components of a modern AI stack. It covers an LLM (TinyLlama3), a diffusion model (TinyDiffusion), a Transformer, plus surrounding infrastructure: RAG (including GraphRAG), an Agent system, and an evaluation framework (TinyEval). Everything is built from first principles using PyTorch and NumPy, deliberately avoiding the convenience of pre-built frameworks so you can see the wiring.

The interesting bit

The project treats “white box” understanding as a feature, not a side effect. It doesn’t just build a model; it builds the entire lifecycle—pre-training a Llama3-compatible model on roughly 2 GB of VRAM, then evaluating it with custom metrics (including Chinese Gaokao math problems), augmenting it with a hand-rolled RAG retriever, and wrapping it in a minimal ReAct agent. The Qwen-Blog module even dissects a real production architecture by tracing a single input tensor through GQA, RoPE, and attention masks.

Key highlights

  • Full-stack scope: model pre-training, diffusion, RAG, GraphRAG, agent tooling, and evaluation in one curriculum.
  • Low resource footprint: TinyLlama3 pre-training targets ~2 GB VRAM; TinyDiffusion claims a two-hour pre-training cycle.
  • Code is intentionally minimal and “white box,” aimed at readability over production robustness.
  • Includes video walkthroughs (Tencent Meeting recordings) for several modules.
  • Active expansion: recent additions include GraphRAG and academic reproductions like CDDRS.

Caveats

  • All materials and explanations are in Chinese, which limits the audience.
  • The TinyAgent module is explicitly described as more of a minimal tool-calling demo than a full autonomous agent, with more advanced architectures still planned.
  • Some performance claims, such as the two-hour diffusion pre-training, appear in release notes without detailed reproducibility benchmarks in the documentation.

Verdict

Ideal for Chinese-speaking developers with basic deep learning knowledge who are tired of framework magic and want to see the wiring behind LLMs, RAG, and agents. Skip it if you are looking for a production-ready framework or an English-language resource; this is a pedagogical repo, not a library.

Frequently asked

What is datawhalechina/tiny-universe?
A Chinese-language tutorial collection that rebuilds a full LLM pipeline from raw PyTorch, because API wrappers teach you nothing about what happens inside.
Is tiny-universe open source?
Yes — datawhalechina/tiny-universe is an open-source project tracked on heatdrop.
What language is tiny-universe written in?
datawhalechina/tiny-universe is primarily written in Jupyter Notebook.
How popular is tiny-universe?
datawhalechina/tiny-universe has 5k stars on GitHub.
Where can I find tiny-universe?
datawhalechina/tiny-universe is on GitHub at https://github.com/datawhalechina/tiny-universe.

heatdrop uses Google Analytics to see which pages get read — nothing else. Your call. How we handle data.