bbruceyuan/Hands-On-Large-Language-Models-CN

中文翻译的 Hands-On-Large-Language-Models (hands-on-llms),动手学习大模型

Jupyter Notebook

2,979

28 commits

updated Oct 14, 2026

See the code

README

Hands-On Large Language Models CN(ZH) -- 动手学大模型

ApeCode.ai ApeRouter

这本书(Hands-On Large Language Models)原作者是 Jay Alammar,Maarten Grootendorst。 英文好的同学强烈推荐支持原书,访问 原书地址 。

这是中文版本的 hands-on LLMs,推荐大家访问原书。

也非常欢迎大家感兴趣可以关注公众号【chaofa用代码打点酱油】获得文字更新推送~ 或者加群来吹水聊天(🤣)

中文版有什么特点

  • 对代码进行了更详细的注释,并且在部分内容加上自己的理解。
  • 有更适合国内网络环境使用的 Notebook 版本,不需要翻墙可以使用(主要是更快)
    • 这里我也是为了免费用了 openbayes 的 GPU,注册可以送 5 小时 CPU 和 3 小时 4090 GPU,如果用我的链接注册,我们都能多一个小时。能薅一点牛毛是一点是一点,目标是免费录完这次教程。
    • 如果你不太喜欢 notebook 类型,更喜欢实验室这种 Linux 类型的环境,那么推荐你使用 AIStackDC 算力平台,可以直接 ssh,配置好之后就是一个独立的开发机,如果使用我的邀请链接,可以额外获得 2 张 1 折优惠券(5 小时)和 3 张 5 折优惠券(36 小时),这样前一百个小时基本免费吧。
  • 配套的中文视频讲解。

[!TIP] 🦧 跑代码需要 LLM API?试试我做的 ApeRouter — 国内直连的 LLM API 路由,支持 Claude / GPT / Kimi 等模型,无需翻墙。更多 AI 学习资源:ApeCode.ai

目录

建议海外用户通过 Google Colab 运行所有示例,以获得最简单的设置。Google Colab 允许您免费使用具有 16GB 显存的 T4 GPU。所有示例主要使用 Google Colab 构建和测试,因此它应该是更稳定的平台。然而,任何其他云提供商都应该可以工作。

国内用户如果想要运行,最好还是用中文可运行 Notebook,你可以复制我的容器直接运行这些代码,注册链接,这样不需要翻墙,国内网络环境访问 Google Colab 可能比较慢。

章节Google Colab中文 Notebook
复制后可直接运行
视频讲解
(可点击)
第一章: 介绍大模型Open In Colab中文可运行 Notebookbilibili
Youtube
第二章: Tokens and EmbeddingsOpen In Colab中文可运行 Notebookbilibili
Youtube
第三章: Looking Inside Transformer LLMsOpen In Colab中文可运行 Notebookbilibili
Youtube
第四章: Text ClassificationOpen In Colab中文可运行 Notebookbilibili
Youtube
第五章: Text Clustering and Topic ModelingOpen In Colab中文可运行 Notebookbilibili
Youtube
第六章: Prompt EngineeringOpen In Colab中文可运行 Notebookbilibili
Youtube
第七章: Advanced Text Generation Techniques and ToolsOpen In Colab中文可运行 Notebookbilibili
Youtube
第八章: Semantic Search and Retrieval-Augmented GenerationOpen In Colab
RAG 进化之路:传统 RAG 到工具与强化学习双轮驱动的 Agentic RAG
中文可运行 Notebookbilibili
Youtube
第九章: Multimodal Large Language ModelsOpen In Colab中文可运行 Notebook在录了~
第十章: Creating Text Embedding ModelsOpen In Colab中文可运行 Notebook在录了~
第十一章: Fine-tuning Representation Models for ClassificationOpen In Colab中文可运行 Notebook在录了~
第 12.1 章: 大模型 SFTOpen In Colab中文可运行 Notebookbilibili
Youtube
bonous1 - 动手实现 LoRA(非import peft)LoRA 原理和 PyTorch 代码实现中文可运行 Notebookbilibili
bonus2 从零实现 GRPO (Agent RL),用于 Agentic RAG 训练RAG 进化之路:传统 RAG 到工具与强化学习双轮驱动的 Agentic RAG中文可运行 Notebookbilibili
Youtube

