Note
本文档由 WeHub 基于上游 README 翻译整理,属于社区翻译,非官方中文文档。
English · 原始项目 · 上游 README
原作者、版权与许可证归属以原始项目及本仓库 LICENSE 文件为准。
开始使用开放模型构建。
curl -fsSL https://ollama.com/install.sh | sh
或手动下载)
irm https://ollama.com/install.ps1 | iex
或手动下载)
curl -fsSL https://ollama.com/install.sh | sh
官方 Ollama Docker 镜像) ollama/ollama 在 Docker Hub 上可用。
ollama
系统将提示你运行模型,或将 Ollama 连接到你现有的智能体(Agent)或应用程序,例如 Claude Code、OpenClaw、OpenCode、Codex、Copilot 等。
启动特定集成:
ollama launch claude
支持的集成包括 Claude Code,)、Codex,)、Copilot CLI,)、Droid,) 和 OpenCode.)。
使用 OpenClaw) 将 Ollama 变成个人 AI 助手,覆盖 WhatsApp、Telegram、Slack、Discord 等平台:
ollama launch openclaw
运行 Gemma 4:) 并与之对话:
ollama run gemma4
完整列表请参见 ollama.com/library)。
更多详情请参阅快速入门指南)。
Ollama 提供了用于运行和管理模型的 REST API。
curl http://localhost:11434/api/chat -d '{
"model": "gemma4",
"messages": [{
"role": "user",
"content": "Why is the sky blue?"
}],
"stream": false
}'
所有接口(Endpoint)请参见 API 文档)。
pip install ollama
from ollama import chat
response = chat(model='gemma4', messages=[
{
'role': 'user',
'content': 'Why is the sky blue?',
},
])
print(response.message.content)
npm i ollama
import ollama from "ollama";
const response = await ollama.chat({
model: "gemma4",
messages: [{ role: "user", content: "Why is the sky blue?" }],
});
console.log(response.message.content);
想要添加你的项目?提交一个 Pull Request。
上述列出的 SwiftChat、Enchanted、Maid、Ollama App、Reins 和 ConfiChat 同样支持移动平台。