FareedKhan-dev/train-llm-from-scratch
A straightforward method for training your LLM, from downloading data to generating text.
About the project
Educational project: a from-scratch PyTorch Transformer plus a full LLM training pipeline — from raw text through SFT, reward modeling, PPO/DPO/GRPO to chat, without transformers, trl or peft.
Useful for
- Train a small LLM on a single GPU following the README steps
- Study attention and Transformer internals from the source code
- Walk through post-training stages: SFT, reward model, DPO, PPO, GRPO
README summarized by DeepSeek V4.1 Flash. Details may be inaccurate.
Why it’s trending
- 39 stars so far today, about 116 expected by the end of the day. The usual pace is 12 per day, so that's 9.3× as much.
- Over the last two days the pace is 18× that of the previous week and a half.
- The spike has held for 3 days in a row — not a one-off blip.
- GitHub Trending Python today: #5, +196 stars.
- About 40 forks a day — people are taking the code.
Stars per day
Bars are daily stars, the line is the usual pace. Red marks spike days.
Numbers
- Total stars
- 10,004
- Stars in a day
- 116
- Forks
- 1,389
- Issues and pull requests
- 40
- Watchers
- 80
- Language
- Python
- License
- MIT
- Created
- January 12, 2025
- Last push
- August 17, 2026
Star trust
Growth looks organic: forks and discussion are in line with active projects, and stars arrive unevenly, the way people give them.
These are heuristics, not a verdict: we judge by the repository’s behavior, not by a list of stargazers.
Spotted in
- September 20, 2026GitHub Trending Python today: #5, +196 stars
Similar projects
-
7.4
TianyuCodings/NanoJev
A nano replica of Jev built on Qwen3-0.6B that outputs probability distributions over candidates in a single forward pass with no token decoding, plus a training pipeline and game demos (maze, Snake).
-
7.2
mizorewww/laya-mlx
Native MLX runtime for Laya typed decision models: returns probabilities for choices, scores or truth values without text generation, running locally on Apple Silicon.
-
7.0
bespokelabsai/nimble
Nimble is a model and training recipe for fast typed decisions over text: given a flat schema of enum and boolean fields, it picks an answer and returns probabilities for each option. It targets routing, condition…
-
7.0
docling-project/docling
Docling is a document parsing library for many formats (PDF, DOCX, PPTX, XLSX, HTML, EPUB, audio, video) with advanced PDF understanding: page layout, tables, formulas, OCR. It prepares structured data for generative…
-
6.9
githubnext/localjev
A local TypeScript/Bun HTTP service implementing a Jev-compatible POST /v1/systemone API on top of an OpenAI-compatible Chat Completions endpoint (DiffusionGemma via oMLX). It acts as a bridge for typed decisions…
-
6.8
jaredpalmer/kev
kev is a LoRA adapter with a small readout head on top of Qwen2.5-0.5B that answers many typed questions about a document in a single forward pass, returning calibrated probabilities instead of text.