llm.c
Source
- Source kind:
github-repository - URL: https://github.com/karpathy/llm.c
- Discovery source: https://github.com/karpathy/llm.c
- License:
MIT - Distribution policy:
public-summary-plus-license-aware-excerpts - Public mirror status:
partial excerpt - Content hash:
6c746994efbccac748d16aab0bccebf90e31b1272b80aa063f900dce4b84b34c - First seen: 2026-05-15
- Last changed: 2026-05-15
Classification
- Primary category: LLM training and inference systems
- Corpus source note: 2026-05-15-karpathy-public-corpus
- Project taxonomy: karpathy-project-taxonomy
- Idea map: karpathy-idea-map
- Topic hub: karpathy-public-work
Summary
llm.c LLMs in simple, pure C/CUDA with no need for 245MB of PyTorch or 107MB of cPython. Current focus is on pretraining, in particular reproducing the 1 miniseries, along with a parallel PyTorch reference implementation in 1, an earlier project of mine. Currently, llm.c is a bit faster than PyTorch Nightly (by about 7%). In addition to the bleeding edge mainline code in 1. I’d like this repo to only maintain C and CUDA code. Ports to other languages or re…
What This Teaches
- How modern LLM training or inference can be reduced to compact, inspectable systems.
- Useful as a reference for building mental models of GPT-style models without hiding behind framework scale.
Why It Matters
This is high-priority for Vipin because it connects directly to LLM systems, evaluation, and research implementation judgment.
Repository Snapshot
- Full name:
karpathy/llm.c - Default branch:
master - HEAD:
f1e2ace651495b74ae22d45d1723443fd00ecd3a - Stars at crawl: 29911
- Forks at crawl: 3588
- File count: 102
- README path:
README.md - License path:
LICENSE - Created: 2024-04-08T16:58:11Z
- Updated: 2026-05-15T17:54:14Z
- Pushed: 2025-06-26T17:03:40Z
Top-Level Structure
dev: 48llmc: 23[root]: 15scripts: 10.github: 3doc: 3
File Extension Profile
.cu: 28.h: 14.py: 14.sh: 11.cuh: 10.c: 6.md: 6[none]: 4.yml: 3.sbatch: 2.cpp: 1.gitignore: 1
Tags / Release-Like Markers
- No git tags found in the shallow local clone.
Sample File Tree
.github/workflows/ci.yml.github/workflows/ci_gpu.yml.github/workflows/ci_tests.yml.gitignoredev/cpu/matmul_forward.cdev/cuda/adamw.cudev/cuda/attention_backward.cudev/cuda/attention_forward.cudev/cuda/benchmark_on_modal.pydev/cuda/classifier_fused.cudev/cuda/common.hdev/cuda/crossentropy_forward.cudev/cuda/crossentropy_softmax_backward.cudev/cuda/encoder_backward.cudev/cuda/encoder_forward.cudev/cuda/fused_residual_forward.cudev/cuda/gelu_backward.cudev/cuda/gelu_forward.cudev/cuda/global_norm.cudev/cuda/layernorm_backward.cudev/cuda/layernorm_forward.cudev/cuda/Makefiledev/cuda/matmul_backward.cudev/cuda/matmul_backward_bias.cudev/cuda/matmul_forward.cudev/cuda/nccl_all_reduce.cudev/cuda/permute.cudev/cuda/README.mddev/cuda/residual_forward.cudev/cuda/softmax_forward.cudev/cuda/trimat_forward.cudev/data/data_common.pydev/data/edu_fineweb.shdev/data/fineweb.pydev/data/fineweb.shdev/data/hellaswag.pydev/data/mmlu.pydev/data/README.mddev/data/tinyshakespeare.pydev/data/tinystories.pydev/download_starter_pack.shdev/eval/export_hf.pydev/eval/README.mddev/eval/run_eval.shdev/eval/summarize_eval.pydev/loss_checker_ci.pydev/test/device_file_io.cudev/test/Makefiledev/test/test_dataloader.cdev/test/test_outlier_detector.cdev/unistd.hdev/vislog.ipynbdoc/layernorm/layernorm.cdoc/layernorm/layernorm.mddoc/layernorm/layernorm.pyLICENSEllmc/adamw.cuhllmc/attention.cuhllmc/cublas_common.hllmc/cuda_common.hllmc/cuda_utils.cuhllmc/cudnn_att.cppllmc/cudnn_att.hllmc/dataloader.hllmc/encoder.cuhllmc/fused_classifier.cuhllmc/gelu.cuhllmc/global_norm.cuhllmc/layernorm.cuhllmc/logger.hllmc/matmul.cuhllmc/mfu.hllmc/outlier_detector.hllmc/rand.hllmc/sampler.hllmc/schedulers.hllmc/tokenizer.hllmc/utils.hllmc/zero.cuhMakefile
Public Handling Notes
- EXTRACTED: This page records public metadata and a source-grounded summary.
- INFERRED: Full local preservation, when available, is for private/local use unless a license or explicit source policy makes public redistribution safe.
- Do not treat this page as permission to republish unlicensed source text or code wholesale.