Skip to content

nanoGPT Minimalist GPT Trainer

Guides an agent through building, training and sampling a small GPT model from scratch with PyTorch

Stars
14,195
Licence
MIT
Files
4 files

What it does

This skill teaches the agent how to work with nanoGPT, a short, readable GPT (the language model architecture behind ChatGPT-style tools) implementation. Once installed, the agent can walk you through preparing a dataset, training a small model on a laptop CPU or a larger one on multiple GPUs, sampling text from it, and fine-tuning from OpenAI's GPT-2 weights. It also includes reference notes on the model structure, training loop and data formats.

Great for

  • Students or engineers who want to learn how GPT models work by reading and modifying a small codebase
  • Developers prototyping a transformer variant on limited hardware, such as a CPU or a single GPU
  • Educators preparing a hands-on lesson on training language models

Skip it if

  • Production text generation or serving: the skill itself points users to HuggingFace Transformers or LitGPT for that, and this is a teaching-focused codebase
  • Training large models on a budget: the GPT-2 124M run is described as about 4 days on 8 A100 GPUs, which is costly
  • Anyone expecting the skill to include the nanoGPT code itself: the files only describe how to use it, so you must clone the separate repository

Try asking

  • “Walk me through training a tiny character-level GPT on Shakespeare on my CPU”
  • “Help me set up nanoGPT to fine-tune from the gpt2 checkpoint on my own text file”
  • “Explain how the attention and MLP layers fit together in a GPT block, using the nanoGPT reference notes”
  • “Adjust the batch size and context length because I'm getting CUDA out-of-memory errors”
Step-by-step guide: how to use nanoGPT Minimalist GPT TrainerInstall, first run, examples, tips and FAQs

Install in 3 steps

  1. 1

    Download the skill

    The ZIP contains the 4 original files, the MIT licence and an attribution note.

    nanogpt.zip
  2. 2

    Add it to your agent

    Claude Code (all projects)

    mkdir -p ~/.claude/skills && unzip nanogpt.zip -d ~/.claude/skills/

    Claude Code / Agent SDK (this project only)

    mkdir -p .claude/skills && unzip nanogpt.zip -d .claude/skills/

    Claude apps (web/desktop): Settings → Capabilities → Skills → Upload skill, and choose the ZIP.

  3. 3

    Ask for the task

    No special command needed — the agent reads the skill's description and loads it when your request matches. Try one of the prompts above.

Get better results

  • Start with the Shakespeare character-level workflow to confirm your setup before attempting OpenWebText, which takes about an hour just to prepare
  • Check the hardware estimates in the skill against your own machine, since the timings are approximate and come from the skill's own text
  • Review any commands the agent proposes before running them, because they download datasets, install packages and launch training jobs

What's inside

  • references/architecture.md
  • references/data.md
  • references/training.md
  • SKILL.md

Redistributed unmodified from Orchestra-Research/AI-Research-SKILLs under the MIT licence. The assessment was drafted with AI from the skill's files on 2026-10-29. Skills can instruct your agent to run code — read SKILL.md and any scripts before installing.