{"id":"5c4b167e-28fe-4bf3-8ea6-1d32097ee849","repo":"karpathy/nanoGPT","status":"done","verdict":"no_red_flags","headline":"No red flags found. README claims backed by the code: 4 of 8.","error":null,"report":{"ai":{"kind":"tool","claims":[{"claim":"Simple, readable code: train.py is ~300-line training loop and model.py ~300-line GPT definition","verdict":"supported","evidence":"train.py is 337 lines and model.py 331 lines, and both are plain, flat PyTorch."},{"claim":"Can optionally load the GPT-2 weights from OpenAI","verdict":"supported","evidence":"model.py:206-261 GPT.from_pretrained via HuggingFace GPT2LMHeadModel."},{"claim":"train.py reproduces GPT-2 (124M) on OpenWebText on an 8xA100 40GB node in about 4 days (reaching ~2.85 loss)","verdict":"unverifiable","evidence":"config/train_gpt2.py and the DDP code exist, but the runtime and loss result depend on hardware and runs; the config comment says ~5 days while the README says ~4."},{"claim":"Supports finetuning pretrained GPT-2 checkpoints (e.g. on Shakespeare)","verdict":"supported","evidence":"train.py:181-188 init_from gpt2*; config/finetune_shakespeare.py; data/shakespeare/prepare.py."},{"claim":"Supports multi-GPU and multi-node training with DDP","verdict":"supported","evidence":"train.py:82-101, 210-212, with torchrun usage in the docstring."},{"claim":"torch.compile gives a noticeable speedup (250ms to 135ms per iter)","verdict":"unverifiable","evidence":"The code calls torch.compile (train.py:205-208), but the timings depend on hardware."},{"claim":"Baseline GPT-2 val losses on OpenWebText (e.g. 3.12 for 124M)","verdict":"unverifiable","evidence":"The eval configs exist (config/eval_gpt2*.py, eval_only in train.py:287), but the numbers need to be run."},{"claim":"Fastest repository for training/finetuning medium-sized GPTs","verdict":"unverifiable","evidence":"It uses flash attention, fused AdamW, compile and bf16 (model.py:62-64, 281-284), but \"fastest\" is a comparative claim that can't be shown from the code."}],"costUsd":0.079544,"summary":"nanoGPT is a compact PyTorch codebase for training, finetuning and sampling GPT-2-style language models. It has a model definition, a training loop with DDP, gradient accumulation, mixed precision and cosine LR decay, scripts that tokenize datasets into uint16 .bin files, and a sampling script. There is no agent loop or tool use; it is a plain ML training library. The README notes the repo is deprecated in favour of nanochat.","capabilities":[{"evidence":"model.py:29-76, 94-106, 118-193, 305-330","capability":"GPT-2 architecture (causal self-attention with flash attention or a manual fallback, MLP, pre-LN blocks, weight tying) with an autoregressive generate() using temperature and top-k"},{"evidence":"model.py:206-261","capability":"Load OpenAI GPT-2 weights (gpt2 through gpt2-xl) from HuggingFace transformers, transposing Conv1D weights"},{"evidence":"train.py:231-242, 255-333","capability":"Training loop with gradient accumulation, GradScaler for fp16, grad clipping, cosine LR with warmup, periodic eval and checkpointing, optional wandb"},{"evidence":"train.py:82-101, 210-212","capability":"Multi-GPU and multi-node training via PyTorch DDP, launched through torchrun"},{"evidence":"train.py:149-193; model.py:195-204","capability":"Resume from a checkpoint or initialize from scratch or from a GPT-2 model for finetuning, with block-size cropping"},{"evidence":"data/openwebtext/prepare.py:21-81; data/shakespeare/prepare.py; data/shakespeare_char/prepare.py","capability":"Dataset preparation: OpenWebText GPT-2 BPE tokenization to a memmapped uint16 file, Shakespeare in BPE and char-level variants"},{"evidence":"sample.py:35-89","capability":"Sampling script that supports resume checkpoints or pretrained GPT-2, file-based prompts, and meta.pkl char encodings"},{"evidence":"bench.py:60-117; model.py:289-303","capability":"Benchmarking and profiling with MFU estimation relative to A100 bf16 peak"},{"evidence":"configurator.py:20-47","capability":"Config system that exec()s a config file and applies --key=value overrides to globals"}],"findingReviews":[]},"url":"https://github.com/karpathy/nanoGPT","depth":"standard","owner":{"id":241138,"type":"User","login":"karpathy"},"stats":{"files":26,"binaries":2,"textFiles":24,"truncated":false},"origin":{"source":null,"status":"original","reasons":[]},"verdict":"no_red_flags","findings":[],"headline":"No red flags found. README claims backed by the code: 4 of 8.","provenance":[],"generatedAt":"2026-10-15T14:28:00.852Z"}}