# vivekkalyanarangan30/llm_from_scratch

Repository: https://github.com/vivekkalyanarangan30/llm_from_scratch
Canonical: https://ross.abutalabs.com/products/llm_from_scratch
Language: Python
License: GPL-3.0
License Family: copyleft
Last push: 2025-10-23T11:29:04+00:00

## Health v2 (maintenance only)
Score: 39/100 (v2, computed 2026-09-02T17:46:02.011165+00:00)
- activity 48, release rhythm 35, longevity 27
- inputs: {"age_days": 389, "days_push": 314, "days_rel": null, "gap_med": null, "n_releases_24m": 0}
- flags: no_releases
- formula: round(0.45*activity + 0.35*rhythm + 0.20*longevity); archived -> min(score, 10)

## Adoption (not part of the score)
Stars 1102, forks 287 (observed 2026-08-28T04:03:35.929104+00:00)

## What it is
A hands-on Python/PyTorch curriculum that builds large language models from scratch, covering transformer architecture, training, modern improvements like RoPE and MoE, and alignment via SFT, reward modeling, and PPO-based RLHF. It is structured as a step-by-step educational course with runnable code rather than a production library.

## Use cases
- learn how transformers and self-attention work from first principles
- train a tiny LLM from scratch in PyTorch
- understand RLHF and PPO implementation
- implement mixture-of-experts layers
- learn modern LLM techniques like RoPE, RMSNorm, and KV cache
- study the full LLM pipeline from pretraining to alignment

## When to choose
- you want to learn LLM internals by coding them yourself
- you need a structured curriculum covering pretraining through RLHF
- you prefer PyTorch-based educational code over high-level frameworks

## When to avoid
- you need a production-ready training framework
- you want pretrained models or inference serving
- you need distributed multi-node training at scale

## Facets
- artifact type: learning-resource
- maturity: active
- function: llm-training, deep-learning, machine-learning
- domain: large-language-models, deep-learning, machine-learning, tutorials
- platform: python, cross-platform
- tags: pytorch, transformer, rlhf, mixture-of-experts, hands-on-curriculum, nano-gpt-style, education, gpu

## Member repositories
- vivekkalyanarangan30/llm_from_scratch (main) score 39

## Provenance
- Observed fields: from GitHub, fetched 2026-08-28T04:03:35.929104+00:00.
- Health v2: computed from the inputs above; adoption is never an input.
- Inferred fields (summary, facets, guidance): AI-extracted, prompt v1, taxonomy v1, on 2026-08-30T06:45:40.019465+00:00, confidence not recorded.
  - readme: https://github.com/vivekkalyanarangan30/llm_from_scratch (fetched 2026-08-28T04:03:35.929104+00:00, sha ccc425b1eb1f)
- Data as of 2026-08-30T08:39:29.467469+00:00.
