Build a Custom ChatGPT for $100 with Open-Source nanochat
Build Your Own ChatGPT Clone for Under $100
Artificial intelligence development has taken a significant leap toward accessibility with the launch of nanochat, an open-source project that allows developers to build a fully functional chat AI system at minimal cost. Created by renowned AI expert Andrej Karpathy, this tool represents what he calls "the best ChatGPT implementation under $100."
Breaking Down Barriers in AI Development
The project serves dual purposes: as both a practical tool and an educational resource. Unlike previous implementations that focused solely on pre-training, nanochat provides an end-to-end pipeline covering:
- Model training
- Fine-tuning
- Performance evaluation
- Interactive deployment
The entire system comprises approximately 8,000 lines of code with minimal dependencies, making it exceptionally readable and modifiable.

Technical Specifications and Process Flow
The workflow requires:
- Starting a cloud node with 8 H100 GPUs (~$24/hour)
- Running the
smoothrun.shscript - Completing the process in about 4 hours
The technical process includes:
- Data preprocessing: Using high-quality corpora like FineWeb-Edu
- Tokenization: Fast Rust-based tokenizer supporting 65,536 vocabulary size
- Pre-training: PyTorch-based Transformer model training
- Fine-tuning: Integration of SmolTalk dialogue dataset and reinforcement learning optimization
The final product supports both command-line and web interfaces, capable of generating stories, answering questions, and even handling basic tool calls.
Performance Metrics and Scaling Options
The project demonstrates remarkable scalability: | Training Duration | Cost | Capabilities Achieved | |-------------------|--------|-----------------------| | 4 hours | ~$100 | Basic conversational ability | | 12 hours | ~$300 | Surpasses GPT-2 metrics | | 41.6 hours | ~$1,000| Solves math/code problems (40% MMLU accuracy) |
The model achieves particularly strong results in multiple-choice testing scenarios.
Educational Value and Community Impact
As the capstone project for Karpathy's LLM101n course, nanochat aims to provide:
- A unified baseline stack
- Readable/modifiable code
- Complete workflow transparency
The GitHub repository has already generated significant community engagement (Project URL).
Key Points:
- Creates functional chatbot clones for under $100
- Complete training-to-deployment pipeline in ~4 hours
- Educational focus with transparent code structure
- Scales effectively with additional compute resources
- Potential benchmark for AI education/research


