# nanoGPT

框架 · https://godooo.ai/zh/framework/nanogpt

> nanoGPT 是开源 AI 开发框架，2022 年推出，面向开发者。

训练和微调 GPT-2 规模模型的极简 PyTorch 代码。

主打：模型微调、模型训练。开源，可以免费使用。使用方式：命令行、本地离线运行。

## 速览

- **类别:** [框架](https://godooo.ai/zh/browse#framework)
- **推出于:** 2022
- **所属星系:** [模型与 API](https://godooo.ai/zh/galaxy/builders)
- **是否开源:** 是 · MIT
- **源代码:** [github.com/karpathy/nanoGPT](https://github.com/karpathy/nanoGPT)
- **GitHub 星标:** 63,353
- **使用方式:** 命令行 · 可离线本地运行
- **适合谁:** 开发者
- **官网:** [github.com](https://github.com/karpathy/nanoGPT)

## 能做什么

- **[模型微调](https://godooo.ai/zh/capability/fine-tuning)** — 主打, _由机器提出，尚待校准_. “train new models from scratch, or finetune pretrained checkpoints” (摘自 [github.com](https://github.com/karpathy/nanoGPT)，2026-09-24)
- **[模型训练](https://godooo.ai/zh/capability/model-training)** — 主打, _由机器提出，尚待校准_. “The simplest, fastest repository for training/finetuning medium-sized GPTs.” (摘自 [github.com](https://github.com/karpathy/nanoGPT)，2026-09-24)

## 平替与同类

- **[Kohya's GUI](https://godooo.ai/zh/product/kohya-ss)** (开源免费): 同样能做：模型微调、模型训练
- **[LlamaFactory](https://godooo.ai/zh/framework/llamafactory)** (开源免费): 同样能做：模型微调、模型训练
- **[MLX](https://godooo.ai/zh/framework/mlx)** (开源免费): 同样能做：模型训练、模型微调
- **[TRL](https://godooo.ai/zh/framework/trl)** (开源免费): 同样能做：模型微调、模型训练
- **[Unsloth](https://godooo.ai/zh/framework/unsloth)** (开源免费): 同样能做：模型微调、模型训练
- **[Hugging Face](https://godooo.ai/zh/product/huggingface)** (免费版 + 付费升级): 同样能做：模型微调、模型训练
- **[PyTorch](https://godooo.ai/zh/framework/pytorch)** (开源免费): 同样能做：模型训练
- **[TensorFlow](https://godooo.ai/zh/framework/tensorflow)** (开源免费): 同样能做：模型训练
- **[Transformers](https://godooo.ai/zh/framework/transformers)** (开源免费): 同样能做：模型训练
- **[JAX](https://godooo.ai/zh/framework/jax)** (开源免费): 同样能做：模型训练
- **[ModelScope](https://godooo.ai/zh/product/modelscope)** (开源免费): 同样能做：模型微调、模型训练
- **[Axolotl](https://godooo.ai/zh/framework/axolotl)** (开源免费): 同样能做：模型微调

## 关系

- **由…创造:** [Andrej Karpathy](https://godooo.ai/zh/person/andrej-karpathy)
- **基于…构建:** [PyTorch](https://godooo.ai/zh/framework/pytorch)

## 常见问题

### nanoGPT 是什么？

nanoGPT 是开源 AI 开发框架，2022 年推出，面向开发者。训练和微调 GPT-2 规模模型的极简 PyTorch 代码。

### nanoGPT 免费吗？

免费。nanoGPT 是开源软件（MIT）。

### nanoGPT 开源吗？

开源，许可证是 MIT。源代码在 https://github.com/karpathy/nanoGPT。

### nanoGPT 能本地运行吗？

能，可以在自己的电脑上离线运行。

### nanoGPT 能做什么？

主打：模型微调、模型训练。

### nanoGPT 有哪些开源替代品？

开源的有：Kohya's GUI、LlamaFactory、MLX、TRL、Unsloth、PyTorch、TensorFlow、Transformers。其他：Hugging Face。

## 来源

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

---

最后更新 2026-09-24 · 来源核实于 2026-09-24 · 这是 https://godooo.ai/zh/framework/nanogpt 的 Markdown 版本。本站每个页面都有：在地址后面加 .md。
