# nanoGPT

Framework · https://godooo.ai/en/framework/nanogpt

> nanoGPT is an open-source AI framework, launched in 2022, made for developers.

A minimal PyTorch codebase for training and fine-tuning GPT-2-sized models.

Main jobs: Fine-tuning, Model training. It is open source and free to use. You can use it in the terminal and offline on your own machine.

## At a glance

- **Type:** [Framework](https://godooo.ai/en/browse#framework)
- **Launched:** 2022
- **Galaxy:** [Models & APIs](https://godooo.ai/en/galaxy/builders)
- **Open source:** Yes · MIT
- **Source code:** [github.com/karpathy/nanoGPT](https://github.com/karpathy/nanoGPT)
- **GitHub stars:** 63,353
- **How you run it:** Terminal · Runs offline
- **Made for:** Developers
- **Website:** [github.com](https://github.com/karpathy/nanoGPT)

## What it can do

- **[Fine-tuning](https://godooo.ai/en/capability/fine-tuning)** — main job, _proposed by a machine, awaiting calibration_. “train new models from scratch, or finetune pretrained checkpoints” (read on [github.com](https://github.com/karpathy/nanoGPT), 2026-09-24)
- **[Model training](https://godooo.ai/en/capability/model-training)** — main job, _proposed by a machine, awaiting calibration_. “The simplest, fastest repository for training/finetuning medium-sized GPTs.” (read on [github.com](https://github.com/karpathy/nanoGPT), 2026-09-24)

## Alternatives

- **[Kohya's GUI](https://godooo.ai/en/product/kohya-ss)** (Open source, free): Also does: Fine-tuning, Model training
- **[LlamaFactory](https://godooo.ai/en/framework/llamafactory)** (Open source, free): Also does: Fine-tuning, Model training
- **[MLX](https://godooo.ai/en/framework/mlx)** (Open source, free): Also does: Model training, Fine-tuning
- **[TRL](https://godooo.ai/en/framework/trl)** (Open source, free): Also does: Fine-tuning, Model training
- **[Unsloth](https://godooo.ai/en/framework/unsloth)** (Open source, free): Also does: Fine-tuning, Model training
- **[Hugging Face](https://godooo.ai/en/product/huggingface)** (Free plan + paid upgrades): Also does: Fine-tuning, Model training
- **[PyTorch](https://godooo.ai/en/framework/pytorch)** (Open source, free): Also does: Model training
- **[TensorFlow](https://godooo.ai/en/framework/tensorflow)** (Open source, free): Also does: Model training
- **[Transformers](https://godooo.ai/en/framework/transformers)** (Open source, free): Also does: Model training
- **[JAX](https://godooo.ai/en/framework/jax)** (Open source, free): Also does: Model training
- **[ModelScope](https://godooo.ai/en/product/modelscope)** (Open source, free): Also does: Fine-tuning, Model training
- **[Axolotl](https://godooo.ai/en/framework/axolotl)** (Open source, free): Also does: Fine-tuning

## Connections

- **Created by:** [Andrej Karpathy](https://godooo.ai/en/person/andrej-karpathy)
- **Built with:** [PyTorch](https://godooo.ai/en/framework/pytorch)

## Questions

### What is nanoGPT?

nanoGPT is an open-source AI framework, launched in 2022, made for developers. A minimal PyTorch codebase for training and fine-tuning GPT-2-sized models.

### Is nanoGPT free?

Yes. nanoGPT is open source (MIT) and free to use.

### Is nanoGPT open source?

Yes, under the MIT license. The source code is at https://github.com/karpathy/nanoGPT.

### Can nanoGPT run locally?

Yes. nanoGPT can run offline on your own machine.

### What can nanoGPT do?

Main jobs: Fine-tuning, Model training.

### What are open-source alternatives to nanoGPT?

Open-source ones: Kohya's GUI, LlamaFactory, MLX, TRL, Unsloth, PyTorch, TensorFlow and Transformers. Others: Hugging Face.

## Sources

- [github.com](https://github.com/karpathy/nanoGPT) — checked 2026-09-24

---

Last updated 2026-09-24 · sources checked 2026-09-24 · Markdown version of https://godooo.ai/en/framework/nanogpt. Every page on this site has one: add .md to its address.
