{"adoption": {"forks": 1306, "observed_at": "2026-08-28T04:10:31.141924+00:00", "stars": 9432}, "canonical_url": "https://ross.abutalabs.com/products/train-llm-from-scratch", "card": {"archived": false, "artifact_type": "learning-resource", "description": "A straightforward method for training your LLM, from downloading data to generating text.", "domain": ["large-language-models", "deep-learning", "machine-learning", "tutorials", "artificial-intelligence"], "enriched": true, "function": ["llm-training", "deep-learning", "machine-learning", "nlp", "developer-tools"], "health_score": 79, "homepage": "https://fareedkhan-dev.github.io/train-llm-from-scratch/", "language": "Python", "license": "MIT", "license_family": "permissive", "maturity": "active", "member_repos": ["FareedKhan-dev/train-llm-from-scratch"], "name": "FareedKhan-dev/train-llm-from-scratch", "platform": ["python", "cross-platform"], "pushed_at": "2026-08-17T05:07:26+00:00", "repo": "FareedKhan-dev/train-llm-from-scratch", "stars": 9432, "tags": ["transformer-from-scratch", "pytorch", "pretraining", "sft", "rlhf", "dpo", "ppo", "grpo", "reward-model", "educational", "single-gpu", "natural-language-processing", "gpu"], "topics": ["gemini", "large-language-models", "llm", "openai", "training", "transformers"], "urls": [], "use_cases": ["learn how transformers work by implementing attention from scratch", "train a small LLM on a single GPU", "understand RLHF alignment algorithms like DPO and PPO", "build a next-token prediction model from raw text", "study the full LLM training pipeline end to end", "implement reward models and GRPO in plain PyTorch"], "what_it_is": "An educational repository and tutorial that implements a transformer-based LLM entirely from scratch in plain PyTorch, covering the full pipeline from raw text data to an aligned, reasoning-style model. It walks through pretraining, SFT, reward modeling, and preference optimization (DPO, PPO, GRPO) without relying on libraries like transformers, trl, or peft.", "when_to_avoid": ["you need a production-ready LLM training framework with optimizations and ecosystem support", "you want to fine-tune existing pretrained models quickly with Hugging Face tooling", "you need multi-node distributed training at scale", "you are looking for inference or deployment tooling rather than training education"], "when_to_choose": ["you want to deeply understand LLM internals rather than use high-level libraries", "you are learning how pretraining, SFT, and RLHF fit together", "you need a from-scratch PyTorch reference implementation of transformer training", "you want to train a small (million to billion parameter) model on limited hardware"]}, "data_as_of": "2026-08-30T08:39:29.467469+00:00", "members": [{"path": "/products/train-llm-from-scratch", "repo": "FareedKhan-dev/train-llm-from-scratch", "role": "main", "score": 65}], "provenance": {"archived": {"kind": "observed", "observed_at": "2026-08-28T04:10:31.141924+00:00", "source": "github"}, "artifact_type": {"confidence": null, "enriched_at": "2026-08-29T17:22:07.990877+00:00", "kind": "inferred", "prompt_version": 1, "sources": [{"content_hash": "57fd0a66b98830bf0218981442dec59fb467479705bce09c3ee51f2089eec596", "fetched_at": "2026-08-28T04:10:31.141924+00:00", "kind": "readme", "missing": false, "url": "https://github.com/FareedKhan-dev/train-llm-from-scratch"}, {"content_hash": "0ebf2b5131ef247b288083eb6d2b4091dff427147d06be562fa24ea8f5355eb3", "fetched_at": "2026-08-29T08:22:06.271476+00:00", "kind": "homepage", "missing": false, "url": "https://fareedkhan-dev.github.io/train-llm-from-scratch/"}], "taxonomy_version": 1}, "description": {"kind": "observed", "observed_at": "2026-08-28T04:10:31.141924+00:00", "source": "github"}, "domain": {"confidence": null, "enriched_at": "2026-08-29T17:22:07.990877+00:00", "kind": "inferred", "prompt_version": 1, "sources": [{"content_hash": "57fd0a66b98830bf0218981442dec59fb467479705bce09c3ee51f2089eec596", "fetched_at": "2026-08-28T04:10:31.141924+00:00", "kind": "readme", "missing": false, "url": "https://github.com/FareedKhan-dev/train-llm-from-scratch"}, {"content_hash": "0ebf2b5131ef247b288083eb6d2b4091dff427147d06be562fa24ea8f5355eb3", "fetched_at": "2026-08-29T08:22:06.271476+00:00", "kind": "homepage", "missing": false, "url": "https://fareedkhan-dev.github.io/train-llm-from-scratch/"}], "taxonomy_version": 1}, "enriched": {"inputs": [], "kind": "computed", "method": "enrichment_status"}, "function": {"confidence": null, "enriched_at": "2026-08-29T17:22:07.990877+00:00", "kind": "inferred", "prompt_version": 1, "sources": [{"content_hash": "57fd0a66b98830bf0218981442dec59fb467479705bce09c3ee51f2089eec596", "fetched_at": "2026-08-28T04:10:31.141924+00:00", "kind": "readme", "missing": false, "url": "https://github.com/FareedKhan-dev/train-llm-from-scratch"}, {"content_hash": "0ebf2b5131ef247b288083eb6d2b4091dff427147d06be562fa24ea8f5355eb3", "fetched_at": "2026-08-29T08:22:06.271476+00:00", "kind": "homepage", "missing": false, "url": "https://fareedkhan-dev.github.io/train-llm-from-scratch/"}], "taxonomy_version": 1}, "health_score": {"inputs": ["days_since_push", "days_since_release", "archived"], "kind": "computed", "method": "health_v1"}, "homepage": {"kind": "observed", "observed_at": "2026-08-28T04:10:31.141924+00:00", "source": "github"}, "language": {"kind": "observed", "observed_at": "2026-08-28T04:10:31.141924+00:00", "source": "github"}, "license": {"kind": "observed", "observed_at": "2026-08-28T04:10:31.141924+00:00", "source": "github"}, "license_family": {"inputs": ["license"], "kind": "computed", "method": "license_family"}, "maturity": {"confidence": null, "enriched_at": "2026-08-29T17:22:07.990877+00:00", "kind": "inferred", "prompt_version": 1, "sources": [{"content_hash": "57fd0a66b98830bf0218981442dec59fb467479705bce09c3ee51f2089eec596", "fetched_at": "2026-08-28T04:10:31.141924+00:00", "kind": "readme", "missing": false, "url": "https://github.com/FareedKhan-dev/train-llm-from-scratch"}, {"content_hash": "0ebf2b5131ef247b288083eb6d2b4091dff427147d06be562fa24ea8f5355eb3", "fetched_at": "2026-08-29T08:22:06.271476+00:00", "kind": "homepage", "missing": false, "url": "https://fareedkhan-dev.github.io/train-llm-from-scratch/"}], "taxonomy_version": 1}, "member_repos": {"kind": "observed", "observed_at": "2026-08-28T04:10:31.141924+00:00", "source": "github"}, "name": {"kind": "observed", "observed_at": "2026-08-28T04:10:31.141924+00:00", "source": "github"}, "platform": {"confidence": null, "enriched_at": "2026-08-29T17:22:07.990877+00:00", "kind": "inferred", "prompt_version": 1, "sources": [{"content_hash": "57fd0a66b98830bf0218981442dec59fb467479705bce09c3ee51f2089eec596", "fetched_at": "2026-08-28T04:10:31.141924+00:00", "kind": "readme", "missing": false, "url": "https://github.com/FareedKhan-dev/train-llm-from-scratch"}, {"content_hash": "0ebf2b5131ef247b288083eb6d2b4091dff427147d06be562fa24ea8f5355eb3", "fetched_at": "2026-08-29T08:22:06.271476+00:00", "kind": "homepage", "missing": false, "url": "https://fareedkhan-dev.github.io/train-llm-from-scratch/"}], "taxonomy_version": 1}, "pushed_at": {"kind": "observed", "observed_at": "2026-08-28T04:10:31.141924+00:00", "source": "github"}, "repo": {"kind": "observed", "observed_at": "2026-08-28T04:10:31.141924+00:00", "source": "github"}, "stars": {"kind": "observed", "observed_at": "2026-08-28T04:10:31.141924+00:00", "source": "github"}, "tags": {"confidence": null, "enriched_at": "2026-08-29T17:22:07.990877+00:00", "kind": "inferred", "prompt_version": 1, "sources": [{"content_hash": "57fd0a66b98830bf0218981442dec59fb467479705bce09c3ee51f2089eec596", "fetched_at": "2026-08-28T04:10:31.141924+00:00", "kind": "readme", "missing": false, "url": "https://github.com/FareedKhan-dev/train-llm-from-scratch"}, {"content_hash": "0ebf2b5131ef247b288083eb6d2b4091dff427147d06be562fa24ea8f5355eb3", "fetched_at": "2026-08-29T08:22:06.271476+00:00", "kind": "homepage", "missing": false, "url": "https://fareedkhan-dev.github.io/train-llm-from-scratch/"}], "taxonomy_version": 1}, "topics": {"kind": "observed", "observed_at": "2026-08-28T04:10:31.141924+00:00", "source": "github"}, "urls": {"kind": "observed", "observed_at": "2026-08-28T04:10:31.141924+00:00", "source": "github"}, "use_cases": {"confidence": null, "enriched_at": "2026-08-29T17:22:07.990877+00:00", "kind": "inferred", "prompt_version": 1, "sources": [{"content_hash": "57fd0a66b98830bf0218981442dec59fb467479705bce09c3ee51f2089eec596", "fetched_at": "2026-08-28T04:10:31.141924+00:00", "kind": "readme", "missing": false, "url": "https://github.com/FareedKhan-dev/train-llm-from-scratch"}, {"content_hash": "0ebf2b5131ef247b288083eb6d2b4091dff427147d06be562fa24ea8f5355eb3", "fetched_at": "2026-08-29T08:22:06.271476+00:00", "kind": "homepage", "missing": false, "url": "https://fareedkhan-dev.github.io/train-llm-from-scratch/"}], "taxonomy_version": 1}, "what_it_is": {"confidence": null, "enriched_at": "2026-08-29T17:22:07.990877+00:00", "kind": "inferred", "prompt_version": 1, "sources": [{"content_hash": "57fd0a66b98830bf0218981442dec59fb467479705bce09c3ee51f2089eec596", "fetched_at": "2026-08-28T04:10:31.141924+00:00", "kind": "readme", "missing": false, "url": "https://github.com/FareedKhan-dev/train-llm-from-scratch"}, {"content_hash": "0ebf2b5131ef247b288083eb6d2b4091dff427147d06be562fa24ea8f5355eb3", "fetched_at": "2026-08-29T08:22:06.271476+00:00", "kind": "homepage", "missing": false, "url": "https://fareedkhan-dev.github.io/train-llm-from-scratch/"}], "taxonomy_version": 1}, "when_to_avoid": {"confidence": null, "enriched_at": "2026-08-29T17:22:07.990877+00:00", "kind": "inferred", "prompt_version": 1, "sources": [{"content_hash": "57fd0a66b98830bf0218981442dec59fb467479705bce09c3ee51f2089eec596", "fetched_at": "2026-08-28T04:10:31.141924+00:00", "kind": "readme", "missing": false, "url": "https://github.com/FareedKhan-dev/train-llm-from-scratch"}, {"content_hash": "0ebf2b5131ef247b288083eb6d2b4091dff427147d06be562fa24ea8f5355eb3", "fetched_at": "2026-08-29T08:22:06.271476+00:00", "kind": "homepage", "missing": false, "url": "https://fareedkhan-dev.github.io/train-llm-from-scratch/"}], "taxonomy_version": 1}, "when_to_choose": {"confidence": null, "enriched_at": "2026-08-29T17:22:07.990877+00:00", "kind": "inferred", "prompt_version": 1, "sources": [{"content_hash": "57fd0a66b98830bf0218981442dec59fb467479705bce09c3ee51f2089eec596", "fetched_at": "2026-08-28T04:10:31.141924+00:00", "kind": "readme", "missing": false, "url": "https://github.com/FareedKhan-dev/train-llm-from-scratch"}, {"content_hash": "0ebf2b5131ef247b288083eb6d2b4091dff427147d06be562fa24ea8f5355eb3", "fetched_at": "2026-08-29T08:22:06.271476+00:00", "kind": "homepage", "missing": false, "url": "https://fareedkhan-dev.github.io/train-llm-from-scratch/"}], "taxonomy_version": 1}}, "score": {"components": {"activity": 98, "longevity": 42, "rhythm": 35}, "computed_at": "2026-09-02T17:46:02.011165+00:00", "flags": ["no_releases"], "formula": "round(0.45*activity + 0.35*rhythm + 0.20*longevity); archived -> min(score, 10)", "inputs": {"age_days": 598, "days_push": 16, "days_rel": null, "gap_med": null, "n_releases_24m": 0}, "score": 65, "version": 2}, "staleness": {"enrichment_outdated": false, "low_confidence": false, "scrape_days": 9, "stale_scrape": false}}