nanochat
60,459
Stars
8,477
Forks
380
Watchers
137
Open Issues
MIT
许可证
Python
语言
2025-10-13
创建时间
2026-09-07
最近更新
项目能做什么
用 100 美元预算所能打造出的最强 ChatGPT 项目。
来源:AI 基于仓库事实生成
· 内容以仓库实际 README 为准
使用说明 查看原始 README 原仓库文档
中文使用说明暂未生成。下面保留原仓库 README 摘录,命令与配置均以原文为准。
原始 README 摘录(英文原文,节选前 3000 字符)
# nanochat   nanochat is the simplest experimental harness for training LLMs. It is designed to run on a single GPU node, the code is minimal/hackable, and it covers all major LLM stages including tokenization, pretraining, finetuning, evaluation, and inference. For example, you can train your own GPT-2 capability LLM (which cost ~$43,000 to train in 2019) for only $48 (~2 hours of 8XH100 GPU node) and then talk to it over a simple CLI. On a spot instance, the total cost can be closer to ~$15. More generally, nanochat is configured out of the box to train an entire miniseries of compute-optimal models by setting one single complexity dial: `--depth`, the number of layers in the GPT transformer model (GPT-2 capability happens to be approximately depth 26). All other hyperparameters (the width of the transformer, number of heads, learning rate adjustments, training horizons, weight decays, ...) are calculated automatically in an optimal way. For questions about the repo, I recommend either using [DeepWiki](https://deepwiki.com/karpathy/nanochat) from Devin/Cognition to ask questions about the repo, or use the [Discussions tab](https://github.com/karpathy/nanochat/discussions), or come by the [#nanochat](https://discord.com/channels/1020383067459821711/1427295580895314031) channel on Discord. ## Time-to-GPT-2 Leaderboard Presently, the main focus of development is on tuning the pretraining stage, which takes the most amount of compute. Inspired by the modded-nanogpt repo and to incentivise progress and community collaboration, nanochat maintains a leaderboard for a "GPT-2 speedrun", which is the wall-clock time required to train a nanochat model to GPT-2 grade capability, as measured by the DCLM CORE score. The [runs/speedrun.sh](runs/speedrun.sh) script always reflects the reference way to train GPT-2 grade model and talk to it. The current leaderboard looks as follows: | # | time | val_bpb | CORE | Description | Date | Commit | Contributors | |---|-------------|---------|------|-------------|------|--------|--------------| | 0 | 168 hours | - | 0.2565 | Original OpenAI GPT-2 checkpoint | 2019 | - | OpenAI | | 1 | 3.04 | 0.74833 | 0.2585 | d24 baseline, slightly overtrained | Jan 29 2026 | 348fbb3 | @karpathy | | 2 | 2.91 | 0.74504 | 0.2578 | d26 slightly undertrained **+fp8** | Feb 2 2026 | a67eba3 | @karpathy | | 3 | 2.76 | 0.74645 | 0.2602 | bump total batch size to 1M tokens | Feb 5 2026 | 2c062aa | @karpathy | | 4 | 2.02 | 0.71854 | 0.2571 | change dataset to NVIDIA ClimbMix | Mar 4 2026 | 324e69c | @ddudek @karpathy | | 5 | 1.80 | 0.71808 | 0.2690 | autoresearch [round 1](https://x.com/karpathy/status/2031135152349524125) | Mar 9 2026 | 6ed7d1d | @karpathy | | 6 | 1.65 | 0.71800 | 0.2626 | autoresearch round 2 | Mar 14 2026 | a825e63 | @karpathy | The primary metric we care about is "time to GPT-2" - the wall clock time needed to outperform the GPT-2 (1.6B) CO阅读完整原文
商业机会分析 AI 生成
LLM从零预训练实战训练营与配套互动课
| 产品构想 | 结合该项目极简、端到端(分词、预训练、SFT、评测)的特性,打造面向工程师的实战课程,提供云端实验环境和作业打卡,解决看懂论文但不会调优工程代码的痛点。 |
| 核心功能 | 逐行解析源码与计算原理、配置好算力的云端Notebook环境、Scaling Laws参数调优实战指导、社群答疑与打卡评测。 |
| 目标用户 | 期望系统掌握LLM全流程底层工程的在职工程师、转行人员及计算机专业研究生。 |
| 难度/周期 | 低 · 2 - 4 周 · 成本:极低(主要为准备课程讲义及少量算力测试费用) |
| 收费模式 | 付费课程录播/直播门票、小班辅导与作业批改收费。 |
| 竞争风险 | 作者Karpathy本人及开源社区生态自带极高教程属性,免费资料多,需要依赖高质量答疑和保姆级实操体验形成壁垒。 |
| 依据 | 已验证事实 |
基于nanochat的一键式云端预训练/SFT工作台(PaaS)
| 产品构想 | 针对nanochat需8xH100环境但很多开发者缺乏集群配置经验的痛点,封装一个Web端一键式训练控制台,整合低价Spot实例算力、数据清洗及一键导出模型权重功能。 |
| 核心功能 | 预置nanochat环境的即开即用云算力模版、自定义数据集上传与自动化Tokenize处理、参数调优可视化看板(类似Speedrun面板)、LoRA/SFT及模型GGUF/Ollama一键导出。 |
| 目标用户 | AI初创公司、研究小组、没有专职MLOps支持的独立开发者。 |
| 难度/周期 | 中等 · 1 - 2 个月 · 成本:中(算力接入保证金、云服务器及调度系统开发) |
| 收费模式 | 算力加价转售(按训练时长抽成)、订阅制的高级配置调度与持久化存储服务。 |
| 竞争风险 | 算力供应商采购成本及Spot实例中断风险,面临RunPod/Lambda Labs等算力平台模版的竞争(推测)。 |
| 依据 | AI推测 |
垂直领域微型专用语言模型(Small LM)定制方案与咨询
| 产品构想 | 利用nanochat以极低成本(~$50)在单节点完成从头训练的能力,为对数据隐私极度敏感或对模型推理延迟有极致要求的企业,提供垂直领域私有化专有模型从头训练及微调交付服务。 |
| 核心功能 | 领域专用Tokenizer构建、语料配比与清洗流水线定制、单节点极速预训练与蒸馏部署交付、极低参数量下的推理优化与端侧集成。 |
| 目标用户 | 有敏感数据(如医疗、法律内部卷宗、边缘嵌入式硬件)但算力预算有限的中小型企业。 |
| 难度/周期 | 高 · 1 - 3 个月 · 成本:低至中(取决于数据处理与POC验证算力成本) |
| 收费模式 | 项目制交付实施费、模型优化咨询费、维护与后续训练支持年费。 |
| 竞争风险 | GPT-2级别能力的模型在复杂任务上表现有限,客户预期与小模型实际能力的落差可能导致交付验收困难(推测)。 |
| 依据 | 数据支持的判断 |
AI 基于仓库公开数据分析生成,含推测成分,不构成收益承诺。
报告会保存到 个人中心
竞品与相似项目 GitHub Search 真实检索
| 项目 | 中文简介 | Stars | 语言 |
|---|---|---|---|
| karpathy/autoresearch | 中文介绍暂未生成 AI agents running research on single-GPU nanochat training a |
99,801 | Python |
| hamidreza-s/NanoChat | 中文介绍暂未生成 A P2P, E2E encrypted and discoverable chat application on to |
140 | C |
| tohoku-nlp/nanochat-jp | 中文介绍暂未生成 | 110 | Python |
| AntigmaLabs/nanochat-rs | 中文介绍暂未生成 Tiny cognitive core built with native rust, inspired by nano |
96 | Rust |
| VatsaDev/nanoChatGPT | 中文介绍暂未生成 nanogpt turned into a chat model |
80 | Python |
| scasella/nanochat-mlx | 中文介绍暂未生成 Train your own ChatGPT on Apple Silicon — MLX port of nanoch |
78 | Python |
以上为通过 GitHub 官方 Search API 检索的相似项目,功能差异与优劣势需进一步人工确认,配置 AI 后可生成对比分析。
项目优势与风险
| 技术成熟度 | 创建于 2025-10-13,最近推送 2026-09-07 |
| 社区活跃 | Star 60,459 / Fork 8,477 / Issue 137(数据支持,可自行核实) |
| 许可证 | MIT |
| 主要风险 | 上游项目方向可能变化;同赛道竞争者较多(见竞品表);热度与需求不完全等价 |
安装与使用
快速开始(以仓库 README 为准)
git clone https://github.com/karpathy/nanochat.git cd nanochat # 请阅读仓库 README 获取确切安装步骤(依赖、配置、启动命令)
术语说明:Docker=应用容器(把程序和依赖打包运行);API Key=调用外部服务的密钥;Git Clone=把仓库代码下载到本地。常见错误:API Key 未配置 / 端口占用 / 数据库连接失败,多数项目在 README 的 Troubleshooting 章节有说明。