Skip to content
This page is not translated yet — showing the original. We never ship machine translation as a placeholder.
Needs a toolchainMIT Tested
nanoGPT

nanoGPT

In one line:nanoGPT 是一个 Karpathy 的极简 GPT 训练仓库,代码只有几百行,能看懂大模型训练。

nanoGPT 是一个 Karpathy 的极简 GPT 训练仓库,代码只有几百行,能看懂大模型训练。

Official source

We host and mirror nothing — the official page is the source of truth.

Official icon for nanoGPT Andrej Karpathyhttps://github.com/karpathy/nanoGPTOpen official page
Official sourceYou are leaving AIWorksWell for Andrej Karpathy. That site is not under our control; its content, privacy and security are its own responsibility. Please judge for yourself.

Install prompt

Copy it, paste it into your AI (Claude Code, Codex, ChatGPT…), and it installs and verifies for you.

42 lines
我需要你帮我在我的机器上安装并运行一个软件。

【软件信息】
名称:nanoGPT
用途:nanoGPT 是一个 Karpathy 的极简 GPT 训练仓库,代码只有几百行,能看懂大模型训练。
官方来源:https://github.com/karpathy/nanoGPT
许可:MIT
Scroll inside the box with your mouse wheel — copying still gives you the full prompt1077 chars

Copy → paste into your own AI → it installs for you

Contact the original author (Andrej Karpathy)

Bugs in the software itself go to the author's own official channel — that is where they actually receive them. We pass things on; we do not answer for the author.

Install failed?

Paste the raw error — once triaged and verified it is written back here, so the next person's AI avoids it. No login needed.

About this entry

它是什么

nanoGPT 是 Karpathy 的开源极简 GPT 训练/复现仓库,代码短、可读性极高。来源:https://github.com/karpathy/nanoGPThttps://github.com/karpathy/nanoGPT

怎么用起来

「帮我在本机跑通 nanoGPT 的小数据集训练,解释每一步在做什么,并指出显存瓶颈在哪。」来源:https://github.com/karpathy/nanoGPThttps://github.com/karpathy/nanoGPT

以上坑来自 https://github.com/karpathy/nanoGPThttps://github.com/karpathy/nanoGPT 与官方文档。

来源与署名

Mentioned from:https://github.com/karpathy/nanoGPThttps://github.com/karpathy/nanoGPT · 原作者 Andrej Karpathy(MIT)。

Demo videos

Videos are embedded with the platform's own player — the bandwidth is theirs, the playback experience is ours. We never download or re-host. The player loads only if you click, so this page makes no third-party request unless you ask for one.

  • Let us build GPT from scratch

    youtube
    Watch at the sourceyoutubeYou are leaving AIWorksWell for youtube. That site is not under our control; its content, privacy and security are its own responsibility. Please judge for yourself.

Want higher quality, the full comment stream, or to save it? Use “Watch at the source” — the embedded player's quality is set by the platform, and the source site is the complete experience.

Zero video copies: we store no video files at all.

Summary for AI

nanoGPT 是 Andrej Karpathy 的最小 GPT 实现,用几百行代码讲清大模型训练流程,适合用来理解原理。

A self-contained answer paragraph — this is the part AI search quotes. · Page reviewed 2026-10-06

FAQ

能在 CPU 上跑吗?

训练至少需要一块像样的 GPU,CPU 只能跑极小规模。

数据怎么准备?

按仓库说明把数据转成 memmap 格式。

Pitfalls / known issues

All recorded from real installs, and injected into the prompt above.

  • •训练至少需要一块像样的 GPU,CPU 只能跑极小规模。
  • •数据准备格式有要求,按仓库说明转成 memmap。

You might also like

We store, mirror and repackage nothing. Every install path points to the author’s own official page.

Nothing here has been reviewed by an app store. Judge the source and licence yourself; you install at your own risk.