rasbt/LLMs-from-scratch

Implement a ChatGPT-like LLM in PyTorch from scratch, step by step

69
/ 100
Established

Covers the complete pipeline from tokenization and attention mechanisms through pretraining on unlabeled data and finetuning for classification and instruction-following tasks. Includes practical implementations of multi-head attention, causal masking, and parameter-efficient techniques like LoRA, alongside code for loading pretrained model weights. Organized as Jupyter notebooks and standalone Python scripts that progressively build a functional GPT architecture while explaining each component's role in modern LLM training.

87,892 stars. Actively maintained with 8 commits in the last 30 days.

No Package No Dependents
Maintenance 20 / 25
Adoption 10 / 25
Maturity 16 / 25
Community 23 / 25

How are scores calculated?

Stars

87,892

Forks

13,408

Language

Jupyter Notebook

License

Last pushed

Mar 07, 2026

Commits (30d)

8

Get this data via API

curl "https://pt-edge.onrender.com/api/v1/quality/transformers/rasbt/LLMs-from-scratch"

Open to everyone — 100 requests/day, no key needed. Get a free key for 1,000/day.