FareedKhan-dev/train-llm-from-scratch

★13,379Python🌐 ElsewhereMIT⑂ 1,851Issue 1Updated Nov 16, 2026

A straightforward method for training your LLM, from downloading data to generating text.

A from-scratch LLM pipeline covering pretraining through RLHF — A full PyTorch-only path from raw text to an aligned, reasoning-capable model, with no trl, peft or transformers dependencies. Covers both a classic transformer and a modern architecture (RoPE, RMSNorm, MoE, KV cache), plus hand-written SFT, DPO, GRPO, LoRA and speculative decoding. Aimed at learners wanting to train LLMs from scratch on a single GPU or even CPU.

Learning & resourcesgeminilarge-language-modelsllmopenaitrainingtransformers

Metrics

Relative growth (7d)+0%Growth over the last 7 days relative to size
Acceleration+20%Change in growth pace from the week before
Retention+38%How well growth holds up 30 days after first trending
Attention36The three metrics scaled to 0–100 and combined

See About for how each metric is defined.

Star growth and Trending appearances (last 30 days)

+18★/day
Nov 6, 2026Dec 5, 2026
Daily trending ranks as a table (9 days)
DateDailyWeekly
Sep 30, 2026—
python #13 +955
Sep 29, 2026—
python #13 +921
Sep 28, 2026—
python #12 +1,179
Sep 27, 2026—
python #10 +1,356
Sep 26, 2026—
python #14 +1,376
Sep 25, 2026—
python #11 +1,294
Sep 24, 2026—
python #10 +1,271
Sep 23, 2026
python #7 +141
—
Sep 21, 2026
python #5 +265
—

Created Jan 12, 2025 · First on trending Sep 21, 2026

Other notable repositories in the same category (Learning & resources)

See all Learning & resources repositories →

Rank within gemini

#Repository★
1Graphify-Labs/graphify157,154
2google-gemini/gemini-cli109,614
3cheaper-inference/OmniRoute92,275
4lobehub/lobehub86,442
5asgeirtj/system_prompts_leaks74,120
6code-yeongyu/oh-my-openagent71,330
7tw93/Pake64,248
8router-for-me/CLIProxyAPI60,033
9QuantumNous/new-api53,024
10Aider-AI/aider50,369
30FareedKhan-dev/train-llm-from-scratch13,379

See all gemini repositories →

Get the weekly digest by email

Every Monday: the repositories that grew most last week, and how the buzz spread between the global and Japanese-language web. Unsubscribe any time. See the privacy and ad policy for how we handle your address.