ollama/ollama

GitHub: ollama/ollama

一款跨平台本地大模型运行工具,通过简洁的 CLI 和 REST API 让用户轻松部署和调用各类开源 LLM。

Stars: 163817 | Forks: 14729

ollama

# Ollama 开始使用开源模型进行构建。 ## 下载 ### macOS ``` curl -fsSL https://ollama.com/install.sh | sh ``` 或者 [手动下载](https://ollama.com/download/Ollama.dmg) ### Windows ``` irm https://ollama.com/install.ps1 | iex ``` 或者 [手动下载](https://ollama.com/download/OllamaSetup.exe) ### Linux ``` curl -fsSL https://ollama.com/install.sh | sh ``` [手动安装说明](https://docs.ollama.com/linux#manual-install) ### Docker 官方 [Ollama Docker 镜像](https://hub.docker.com/r/ollama/ollama) `ollama/ollama` 已在 Docker Hub 上提供。 ### 库 - [ollama-python](https://github.com/ollama/ollama-python) - [ollama-js](https://github.com/ollama/ollama-js) ## 入门 ``` ollama ``` 系统将提示你运行模型,或将 Ollama 连接到你现有的 agent 或应用程序,例如 `claude`、`codex`、`openclaw` 等。 ### 编码 启动特定集成: ``` ollama launch claude ``` 支持的集成包括 [Claude Code](https://docs.ollama.com/integrations/claude-code)、[Codex](https://docs.ollama.com/integrations/codex)、[Droid](https://docs.ollama.com/integrations/droid) 和 [OpenCode](https://docs.ollama.com/integrations/opencode)。 ### AI 助手 使用 [OpenClaw](https://docs.ollama.com/integrations/openclaw) 将 Ollama 变身为跨 WhatsApp、Telegram、Slack、Discord 等平台的个人 AI 助手: ``` ollama launch openclaw ``` ### 与模型聊天 运行并与 [Gemma 3](https://ollama.com/library/gemma3) 聊天: ``` ollama run gemma3 ``` 查看 [ollama.com/library](https://ollama.com/library) 获取完整列表。 有关更多详细信息,请参阅[快速入门指南](https://docs.ollama.com/quickstart)。 ## REST API Ollama 提供用于运行和管理模型的 REST API。 ``` curl http://localhost:11434/api/chat -d '{ "model": "gemma3", "messages": [{ "role": "user", "content": "Why is the sky blue?" }], "stream": false }' ``` 请参阅 [API 文档](https://docs.ollama.com/api) 了解所有端点。 ### Python ``` pip install ollama ``` ``` from ollama import chat response = chat(model='gemma3', messages=[ { 'role': 'user', 'content': 'Why is the sky blue?', }, ]) print(response.message.content) ``` ### JavaScript ``` npm i ollama ``` ``` import ollama from "ollama"; const response = await ollama.chat({ model: "gemma3", messages: [{ role: "user", content: "Why is the sky blue?" }], }); console.log(response.message.content); ``` ## 支持的后端 - 由 Georgi Gerganov 创立的 [llama.cpp](https://github.com/ggml-org/llama.cpp) 项目。 ## 文档 - [CLI 参考](https://docs.ollama.com/cli) - [REST API 参考](https://docs.ollama.com/api) - [导入模型](https://docs.ollama.com/import) - [Modelfile 参考](https://docs.ollama.com/modelfile) - [从源代码构建](https://github.com/ollama/ollama/blob/main/docs/development.md) ## 社区集成 ### 聊天界面 #### Web - [Open WebUI](https://github.com/open-webui/open-webui) - 可扩展、自托管的 AI 界面 - [Onyx](https://github.com/onyx-dot-app/onyx) - 连接式 AI 工作区 - [LibreChat](https://github.com/danny-avila/LibreChat) - 增强版 ChatGPT 克隆,支持多提供商 - [Lobe Chat](https://github.com/lobehub/lobe-chat) - 具有插件生态系统的现代聊天框架 ([文档](https://lobehub.com/docs/self-hosting/examples/ollama)) - [NextChat](https://github.com/ChatGPTNextWeb/ChatGPT-Next-Web) - 跨平台 ChatGPT UI ([文档](https://docs.nextchat.dev/models/ollama)) - [Perplexica](https://github.com/ItzCrazyKns/Perplexica) - AI 驱动的搜索引擎,开源 Perplexity 替代品 - [big-AGI](https://github.com/enricoros/big-AGI) - 面向专业人士的 AI 套件 - [Lollms WebUI](https://github.com/ParisNeo/lollms-webui) - 多模型 Web 界面 - [ChatOllama](https://github.com/sugarforever/chat-ollama) - 带知识库的聊天机器人 - [Bionic GPT](https://github.com/bionic-gpt/bionic-gpt) - 本地部署的 AI 平台 - [Chatbot UI](https://github.com/ivanfioravanti/chatbot-ollama) - ChatGPT 风格的 Web 界面 - [Hollama](https://github.com/fmaclen/hollama) - 极简 Web 界面 - [Chatbox](https://github.com/Bin-Huang/Chatbox) - 桌面和 Web AI 客户端 - [chat](https://github.com/swuecho/chat) - 面向团队的聊天 Web 应用 - [Ollama RAG Chatbot](https://github.com/datvodinh/rag-chatbot.git) - 使用 RAG 与多个 PDF 聊天 - [Tkinter-based client](https://github.com/chyok/ollama-gui) - Python 桌面客户端 #### 桌面 - [Dify.AI](https://github.com/langgenius/dify) - LLM 应用开发平台 - [AnythingLLM](https://github.com/Mintplex-Labs/anything-llm) - 适用于 Mac、Windows 和 Linux 的多合一 AI 应用 - [Maid](https://github.com/Mobile-Artificial-Intelligence/maid) - 跨平台移动和桌面客户端 - [Witsy](https://github.com/nbonamy/witsy) - 适用于 Mac、Windows 和 Linux 的 AI 桌面应用 - [Cherry Studio](https://github.com/kangfenmao/cherry-studio) - 多提供商桌面客户端 - [Ollama App](https://github.com/JHubi1/ollama-app) - 适用于桌面和移动端的多平台客户端 - [PyGPT](https://github.com/szczyglis-dev/py-gpt) - 适用于 Linux、Windows 和 Mac 的 AI 桌面助手 - [Alpaca](https://github.com/Jeffser/Alpaca) - 适用于 Linux 和 macOS 的 GTK4 客户端 - [SwiftChat](https://github.com/aws-samples/swift-chat) - 跨平台,支持 iOS、Android 和 Apple Vision Pro - [Enchanted](https://github.com/AugustDev/enchanted) - 原生 macOS 和 iOS 客户端 - [RWKV-Runner](https://github.com/josStorer/RWKV-Runner) - 多模型桌面运行器 - [Ollama Grid Search](https://github.com/dezoito/ollama-grid-search) - 评估和比较模型 - [macai](https://github.com/Renset/macai) - 适用于 Ollama 和 ChatGPT 的 macOS 客户端 - [AI Studio](https://github.com/MindWorkAI/AI-Studio) - 多提供商桌面 IDE - [Reins](https://github.com/ibrahimcetin/reins) - 参数调整和推理模型支持 - [ConfiChat](https://github.com/1runeberg/confichat) - 注重隐私,支持可选加密 - [LLocal.in](https://github.com/kartikm7/llocal) - Electron 桌面客户端 - [MindMac](https://mindmac.app) - Mac AI 聊天客户端 - [Msty](https://msty.app) - 多模型桌面客户端 - [BoltAI for Mac](https://boltai.com) - Mac AI 聊天客户端 - [IntelliBar](https://intellibar.app/) - macOS AI 助手 - [Kerlig AI](https://www.kerlig.com/) - macOS AI 写作助手 - [Hillnote](https://hillnote.com) - Markdown 优先的 AI 工作区 - [Perfect Memory AI](https://www.perfectmemory.ai/) - 根据屏幕和会议记录个性化的生产力 AI #### 移动端 - [Ollama Android Chat](https://github.com/sunshine0523/OllamaServer) - Android 上一键运行 Ollama ### 代码编辑器与开发 - [Cline](https://github.com/cline/cline) - VS Code 扩展,支持多文件/全仓库编码 - [Continue](https://github.com/continuedev/continue) - 适用于任何 IDE 的开源 AI 代码助手 - [Void](https://github.com/voideditor/void) - 开源 AI 代码编辑器,Cursor 的替代品 - [Copilot for Obsidian](https://github.com/logancyang/obsidian-copilot) - Obsidian 的 AI 助手 - [twinny](https://github.com/rjmacarthy/twinny) - Copilot 和 Copilot chat 的替代品 - [gptel Emacs client](https://github.com/karthink/gptel) - Emacs LLM 客户端 - [Ollama Copilot](https://github.com/bernardo-bruning/ollama-copilot) - 将 Ollama 用作 GitHub Copilot - [Obsidian Local GPT](https://github.com/pfrankov/obsidian-local-gpt) - Obsidian 本地 AI - [Ellama Emacs client](https://github.com/s-kostyaev/ellama) - Emacs LLM 工具 - [orbiton](https://github.com/xyproto/orbiton) - 零配置文本编辑器,支持 Ollama Tab 补全 - [AI ST Completion](https://github.com/yaroslavyaroslav/OpenAI-sublime-text) - Sublime Text 4 AI 助手 - [VT Code](https://github.com/vinhnx/vtcode) - 基于 Rust 的终端编码 agent,带 Tree-sitter - [QodeAssist](https://github.com/Palm1r/QodeAssist) - Qt Creator 的 AI 编码助手 - [AI Toolkit for VS Code](https://aka.ms/ai-tooklit/ollama-docs) - 微软官方 VS Code 扩展 - [Open Interpreter](https://docs.openinterpreter.com/language-model-setup/local-models/ollama) - 计算机的自然语言接口 ### 库与 SDK - [LiteLLM](https://github.com/BerriAI/litellm) - 统一 100 多个 LLM 提供商的 API - [Semantic Kernel](https://github.com/microsoft/semantic-kernel/tree/main/python/semantic_kernel/connectors/ai/ollama) - 微软 AI 编排 SDK - [LangChain4j](https://github.com/langchain4j/langchain4j) - Java LangChain ([示例](https://github.com/langchain4j/langchain4j-examples/tree/main/ollama-examples/src/main/java)) - [LangChainGo](https://github.com/tmc/langchaingo/) - Go LangChain ([示例](https://github.com/tmc/langchaingo/tree/main/examples/ollama-completion-example)) - [Spring AI](https://github.com/spring-projects/spring-ai) - Spring 框架 AI 支持 ([文档](https://docs.spring.io/spring-ai/reference/api/chat/ollama-chat.html)) - [LangChain](https://python.langchain.com/docs/integrations/chat/ollama/) 和 [LangChain.js](https://js.langchain.com/docs/integrations/chat/ollama/) 及 [示例](https://js.langchain.com/docs/tutorials/local_rag/) - [Ollama for Ruby](https://github.com/crmne/ruby_llm) - Ruby LLM 库 - [any-llm](https://github.com/mozilla-ai/any-llm) - Mozilla 推出的统一 LLM 接口 - [OllamaSharp for .NET](https://github.com/awaescher/OllamaSharp) - .NET SDK - [LangChainRust](https://github.com/Abraxas-365/langchain-rust) - Rust LangChain ([示例](https://github.com/Abraxas-365/langchain-rust/blob/main/examples/llm_ollama.rs)) - [Agents-Flex for Java](https://github.com/agents-flex/agents-flex) - Java Agent 框架 ([示例](https://github.com/agents-flex/agents-flex/tree/main/agents-flex-llm/agents-flex-llm-ollama/src/test/java/com/agentsflex/llm/ollama)) - [Elixir LangChain](https://github.com/brainlid/langchain) - Elixir LangChain - [Ollama-rs for Rust](https://github.com/pepperoni21/ollama-rs) - Rust SDK - [LangChain for .NET](https://github.com/tryAGI/LangChain) - .NET LangChain ([示例](https://github.com/tryAGI/LangChain/blob/main/examples/LangChain.Samples.OpenAI/Program.cs)) - [chromem-go](https://github.com/philippgille/chromem-go) - 支持 Ollama embeddings 的 Go 向量数据库 ([示例](https://github.com/philippgille/chromem-go/tree/v0.5.0/examples/rag-wikipedia-ollama)) - [LangChainDart](https://github.com/davidmigloz/langchain_dart) - Dart LangChain - [LlmTornado](https://github.com/lofcz/llmtornado) - 统一多个推理 API 的 C# 接口 - [Ollama4j for Java](https://github.com/ollama4j/ollama4j) - Java SDK - [Ollama for Laravel](https://github.com/cloudstudio/ollama-laravel) - Laravel 集成 - [Ollama for Swift](https://github.com/mattt/ollama-swift) - Swift SDK - [LlamaIndex](https://docs.llamaindex.ai/en/stable/examples/llm/ollama/) 和 [LlamaIndexTS](https://ts.llamaindex.ai/modules/llms/available_llms/ollama) - LLM 应用的数据框架 - [Haystack](https://github.com/deepset-ai/haystack-integrations/blob/main/integrations/ollama.md) - AI pipeline 框架 - [Firebase Genkit](https://firebase.google.com/docs/genkit/plugins/ollama) - Google AI 框架 - [Ollama-hpp for C++](https://github.com/jmont-dev/ollama-hpp) - C++ SDK - [PromptingTools.jl](https://github.com/svilupp/PromptingTools.jl) - Julia LLM 工具包 ([示例](https://svilupp.github.io/PromptingTools.jl/dev/examples/working_with_ollama)) - [Ollama for R - rollama](https://github.com/JBGruber/rollama) - R SDK - [Portkey](https://portkey.ai/docs/welcome/integration-guides/ollama) - AI 网关 - [Testcontainers](https://testcontainers.com/modules/ollama/) - 基于容器的测试 - [LLPhant](https://github.com/theodo-group/LLPhant?tab=readme-ov-file#ollama) - PHP AI 框架 ### 框架与 Agent - [AutoGPT](https://github.com/Significant-Gravitas/AutoGPT/blob/master/docs/content/platform/ollama.md) - 自主 AI Agent 平台 - [crewAI](https://github.com/crewAIInc/crewAI) - 多 Agent 编排框架 - [Strands Agents](https://github.com/strands-agents/sdk-python) - AWS 推出的模型驱动 Agent 构建工具 - [Cheshire Cat](https://github.com/cheshire-cat-ai/core) - AI 助手框架 - [any-agent](https://github.com/mozilla-ai/any-agent) - Mozilla 推出的统一 Agent 框架接口 - [Stakpak](https://github.com/stakpak/agent) - 开源 DevOps Agent - [Hexabot](https://github.com/hexastack/hexabot) - 对话式 AI 构建器 - [Neuro SAN](https://github.com/cognizant-ai-lab/neuro-san-studio) - 多 Agent 编排 ([文档](https://github.com/cognizant-ai-lab/neuro-san-studio/blob/main/docs/user_guide.md#ollama)) ### RAG 与知识库 - [RAGFlow](https://github.com/infiniflow/ragflow) - 基于深度文档理解的 RAG 引擎 - [R2R](https://github.com/SciPhi-AI/R2R) - 开源 RAG 引擎 - [MaxKB](https://github.com/1Panel-dev/MaxKB/) - 开箱即用的 RAG 聊天机器人 - [Minima](https://github.com/dmayboroda/minima) - 本地部署或完全本地的 RAG - [Chipper](https://github.com/TilmanGriesel/chipper) - 集成 Haystack RAG 的 AI 界面 - [ARGO](https://github.com/xark-argo/argo) - Mac/Windows/Linux 上的 RAG 和深度研究 - [Archyve](https://github.com/nickthecook/archyve) - 支持 RAG 的文档库 - [Casibase](https://casibase.org) - 支持 RAG 和 SSO 的 AI 知识库 - [BrainSoup](https://www.nurgo-software.com/products/brainsoup) - 支持 RAG 和多 Agent 自动化的原生客户端 ### 机器人与消息传递 - [Lang](https://github.com/RockChinQ/LangBot) - 支持 Agent 和 RAG 的多平台消息机器人 - [AstrBot](https://github.com/Soulter/AstrBot/) - 支持 RAG 和插件的多平台聊天机器人 - [Discord-Ollama Chat Bot](https://github.com/kevinthedang/discord-ollama) - TypeScript Discord 机器人 - [Ollama Telegram Bot](https://github.com/ruecat/ollama-telegram) - Telegram 机器人 - [LLM Telegram Bot](https://github.com/innightwolfsleep/llm_telegram_bot) - 用于角色扮演的 Telegram 机器人 ### 终端与 CLI - [aichat](https://github.com/sigoden/aichat) - 集成 Shell 助手、RAG 和 AI 工具的多合一 LLM CLI - [oterm](https://github.com/ggozad/oterm) - Ollama 终端客户端 - [gollama](https://github.com/sammcj/gollama) - 基于 Go 的 Ollama 模型管理器 - [tlm](https://github.com/yusufcanb/tlm) - 本地 Shell Copilot - [tenere](https://github.com/pythops/tenere) - LLM TUI - [ParLlama](https://github.com/paulrobello/parllama) - Ollama TUI - [llm-ollama](https://github.com/taketwo/llm-ollama) - [Datasette's LLM CLI](https://llm.datasette.io/en/stable/) 的插件 - [ShellOracle](https://github.com/djcopley/ShellOracle) - Shell 命令建议 - [LLM-X](https://github.com/mrdjohnson/llm-x) - LLM 渐进式 Web 应用 - [cmdh](https://github.com/pgibler/cmdh) - 自然语言转 Shell 命令 - [VT](https://github.com/vinhnx/vt.ai) - 极简多模态 AI 聊天应用 ### 生产力与应用 - [AppFlowy](https://github.com/AppFlowy-IO/AppFlowy) - AI 协作工作区,可自托管的 Notion 替代品 - [Screenpipe](https://github.com/mediar-ai/screenpipe) - 24/7 屏幕和麦克风录制,带 AI 驱动的搜索 - [Vibe](https://github.com/thewh1teagle/vibe) - 转录和分析会议 - [Page Assist](https://github.com/n4ze3m/page-assist) - AI 浏览 Chrome 扩展 - [NativeMind](https://github.com/NativeMindBrowser/NativeMindExtension) - 私有、设备端浏览器 AI 助手 - [Ollama Fortress](https://github.com/ParisNeo/ollama_proxy_server) - Ollama 安全代理 - [1Panel](https://github.com/1Panel-dev/1Panel/) - 基于 Web 的 Linux 服务器管理 - [Writeopia](https://github.com/Writeopia/Writeopia) - 集成 Ollama 的文本编辑器 - [QA-Pilot](https://github.com/reid41/QA-Pilot) - GitHub 代码仓库理解 - [Raycast extension](https://github.com/MassimilianoPasquini97/raycast_ollama) - Raycast 中的 Ollama - [Painting Droid](https://github.com/mateuszmigas/painting-droid) - 集成 AI 的绘画应用 - [Serene Pub](https://github.com/doolijb/serene-pub) - AI 角色扮演应用 - [Mayan EDMS](https://gitlab.com/mayan-edms/mayan-edms) - 带 Ollama 工作流的文档管理 - [TagSpaces](https://www.tagspaces.org) - 带 [AI 标记](https://docs.tagspaces.org/ai/) 的文件管理 ### 可观测性与监控 - [Opik](https://www.comet.com/docs/opik/cookbook/ollama) - 调试、评估和监控 LLM 应用程序 - [OpenLIT](https://github.com/openlit/openlit) - Ollama 和 GPU 的 OpenTelemetry 原生监控 - [Lunary](https://lunary.ai/docs/integrations/ollama) - 带分析和 PII 遮蔽的 LLM 可观测性 - [Langfuse](https://langfuse.com/docs/integrations/ollama) - 开源 LLM 可观测性 - [HoneyHive](https://docs.honeyhive.ai/integrations/ollama) - Agent 的 AI 可观测性和评估 - [MLflow Tracing](https://mlflow.org/docs/latest/llms/tracing/index.html#automatic-tracing) - 开源 LLM 可观测性 ### 数据库与 Embeddings - [pgai](https://github.com/timescale/pgai) - PostgreSQL 作为向量数据库 ([指南](https://github.com/timescale/pgai/blob/main/docs/vectorizer-quick-start.md)) - [MindsDB](https://github.com/mindsdb/mindsdb/blob/staging/mindsdb/integrations/handlers/ollama_handler/README.md) - 将 Ollama 连接到 200 多个数据平台 - [chromem-go](https://github.com/philippgille/chromem-go/blob/v0.5.0/embed_ollama.go) - Go 嵌入式向量数据库 ([示例](https://github.com/philippgille/chromem-go/tree/v0.5.0/examples/rag-wikipedia-ollama)) - [Kangaroo](https://github.com/dbkangaroo/kangaroo) - AI 驱动的 SQL 客户端 ### 基础设施与部署 #### 云 - [Google Cloud](https://cloud.google.com/run/docs/tutorials/gpu-gemma2-with-ollama) - [Fly.io](https://fly.io/docs/python/do-more/add-ollama/) - [Koyeb](https://www.koyeb.com/deploy/ollama) - [Harbor](https://github.com/av/harbor) - 容器化 LLM 工具包,默认使用 Ollama 作为后端 #### 包管理器 - [Pacman](https://archlinux.org/packages/extra/x86_64/ollama/) - [Homebrew](https://formulae.brew.sh/formula/ollama) - [Nix package](https://search.nixos.org/packages?show=ollama&from=0&size=50&sort=relevance&type=packages&query=ollama) - [Helm Chart](https://artifacthub.io/packages/helm/ollama-helm/ollama) - [Gentoo](https://github.com/gentoo/guru/tree/master/app-misc/ollama) - [Flox](https://flox.dev/blog/ollama-part-one) - [Guix channel](https://codeberg.org/tusharhero/ollama-guix)
标签:AI助手, AI编程, Apex, DeepSeek, DLL 劫持, Docker, EVTX分析, EVTX分析, Gemma, GLM-5, Inference Engine, IP 地址批量处理, Kimi, LLM推理, LLM评估, LocalAI, MacOS, MiniMax, Ollama, Qwen, REST API, SOC Prime, Spyse API, 云安全, 人工智能, 大语言模型, 安全防御评估, 开发工具, 开源模型, 数据可视化, 日志审计, 本地部署, 机器学习, 模型服务, 模型管理, 熵值分析, 用户模式Hook绕过, 离线运行, 请求拦截, 逆向工具