跳转到主要内容

书籍

Ollama 文档

Ollama 文档。内容保持上游原样。

4 章65 页更新于 2 天前

开始阅读

目录65

  1. 第 1 章 Api 9 页
    1. 1.1 Anthropic compatibility Connect Anthropic clients and tools such as Claude Code to Ollama. Ollama supports a subset of the Anthropi... 2 天前
    2. 1.2 Authentication The local API at http://localhost:11434 does not require authentication. To use cloud models, publish mode... 2 天前
    3. 1.3 Balance curl https://ollama.com/api/balance \ -H "Authorization: Bearer $OLLAMA_API_KEY" { "included": { "b... 2 天前
    4. 1.4 Cloud usage curl 'https://ollama.com/api/usage?range=24h' \ -H "Authorization: Bearer $OLLAMA_API_KEY" { "range": "... 2 天前
    5. 1.5 Errors Endpoints return appropriate HTTP status codes based on the success or failure of the request in the HTTP s... 2 天前
    6. 1.6 Introduction Use Ollama's API to build applications with cloud or local models. Get started Call cloud models with an AP... 2 天前
    7. 1.7 OpenAI compatibility Connect OpenAI clients to Ollama. Ollama supports a subset of the OpenAI API. Direct cloud access Set your ... 2 天前
    8. 1.8 Streaming Certain API endpoints stream responses by default, such as /api/generate. These responses are provided in ... 2 天前
    9. 1.9 Usage Ollama's API responses include metrics that can be used for measuring performance and model usage: total_du... 2 天前
  2. 第 2 章 Capabilities 9 页
    1. 2.1 Decision Use System One to classify text, answer yes/no questions, or score text against a rubric. See the full list... 2 天前
    2. 2.2 Embeddings Embeddings turn text into numeric vectors you can store in a vector database, search with cosine similarity... 2 天前
    3. 2.3 Speech Speech models read text aloud. Ollama streams the audio as it is generated, so playback can start before th... 2 天前
    4. 2.4 Streaming Streaming allows you to render text as it is produced by the model. Streaming is enabled by default through... 2 天前
    5. 2.5 Structured Outputs Ollama's cloud currently does not support structured outputs. Structured outputs let you enforce a JSON sch... 2 天前
    6. 2.6 Thinking Thinking-capable models emit a thinking field that separates their reasoning trace from the final answer. ... 2 天前
    7. 2.7 Tool calling Ollama supports tool calling (also known as function calling) which allows a model to invoke tools and inco... 2 天前
    8. 2.8 Vision Vision models accept images alongside text so the model can describe, classify, and answer questions about ... 2 天前
    9. 2.9 Web search Ollama's web search API can be used to augment models with the latest information to reduce hallucinations ... 2 天前
  3. 19 Documentation Getting Started Quickstart Examples Importing models MacOS Documentation Linux Documentation Windows Docume... 2 天前
  4. 第 3 章 Integrations 27 页
    1. 3.1 ChatGPT Desktop ChatGPT Desktop includes Codex, OpenAI's desktop coding agent. Ollama adds compatible local and cloud model... 2 天前
    2. 3.2 Claude Code Claude Code reads your codebase, edits files, and runs commands. Ollama connects Claude Code to local and c... 2 天前
    3. 3.3 Claude Desktop Ollama. Windows support coming soon. To use a local model, download it before setup. To use a cloud model, ... 2 天前
    4. 3.4 Cline CLI Cline CLI is an autonomous coding agent for interactive terminal sessions. <img src="/images/cline-cli.png"... 2 天前
    5. 3.5 Cline Install Cline in your IDE. Usage with Ollama Open Cline settings > API Configuration and set API Provider... 2 天前
    6. 3.6 Codex CLI Install the Codex CLI. For the ChatGPT desktop app, see ChatGPT Desktop. npm install -g @openai/codex Usage... 2 天前
    7. 3.7 Copilot CLI GitHub Copilot CLI is GitHub's AI coding agent for the terminal. It can understand your codebase, make edit... 2 天前
    8. 3.8 DeepSeek Harness DeepSeek Harness is an open-source coding agent. DeepSeek Harness is currently a developer preview. Its ups... 2 天前
    9. 3.9 Droid Install the Droid CLI: curl -fsSL https://app.factory.ai/cli | sh Droid requires a larger context window. I... 2 天前
    10. 3.10 Goose Install Goose Desktop. Usage with Ollama In Goose, open Settings → Configure Provider. 2. Find **Ollama*... 2 天前
    11. 3.11 Hermes Desktop Hermes Desktop is a native AI assistant app by Nous Research. It provides a desktop chat interface for Herm... 2 天前
    12. 3.12 Hermes Agent Hermes Agent is a self-improving AI agent built by Nous Research. It features automatic skill creation, cro... 2 天前
    13. 3.13 Overview Use Ollama models in your apps and tools. Launch a coding agent Run ollama launch in a terminal to choose ... 2 天前
    14. 3.14 JetBrains This example uses IntelliJ; same steps apply to other JetBrains IDEs (e.g., PyCharm). Install Install Intel... 2 天前
    15. 3.15 marimo Install marimo. You can use pip or uv for this. You can also use uv to create a sandboxed environment fo... 2 天前
    16. 3.16 n8n Install n8n. Using Ollama Locally In the top right corner, click the dropdown and select Create Credential ... 2 天前
    17. 3.17 NemoClaw NemoClaw is NVIDIA's open source security stack for OpenClaw. It wraps OpenClaw with the NVIDIA OpenShell r... 2 天前
    18. 3.18 Oh My Pi Oh My Pi (OMP) is a terminal coding agent with IDE-style tools built in. It combines chat, project context,... 2 天前
    19. 3.19 Onyx Onyx is a self-hostable Chat UI that integrates with all Ollama models. Features include: Creating custom A... 2 天前
    20. 3.20 OpenClaw OpenClaw is a personal AI assistant that runs on your own devices. It bridges messaging services (WhatsApp,... 2 天前
    21. 3.21 OpenCode OpenCode is an open-source coding agent that runs in your terminal, reads your project, edits files, and ru... 2 天前
    22. 3.22 Pi Pi is a minimal and extensible coding agent. Quick setup ollama launch pi This installs Pi if needed, confi... 2 天前
    23. 3.23 Pool Pool is Poolside's software agent for the terminal, built for enterprise development workflows. Install Ins... 2 天前
    24. 3.24 Roo Code Install Roo Code from the VS Code Marketplace. Usage with Ollama Open Roo Code in VS Code and click the gea... 2 天前
    25. 3.25 VS Code Use Ollama models in VS Code Chat with the Ollama extension. Requirements Visual Studio Code 1.127 or newer... 2 天前
    26. 3.26 Xcode Install XCode Usage with Ollama Ensure Apple Intelligence is setup and the latest XCode version is v26.0 ... 2 天前
    27. 3.27 Zed Install Zed. Usage with Ollama In Zed, click the star icon in the bottom-right corner, then select Configur... 2 天前
  5. 47 API Note: Ollama's API docs are moving to https://docs.ollama.com/api Endpoints Generate a completion Generate ... 2 天前
  6. 第 4 章 Tools 1 页
    1. 4.1 extract-examples Extracts code examples from MDX files to a temp directory so you can run them. Usage go run docs/tools/extr... 2 天前
  7. 49 CLI Reference Run a model ollama run gemma4 Launch integrations ollama launch Configure and launch external applications ... 2 天前
  8. 50 Cloud Run models in Ollama's cloud from your apps or terminal. No model or app download required. API Key Create ... 2 天前
  9. 51 Context length Context length is the maximum number of tokens that the model has access to in memory. Ollama defaults to... 2 天前
  10. 52 Development Install prerequisites: Go CMake 3.24 or newer C/C++ compiler: Clang on macOS, Visual Studio 2022 C++ tools ... 2 天前
  11. 53 CPU only docker run -d -v ollama:/root/.ollama -p 11434:11434 --name ollama ollama/ollama Nvidia GPU Install the NVI... 2 天前
  12. 54 Examples This directory contains different examples of using Ollama. Python examples Ollama Python examples at ollam... 2 天前
  13. 55 FAQ Ollama on macOS and Windows will automatically download updates. Click on the taskbar or menubar item and t... 2 天前
  14. 56 Hardware support Ollama supports Nvidia GPUs with compute capability 5.0+ and driver version 550 and newer. Nvidia GPUs with... 2 天前
  15. 57 Importing a Model Importing a Safetensors model Importing a GGUF model Sharing models on ollama.com Importing a model from Sa... 2 天前
  16. 58 Ollama documentation Use open models in your desktop apps and coding agents, or build them into your application. Connect... 2 天前
  17. 59 Linux To install Ollama, run the following command: curl -fsSL https://ollama.com/install.sh | sh Manual install ... 2 天前
  18. 60 macOS MacOS Sonoma (v14) or newer Apple M series (CPU and GPU support) or x86 (CPU only) Filesystem Requirements ... 2 天前
  19. 61 Modelfile Reference A Modelfile is the blueprint to create and share customized models using Ollama. Table of Contents Format E... 2 天前
  20. 62 Quickstart Use Ollama in desktop apps and coding agents, or build an application with an API key. Get started Download... 2 天前
  21. 63 Template Ollama provides a powerful templating engine backed by Go's built-in templating engine to construct prompts... 2 天前
  22. 64 Troubleshooting Sometimes Ollama may not perform as expected. One of the best ways to figure out what happened is to take a... 2 天前
  23. 65 Windows Ollama runs as a native Windows application, including NVIDIA and AMD Radeon GPU support. After installing ... 2 天前