Minimal GPT training codebase that reproduces GPT-2 (124M) for learning transformers from scratch.
- CCM score
- 61 of 100
- skills.sh installs
- 1.1K
- GitHub stars
- 14.9K
- last updated
- Aug 21, 2026
Own this skill? Claim it
What it does
- Covers character-level training on Shakespeare for CPU runs and GPT-2 (124M) reproduction on OpenWebText across multiple GPUs
- Includes a model file and training loop of roughly 300 lines each, plus config files for Shakespeare, GPT-2, and fine-tuning from OpenAI checkpoints
- Provides workflows for custom datasets and for fine-tuning pretrained
gpt2weights, withtorchrunfor distributed data parallel training - Designed for learners and educators who want hackable PyTorch code without abstraction layers, and for quick prototyping on limited compute
Install
$ npx -y skills add orchestra-research/ai-research-skills --skill nanogpt -yInstalls into .agents/skills for every agent it finds here, and .claude/skills for Claude Code.
Files
nanoGPT - Minimalist GPT Training
Quick start
nanoGPT is a simplified GPT implementation designed for learning and experimentation.
Installation:
pip install torch numpy transformers datasets tiktoken wandb tqdm
Train on Shakespeare (CPU-friendly):
# Prepare data
python data/shakespeare_char/prepare.py
# Train (5 minutes on CPU)
python train.py config/train_shakespeare_char.py
# Generate text
python sample.py --out_dir=out-shakespeare-char
Output:
ROMEO:
What say'st thou? Shall I speak, and be a man?
JULIET:
I am afeard, and yet I'll speak; for thou art
One that hath been a man, and yet I know not
What thou art.
Common workflows
Workflow 1: Character-level Shakespeare
Complete training pipeline:
# Step 1: Prepare data (creates train.bin, val.bin)
python data/shakespeare_char/prepare.py
# Step 2: Train small model
python train.py config/train_shakespeare_char.py
# Step 3: Generate text
python sample.py --out_dir=out-shakespeare-char
Details
- Repository
- github.com/orchestra-research/ai-research-skills
- Categories
- Data Science & Analytics, Learning & Teaching
- First seen
- Jun 3, 2026
Questions
What does the nanogpt skill do?
The nanogpt skill guides an agent through Andrej Karpathy's educational GPT implementation of about 300 lines, which reproduces GPT-2 (124M) on OpenWebText. It covers training on Shakespeare on a CPU, training on OpenWebText across multiple GPUs, and fine-tuning from pretrained GPT-2 weights.
How do I install the nanogpt skill?
Run npx -y skills add orchestra-research/ai-research-skills --skill nanogpt -y in your project. Once installed, the agent can walk you through training a small character-level model on Shakespeare or reproducing GPT-2 (124M) from scratch.
Which skills lead the Data Science & Analytics category?
nanogpt sits in the Data Science & Analytics category on Claude Marketplaces, alongside azure-kusto, analyze-project, run-train, explore-run and add-analytics-instrumentation. Its focus is on learning transformer architecture from scratch rather than analytics tooling.
What do I need to run the nanogpt skill?
You need PyTorch, numpy, transformers, datasets, tiktoken, wandb and tqdm, installed with pip. A CPU is enough for the Shakespeare run, which takes about 5 minutes, while GPT-2 (124M) training needs GPUs, for example 8 A100s for about 4 days.
More from orchestra-research/ai-research-skills
All 92- Instructor1.1K
- Long Context1.1K
- Presenting Conference Talks1.1K
- Speculative Decoding1.1K
- Hqq Quantization1.1K
- Model Merging1.1K
- Moe Training1.1K
- Sglang1.1K
- Chroma1.1K
- Nemo Curator1.1K
- Llama Factory1.1K
- Pyvene Interventions1.1K
- Gptq1.1K
- Model Pruning1.1K
- Sentencepiece1.1K
- Evaluating Code Models1.1K
- Distributed Llm Pretraining Torchtitan1.1K
- Mamba Architecture1.1K
- Openrlhf Training1.1K
- Sparse Autoencoder Training1.1K
- Llamaindex1.1K
- Ml Training Recipes1.1K
- Outlines1.1K
- Simpo Training1.1K
Similar to Nanogpt
More Data Science & Analyticsnanochat-llm-trainingSkillreason-machines/trending-skills1.3K installsTrain a GPT-2-class LLM for about $48 with nanochat's minimal, hackable end-to-end harness.
implementing-llms-litgptSkillorchestra-research/ai-research-skills1.1K installsUse when need clean model implementations, educational understanding of architectures, or production fine-tuning with LoRA/QLoRA.
model-architecturePluginOrchestra-Research/AI-Research-SKILLs14.8K starsLLM architectures and implementations including LitGPT, Mamba, NanoGPT, RWKV, and TorchTitan. Use when implementing, training, or understanding transformer and
llmSkillmindrally/skills767 installsBroad LLM development guidance covering architecture, fine-tuning, distributed training, evaluation, and deployment.
llm-fine-tuning-guideSkillqodex-ai/ai-agent-skills198 installsPractical guide to fine-tuning LLMs covering full tuning, LoRA, QLoRA, and domain-specific data preparation.
openai-prompt-engineerSkilljamesrochabrun/skills211 installsStructured prompt-writing guide covering chain-of-thought, few-shot, XML structuring, and per-model tuning for GPT-5 and Claude.