LLMs-from-scratch and scratch-llm

These are complements rather than competitors: the first provides a comprehensive, production-oriented pedagogical framework for building transformer-based LLMs (covering architecture, training, and inference), while the second offers a lightweight, ground-up implementation specifically focused on replicating Llama 2's design for educational purposes, allowing learners to study both a general approach and a specific modern architecture.

LLMs-from-scratch
69
Established
scratch-llm
40
Emerging
Maintenance 20/25
Adoption 10/25
Maturity 16/25
Community 23/25
Maintenance 0/25
Adoption 7/25
Maturity 16/25
Community 17/25
Stars: 87,892
Forks: 13,408
Downloads:
Commits (30d): 8
Language: Jupyter Notebook
License:
Stars: 38
Forks: 9
Downloads:
Commits (30d): 0
Language: Python
License: MIT
No Package No Dependents
Stale 6m No Package No Dependents

About LLMs-from-scratch

rasbt/LLMs-from-scratch

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

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.

About scratch-llm

clabrugere/scratch-llm

Implements a LLM similar to Meta's Llama 2 from the ground up in PyTorch, for educational purposes.

Scores updated daily from GitHub, PyPI, and npm data. How scores work