talira

LLM training in simple, raw C and CUDA

open sourceMITfree

llm.c looks abandoned: nothing has changed since June 2025, and its makers haven't said it has ended.

Last commit on the default branch in May 2025 and last maintainer reply in June 2025 (the llama3 branch's last commit is June 2025); still widely referenced.

llm.c trains LLMs in simple, pure C and CUDA, without PyTorch or Python, with a parallel PyTorch reference implementation. Its focus is pretraining, in particular reproducing the GPT-2 and GPT-3 model series, with a step-by-step guide to reproducing GPT-2 (124M), plus simpler single-GPU fp32 files for learning CUDA. It's by Andrej Karpathy.

Problems it solves

  • reproduce GPT-2 training from scratch
  • learn how LLM training works in CUDA
  • train a small GPT without PyTorch

Features

  • LLM pretraining in pure C/CUDA
  • GPT-2 and GPT-3 reproduction
  • PyTorch reference implementation
  • simple fp32 single-GPU files