karpathy/llm.c
LLM training in simple, raw C/CUDA observed · 2026-08-28
Health v2 · maintenance only
37/100
- Activity 28
- Release rhythm 35
- Longevity 62
Flags: no_releases
How is this computed?
round(0.45*activity + 0.35*rhythm + 0.20*longevity); archived -> min(score, 10) — computed 2026-09-02. Adoption (stars, forks) is never an input.
- gap_med: n/a
- age_days: 877
- days_rel: n/a
- days_push: 433
- n_releases_24m: 0
Adoption not part of the score
30879 stars · 3744 forks observed · 2026-08-28
What it is AI-extracted, prompt v1, taxonomy v1, 2026-08-29, confidence not recorded
llm.c is a pure C/CUDA implementation for training large language models like GPT-2 and GPT-3, with no dependency on PyTorch or Python. It includes a compact ~1,000-line CPU reference implementation and a faster-than-PyTorch CUDA training path.
Use cases
- train a GPT-2 model from scratch in pure C
- learn how LLM training works at the CUDA level
- pretrain GPT-2/GPT-3 scale models without PyTorch
- study a minimal readable LLM training implementation
- benchmark custom CUDA training against PyTorch
- run LLM pretraining on a single GPU with fp32
When to choose
- you want to understand or modify every detail of LLM training in C/CUDA
- you need a lightweight training stack without PyTorch's overhead
- you're reproducing GPT-2/GPT-3 pretraining on NVIDIA GPUs
- you're learning CUDA through a real, high-performance codebase
When to avoid
- you need a production training framework with broad model support
- you want fine-tuning, RLHF, or inference features out of the box
- you don't have NVIDIA GPUs and need multi-backend support
- you prefer Python ecosystem tooling and integrations
Facets
library · maturity active
llm-training deep-learning machine-learning gpu-computing large-language-models deep-learning machine-learning gpu-computing cpp c cuda gpt-2 gpt-3 pretraining educational no-pytorch karpathy linux gpu
1 source
- readme: https://github.com/karpathy/llm.c · fetched 2026-08-28 · c6ba00b6e2cf
Member repositories
| Repository | Role | Health v2 |
|---|---|---|
| karpathy/llm.c | main | 37 |
For agents
Data as of 2026-08-30T08:39:29.467469+00:00 · Report a problem