{"id":14964889,"url":"https://github.com/datawhalechina/handy-ollama","last_synced_at":"2026-10-19T08:03:38.899Z","repository":{"id":250892939,"uuid":"835704674","full_name":"datawhalechina/handy-ollama","owner":"datawhalechina","description":"动手学Ollama，CPU玩转大模型部署，在线阅读地址：https://datawhalechina.github.io/handy-ollama/","archived":false,"fork":false,"pushed_at":"2026-01-15T13:06:06.000Z","size":64983,"stargazers_count":2543,"open_issues_count":8,"forks_count":322,"subscribers_count":21,"default_branch":"main","last_synced_at":"2026-10-17T17:17:34.121Z","etag":null,"topics":["agent","gguf","langchain","large-language-models","llamaindex","llm","ollama","rag","tutorial"],"latest_commit_sha":null,"homepage":"https://datawhalechina.github.io/handy-ollama/","language":"Jupyter Notebook","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/datawhalechina.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2024-07-30T11:19:41.000Z","updated_at":"2026-10-17T10:26:42.000Z","dependencies_parsed_at":"2024-08-21T12:42:30.390Z","dependency_job_id":"292c0582-1659-4248-b3e0-460fddf93464","html_url":"https://github.com/datawhalechina/handy-ollama","commit_stats":null,"previous_names":["axyzdong/self-ollama","axyzdong/handy-ollama","datawhalechina/handy-ollama"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/datawhalechina/handy-ollama","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/datawhalechina%2Fhandy-ollama","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/datawhalechina%2Fhandy-ollama/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/datawhalechina%2Fhandy-ollama/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/datawhalechina%2Fhandy-ollama/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/datawhalechina","download_url":"https://codeload.github.com/datawhalechina/handy-ollama/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/datawhalechina%2Fhandy-ollama/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":344872684,"owners_count":38351721,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-10-03T21:59:58.778Z","status":"online","status_checked_at":"2026-10-19T02:00:06.414Z","response_time":53,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["agent","gguf","langchain","large-language-models","llamaindex","llm","ollama","rag","tutorial"],"created_at":"2024-09-24T13:33:54.391Z","updated_at":"2026-10-19T08:03:38.886Z","avatar_url":"https://github.com/datawhalechina.png","language":"Jupyter Notebook","funding_links":[],"categories":["Jupyter Notebook","Learning and Reference"],"sub_categories":["Tutorials and Books"],"readme":"\u003cdiv align='center'\u003e\n    \u003cimg src=\"./images/header.svg\" alt=\"alt text\" width=\"100%\"\u003e\n    \u003ch1\u003e💻 handy-ollama 🦙 (🧪Beta公测版)\u003c/h1\u003e\n\u003c/div\u003e\n\n\u003cdiv align=\"center\"\u003e\n  \u003cimg src=\"https://img.shields.io/github/stars/datawhalechina/handy-ollama?style=flat\u0026logo=github\" alt=\"GitHub stars\"/\u003e\n  \u003cimg src=\"https://img.shields.io/github/forks/datawhalechina/handy-ollama?style=flat\u0026logo=github\" alt=\"GitHub forks\"/\u003e\n  \u003cimg src=\"https://img.shields.io/github/issues/datawhalechina/handy-ollama?style=flat\u0026logo=github\" alt=\"GitHub issues\"/\u003e\n  \u003cimg src=\"https://img.shields.io/badge/license-CC%20BY--NC--SA%204.0-brighgreen?style=flat\u0026logo=github\" alt=\"GitHub license\"/\u003e\n\u003ca href=\"https://datawhalechina.github.io/handy-ollama/\"\u003e\u003cimg src=\"https://img.shields.io/badge/在线阅读-Online%20Reading-green?style=flat\u0026logo=gitbook\" alt=\"Online Reading\"\u003e\u003c/a\u003e\n\u003c/div\u003e\n\n\u003cdiv align=\"center\"\u003e\n  \u003ch3\u003e📚 从零开始实现 CPU 玩转大模型部署！\u003c/h3\u003e\n  \u003cp\u003e\u003cem\u003e动手学 Ollama，快速实现大模型本地部署\u003c/em\u003e\u003c/p\u003e\n\u003c/div\u003e\n\n简体中文 | [English](README_en.md) \n\n\u003e [!WARNING]\n\u003e 🧪 Beta 公测版本提示：教程主体已完成，正在优化细节，欢迎大家提 Issue 反馈问题或建议。\n\n## 🎉官方收录\n\n**2025.11.06，本项目被 Ollama 官方仓库收录，且是目前唯一的 Tutorial：https://github.com/ollama/ollama#tutorial**\n\n## 🚀 项目简介\n动手学 Ollama 教程，轻松上手实现大模型本地化部署，快速在本地管理以及运行大模型，让 CPU 也可以玩转大模型推理部署！\n\n本教程涵盖从基础入门到进阶使用的全方位内容，并通过实际应用案例深入理解和掌握大模型部署以及应用技术。我们的教程提供清晰的步骤和实用的技巧，无论是刚刚接触大模型部署的小白，还是有一定经验的开发者，都可以从零开始学习 Ollama ，实现本地部署大模型以及相关应用。\n\n本项目主要内容：\n\n1. Ollama 介绍、安装和配置，包括在 macOS、Windows、Linux 和 Docker 下的安装与配置；\n2. Ollama 自定义导入模型，包括从 GGUF 导入、从 Pytorch 或 Safetensors 导入、由模型直接导入、自定义 Prompt；\n3. Ollama REST API，包括 Ollama API 使用指南、在 Python、Java、JavaScript 和 C++ 等语言中使用 Ollama API；\n4. Ollama 在 LangChain 中的使用，包括在 Python 和 JavaScript 中的集成；\n5. Ollama 可视化界面部署和应用案例，包括使用 FastAPI 和 WebUI 部署可视化对话界面，以及本地 RAG 应用、Agent 应用等。\n\n**热忱欢迎感兴趣的同学或者开发者们 提出 issue 或者 提交 pull request，让我们一起完善这个项目！**\n\n**我们坚信：每一位对大模型充满热情的学习者，都应该有机会探索和实践。无论你的编程语言背景如何，无论你的计算资源如何，我们都希望能帮助你使用个人 PC 实现大模型部署。 让我们携手打破技术壁垒，共同开启 LLM 探索之旅！**\n\n\n目录结构说明：\n\n      docs ---------------------- Markdown 文档文件\n      notebook ------------------ Notebook 源代码文件以及部分 Python、Java 和 JavaScript 源文件 \n      images -------------------- 图片\n\n📖 在线阅读：https://datawhalechina.github.io/handy-ollama/\n\n\n## 💡 立项理由\n随着大模型的飞速发展，市面上出现了越来越多的开源大模型，但是许多模型的部署需要利用 GPU 资源，如何让大模型时代的红利普惠到每一个人，让每一个人都可以部署属于自己的大模型。Ollama 是一个开源的大语言部署服务工具，只需 CPU 即可部署大模型。我们希望通过动手学 Ollama 这一开源教程，帮助学习者快速上手 Ollama ，让每一位大模型爱好者、学习者以及开发者都能在本地部署自己的大模型，进而开发一些大模型应用，让大模型赋能千行百业！\n\n## 🎯 项目受众\n- 希望不受 GPU 资源限制，在本地运行大模型；\n- 希望在消费级硬件上进行大模型有效的推理；\n- 希望在本地部署大模型，开发大模型应用；\n- 希望在本地管理大模型，让本地模型安全可靠。\n\n## ✨ 项目亮点\n本项目旨在使用 CPU 部署本地大模型，虽然目前已经有很多 LLM 相关的教程，但是这些教程中模型基本上都需要 GPU 资源，这对于很多资源受限的学习者不是很友好。因此，本项目通过动手学 Ollama ，帮助学习者快速上手本地 CPU 部署大模型。\n\n\n## 📖 内容导航\n| 章节                                                                                                   | 关键内容                      | 状态  |\n|------------------------------------------------------------------------------------------------------|---------------------------|-----|\n| \u003cstrong\u003e第一章 Ollama 介绍\u003c/strong\u003e                                                                       |                           |     |\n| [1.1 Ollama 介绍](docs/C1/1.%20Ollama%20介绍.md)                                                         | 基础概念、核心特性                 | ✅   |\n| \u003cstrong\u003e第二章 Ollama 安装与配置\u003c/strong\u003e                                                                    |                           | ✅   |\n| [2.1 macOS 安装与配置](docs/C2/1.%20Ollama%20在%20macOS%20下的安装与配置.md)                                      | macOS 安装、配置               | ✅   |\n| [2.2 Windows 安装与配置](docs/C2/2.%20Ollama%20在%20Windows%20下的安装与配置.md)                                  | Windows 安装、配置             | ✅   |\n| [2.3 Linux 安装与配置](docs/C2/3.%20Ollama%20在%20Linux%20下的安装与配置.md)                                      | Linux 安装、配置               | ✅   |\n| [2.4 Docker 安装与配置](docs/C2/4.%20Ollama%20在%20Docker%20下的安装与配置.md)                                    | Docker 安装、配置              | ✅   |\n| \u003cstrong\u003e第三章 自定义使用 Ollama\u003c/strong\u003e                                                                    | 个性化使用                     | ✅   |\n| [3.1 自定义导入模型](docs/C3/1.%20自定义导入模型.md)                                                               | 外部模型导入                    | ✅   |\n| [3.2 自定义模型存储位置](docs/C3/2.%20自定义模型存储位置.md)                                                           | 存储路径更改                    | ✅   |\n| [3.3 自定义在 GPU 中运行](docs/C3/3.%20自定义在%20GPU%20中运行.md)                                                 | GPU 加速配置                  | ✅   |\n| \u003cstrong\u003e第四章 Ollama REST API\u003c/strong\u003e                                                                 |                           |     |\n| [4.1 Ollama API 使用指南](docs/C4/1.%20Ollama%20API%20使用指南.md)                                           | 调用规则、参数说明                 | ✅   |\n| [4.2 Python 中使用 Ollama API](docs/C4/2.%20在%20Python%20中使用%20Ollama%20API.md)                         | Python 调用                 | ✅   |\n| [4.3 Java 中使用 Ollama API](docs/C4/3.%20在%20Java%20中使用%20Ollama%20API.md)                             | Java 调用                   | ✅   |\n| [4.4 JavaScript 中使用 Ollama API](docs/C4/4.%20在%20JavaScript%20中使用%20Ollama%20API.md)                 | JavaScript 调用             | ✅   |\n| [4.5 C++ 中使用 Ollama API](docs/C4/5.%20在%20C++%20中使用%20Ollama%20API.md)                               | C++ 调用                    | ✅   |\n| [4.6 Golang 中使用 Ollama API](docs/C4/6.%20在%20Golang%20中使用%20Ollama%20API.md)                         | Golang 调用                 | ✅   |\n| C# 中使用 Ollama API                                                                                    | C# 调用（待更）                 | 🚧  |\n| Rust 中使用 Ollama API                                                                                  | Rust 调用（待更）               | 🚧  |\n| Ruby 中使用 Ollama API                                                                                  | Ruby 调用（待更）               | 🚧  |\n| R 中使用 Ollama API                                                                                     | R 调用（待更）                  | 🚧  |\n| \u003cstrong\u003e第五章 Ollama 在 LangChain 中的使用\u003c/strong\u003e                                                         |                           |     |\n| [5.1 Python 中的集成](docs/C5/1.%20Ollama%20在%20LangChain%20中的使用%20-%20Python%20集成.md)                   | Python + LangChain 集成     | ✅   |\n| [5.2 JavaScript 中的集成](docs/C5/2.%20Ollama%20在%20LangChain%20中的使用%20-%20JavaScript%20集成.md)           | JavaScript + LangChain 集成 | ✅   |\n| \u003cstrong\u003e第六章 Ollama 可视化界面部署\u003c/strong\u003e                                                                  |                           |     |\n| [6.1 FastAPI 部署可视化界面](docs/C6/1.%20使用%20FastAPI%20部署%20Ollama%20可视化对话界面.md)                          | FastAPI 部署                | ✅   |\n| [6.2 WebUI 部署可视化界面](docs/C6/2.%20使用%20WebUI%20部署%20Ollama%20可视化对话界面.md)                              | WebUI 部署                  | ✅   |\n| \u003cstrong\u003e第七章 应用案例\u003c/strong\u003e                                                                            |                           |     |\n| [7.1 搭建本地 AI Copilot 编程助手](docs/C7/1.%20搭建本地的%20AI%20Copilot%20编程助手.md)                              | 本地编程助手                    | ✅   |\n| [7.2 Dify 接入本地模型](docs/C7/2.%20Dify%20接入%20Ollama%20部署的本地模型.md)                                      | Dify 集成本地模型               | ✅   |\n| [7.3 LangChain 搭建本地 RAG 应用](docs/C7/3.%20使用%20LangChain%20搭建本地%20RAG%20应用.md)                        | LangChain + 本地 RAG        | ✅   |\n| [7.4 LlamaIndex 搭建本地 RAG 应用](docs/C7/4.%20使用%20LlamaIndex%20搭建本地%20RAG%20应用.md)                      | LlamaIndex + 本地 RAG       | ✅   |\n| [7.5 LangChain 实现本地 Agent](docs/C7/5.%20使用%20LangChain%20实现本地%20Agent.md)                            | LangChain + 本地 Agent      | ✅   |\n| [7.6 LlamaIndex 实现本地 Agent](docs/C7/6.%20使用%20LlamaIndex%20实现本地%20Agent.md)                          | LlamaIndex + 本地 Agent     | ✅   |\n| [7.7 DeepSeek R1 + Ollama 本地 RAG](docs/C7/7.%20使用%20DeepSeek%20R1%20和%20Ollama%20实现本地%20RAG%20应用.md) | DeepSeek R1 + 本地 RAG      | ✅   |\n| ...                                                                                                  | ...                       | ... |\n\n**_注：所有标记（待更新）的内容，以及其他相关的内容，热忱欢迎感兴趣的开发者们 提出 issue 或者 提交 pull request，让我们一起完善这个项目！_**\n\n**想要深度参与的同学可以联系我们，我们会将你加入到项目的维护者中。**\n\n\n## 🙏 致谢\n\n### 核心贡献者\n\n- [张友东](https://github.com/AXYZdong)（Datawhale成员）\n- [林通](https://github.com/kjlintong)（Datawhale成员）\n- [柴春阳](https://github.com/Springff)（内容创作者）\n- [王莹莹](https://github.com/fuyueagain)（Datawhale成员）\n- [曾鑫民](https://github.com/fancyboi999)（内容创作者）\n- [娄天奥](https://github.com/lta155)（Datawhale成员）\n- [杨卓](https://github.com/little1d)（内容创作者）\n- [姜舒凡](https://github.com/Tsumugii24)（Datawhale成员）\n- [曹越](https://github.com/rainsubtime)（内容创作者）\n- [王晓亮](https://github.com/tomowang)（Datawhale成员）\n\n\n### 特别感谢\n- Ollama 官方仓库：https://github.com/ollama/ollama\n- 感谢  [@Sm1les](https://github.com/Sm1les) 对本项目的帮助与支持\n- 感谢所有为本项目做出贡献的开发者们 ❤️\n\n\u003ca href=\"https://github.com/AXYZdong/handy-ollama/graphs/contributors\"\u003e\n  \u003cimg src=\"https://contrib.rocks/image?repo=AXYZdong/handy-ollama\" /\u003e\n\u003c/a\u003e\n\n## Star History\n\n[![Star History Chart](https://api.star-history.com/svg?repos=datawhalechina/handy-ollama\u0026type=Date)](https://star-history.com/#datawhalechina/handy-ollama\u0026Date)\n\n## LICENSE\n\n\u003ca rel=\"license\" href=\"http://creativecommons.org/licenses/by-nc-sa/4.0/\"\u003e\u003cimg alt=\"知识共享许可协议\" style=\"border-width:0\" src=\"https://img.shields.io/badge/license-CC%20BY--NC--SA%204.0-lightgrey\" /\u003e\u003c/a\u003e\u003cbr /\u003e本作品采用\u003ca rel=\"license\" href=\"http://creativecommons.org/licenses/by-nc-sa/4.0/\"\u003e知识共享署名-非商业性使用-相同方式共享 4.0 国际许可协议\u003c/a\u003e进行许可。\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdatawhalechina%2Fhandy-ollama","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdatawhalechina%2Fhandy-ollama","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdatawhalechina%2Fhandy-ollama/lists"}