[!TIP] You can check the setup folder for a quick-start guide to install all packages locally and you can check the conda folder for a complete guide on how to setup your environment, including conda and PyTorch installation. Note that the depending on your OS, Python version, and dependencies your results might be slightly differ. However, they should this be similar to the examples in the book.

🤝 让 YouWare 做你的 AI 工作搭档

YouWare:你的 AI 搭档,随时待命

YouWare 是你的 AI 工作搭档:把论文 PDF、实验记录、Excel / CSV 数据直接丢进去,说一句需求,它会自己查资料、核对来源、跑数据分析,交回一份能直接用的 PPT、研究报告或表格。内容都能继续编辑,PPT 还能导出 PowerPoint / PDF,组会汇报、技术分享、写综述都用得上。Claude、Gemini、GPT 等模型自动挑选,不用配 API key,网页和手机都能用。学大模型的路上,做材料的活交给 YouWare,时间留给读代码、跑实验。 免费试试 YouWare

其他资源

We attempted to put as much information into the book without it being overwhelming. However, even with a 400-page book there is still much to discover! If you are interested in similar illustrated/visual guides we created, these might be of interest to you:

Citation

Please consider citing the book if you consider it useful for your research:

@book{hands-on-llms-book,
  author       = {Jay Alammar and Maarten Grootendorst},
  title        = {Hands-On Large Language Models},
  publisher    = {O'Reilly},
  year         = {2024},
  isbn         = {978-1098150969},
  url          = {https://www.oreilly.com/library/view/hands-on-large-language/9781098150952/},
  github       = {https://github.com/HandsOnLLM/Hands-On-Large-Language-Models}
}

🦧 More from the Author

  • 🌐 ApeCode.ai — AI 编程工具与学习平台
  • 🔗 ApeRouter — 国内直连的 LLM API 路由,支持 Claude / GPT / Kimi
  • 📝 yuanchaofa.com — 技术博客:LLM / Agent / 深度学习
  • 🎬 B站 / YouTube — 视频教程
  • 💬 微信:bbruceyuan(请备注来意)
hands-on-llm
hands-on-transformers
hans-on-llms
llms

bbruceyuan/Hands-On-Large-Language-Models-CN

中文翻译的 Hands-On-Large-Language-Models (hands-on-llms),动手学习大模型

Jupyter Notebook

2,979

28 commits

updated Oct 14, 2026

See the code

README

Hands-On Large Language Models CN(ZH) -- 动手学大模型

ApeCode.ai ApeRouter

这本书(Hands-On Large Language Models)原作者是 Jay Alammar,Maarten Grootendorst。 英文好的同学强烈推荐支持原书,访问 原书地址 。

这是中文版本的 hands-on LLMs,推荐大家访问原书。

也非常欢迎大家感兴趣可以关注公众号【chaofa用代码打点酱油】获得文字更新推送~ 或者加群来吹水聊天(🤣)

中文版有什么特点

  • 对代码进行了更详细的注释,并且在部分内容加上自己的理解。
  • 有更适合国内网络环境使用的 Notebook 版本,不需要翻墙可以使用(主要是更快)
    • 这里我也是为了免费用了 openbayes 的 GPU,注册可以送 5 小时 CPU 和 3 小时 4090 GPU,如果用我的链接注册,我们都能多一个小时。能薅一点牛毛是一点是一点,目标是免费录完这次教程。
    • 如果你不太喜欢 notebook 类型,更喜欢实验室这种 Linux 类型的环境,那么推荐你使用 AIStackDC 算力平台,可以直接 ssh,配置好之后就是一个独立的开发机,如果使用我的邀请链接,可以额外获得 2 张 1 折优惠券(5 小时)和 3 张 5 折优惠券(36 小时),这样前一百个小时基本免费吧。
  • 配套的中文视频讲解。

[!TIP] 🦧 跑代码需要 LLM API?试试我做的 ApeRouter — 国内直连的 LLM API 路由,支持 Claude / GPT / Kimi 等模型,无需翻墙。更多 AI 学习资源:ApeCode.ai

目录

建议海外用户通过 Google Colab 运行所有示例,以获得最简单的设置。Google Colab 允许您免费使用具有 16GB 显存的 T4 GPU。所有示例主要使用 Google Colab 构建和测试,因此它应该是更稳定的平台。然而,任何其他云提供商都应该可以工作。

国内用户如果想要运行,最好还是用中文可运行 Notebook,你可以复制我的容器直接运行这些代码,注册链接,这样不需要翻墙,国内网络环境访问 Google Colab 可能比较慢。

章节Google Colab中文 Notebook
复制后可直接运行
视频讲解
(可点击)
第一章: 介绍大模型Open In Colab中文可运行 Notebookbilibili
Youtube
第二章: Tokens and EmbeddingsOpen In Colab中文可运行 Notebookbilibili
Youtube
第三章: Looking Inside Transformer LLMsOpen In Colab中文可运行 Notebookbilibili
Youtube
第四章: Text ClassificationOpen In Colab中文可运行 Notebookbilibili
Youtube
第五章: Text Clustering and Topic ModelingOpen In Colab中文可运行 Notebookbilibili
Youtube
第六章: Prompt EngineeringOpen In Colab中文可运行 Notebookbilibili
Youtube
第七章: Advanced Text Generation Techniques and ToolsOpen In Colab中文可运行 Notebookbilibili
Youtube
第八章: Semantic Search and Retrieval-Augmented GenerationOpen In Colab
RAG 进化之路:传统 RAG 到工具与强化学习双轮驱动的 Agentic RAG
中文可运行 Notebookbilibili
Youtube
第九章: Multimodal Large Language ModelsOpen In Colab中文可运行 Notebook在录了~
第十章: Creating Text Embedding ModelsOpen In Colab中文可运行 Notebook在录了~
第十一章: Fine-tuning Representation Models for ClassificationOpen In Colab中文可运行 Notebook在录了~
第 12.1 章: 大模型 SFTOpen In Colab中文可运行 Notebookbilibili
Youtube
bonous1 - 动手实现 LoRA(非import peft)LoRA 原理和 PyTorch 代码实现中文可运行 Notebookbilibili
bonus2 从零实现 GRPO (Agent RL),用于 Agentic RAG 训练RAG 进化之路:传统 RAG 到工具与强化学习双轮驱动的 Agentic RAG中文可运行 Notebookbilibili
Youtube

[!TIP] You can check the setup folder for a quick-start guide to install all packages locally and you can check the conda folder for a complete guide on how to setup your environment, including conda and PyTorch installation. Note that the depending on your OS, Python version, and dependencies your results might be slightly differ. However, they should this be similar to the examples in the book.

🤝 让 YouWare 做你的 AI 工作搭档

YouWare:你的 AI 搭档,随时待命

YouWare 是你的 AI 工作搭档:把论文 PDF、实验记录、Excel / CSV 数据直接丢进去,说一句需求,它会自己查资料、核对来源、跑数据分析,交回一份能直接用的 PPT、研究报告或表格。内容都能继续编辑,PPT 还能导出 PowerPoint / PDF,组会汇报、技术分享、写综述都用得上。Claude、Gemini、GPT 等模型自动挑选,不用配 API key,网页和手机都能用。学大模型的路上,做材料的活交给 YouWare,时间留给读代码、跑实验。 免费试试 YouWare

其他资源

We attempted to put as much information into the book without it being overwhelming. However, even with a 400-page book there is still much to discover! If you are interested in similar illustrated/visual guides we created, these might be of interest to you:

Citation

Please consider citing the book if you consider it useful for your research:

@book{hands-on-llms-book,
  author       = {Jay Alammar and Maarten Grootendorst},
  title        = {Hands-On Large Language Models},
  publisher    = {O'Reilly},
  year         = {2024},
  isbn         = {978-1098150969},
  url          = {https://www.oreilly.com/library/view/hands-on-large-language/9781098150952/},
  github       = {https://github.com/HandsOnLLM/Hands-On-Large-Language-Models}
}

🦧 More from the Author

  • 🌐 ApeCode.ai — AI 编程工具与学习平台
  • 🔗 ApeRouter — 国内直连的 LLM API 路由,支持 Claude / GPT / Kimi
  • 📝 yuanchaofa.com — 技术博客:LLM / Agent / 深度学习
  • 🎬 B站 / YouTube — 视频教程
  • 💬 微信:bbruceyuan(请备注来意)
hands-on-llm
hands-on-transformers
hans-on-llms
llms

Significant stargazers

twelveand0

48 followers · starred Jan 2025

YG

58 followers · starred Feb 2025

Herobrine

170 followers · starred Nov 2024

老农民玩AI

5 followers · starred Sep 2026