# Ollama 官方中文文档 ## Docs - [接口 Endpoints](https://ollama-docs.apifox.cn/%E6%8E%A5%E5%8F%A3-endpoints-6247235m0.md): - [规范 Conventions](https://ollama-docs.apifox.cn/%E8%A7%84%E8%8C%83-conventions-6247236m0.md): - 生成补全 [概括](https://ollama-docs.apifox.cn/%E6%A6%82%E6%8B%AC-6247237m0.md): - 生成对话补全 [概括](https://ollama-docs.apifox.cn/%E6%A6%82%E6%8B%AC-6247238m0.md): - 创建模型 [概括](https://ollama-docs.apifox.cn/%E6%A6%82%E6%8B%AC-6247239m0.md): - 检查 Blob 是否存在 [概括](https://ollama-docs.apifox.cn/%E6%A6%82%E6%8B%AC-6247240m0.md): - 推送 Blob [概括](https://ollama-docs.apifox.cn/%E6%A6%82%E6%8B%AC-6247241m0.md): - 列出本地模型 [概括](https://ollama-docs.apifox.cn/%E6%A6%82%E6%8B%AC-6247242m0.md): - 显示模型详情 [概括](https://ollama-docs.apifox.cn/%E6%A6%82%E6%8B%AC-6247243m0.md): - 复制模型 [概括](https://ollama-docs.apifox.cn/%E6%A6%82%E6%8B%AC-6247244m0.md): - 删除模型 [概括](https://ollama-docs.apifox.cn/%E6%A6%82%E6%8B%AC-6247245m0.md): - 拉取模型 [概括](https://ollama-docs.apifox.cn/%E6%A6%82%E6%8B%AC-6247246m0.md): - 推送模型 [概括](https://ollama-docs.apifox.cn/%E6%A6%82%E6%8B%AC-6247247m0.md): - 生成嵌入向量 [概括](https://ollama-docs.apifox.cn/%E6%A6%82%E6%8B%AC-6247248m0.md): - 列出运行中模型 [概括](https://ollama-docs.apifox.cn/%E6%A6%82%E6%8B%AC-6247249m0.md): - 生成单个嵌入向量 [概括](https://ollama-docs.apifox.cn/%E6%A6%82%E6%8B%AC-6247250m0.md): - 版本信息 [概括](https://ollama-docs.apifox.cn/%E6%A6%82%E6%8B%AC-6247251m0.md): ## API Docs - 生成补全 [流式生成请求(Streaming)](https://ollama-docs.apifox.cn/%E6%B5%81%E5%BC%8F%E7%94%9F%E6%88%90%E8%AF%B7%E6%B1%82streaming-272428812e0.md): - 生成补全 [非流式生成请求(No Streaming)](https://ollama-docs.apifox.cn/%E9%9D%9E%E6%B5%81%E5%BC%8F%E7%94%9F%E6%88%90%E8%AF%B7%E6%B1%82no-streaming-272428813e0.md): A response can be received in one reply when streaming is off. - 生成补全 [带后缀的生成请求(with Suffix)](https://ollama-docs.apifox.cn/%E5%B8%A6%E5%90%8E%E7%BC%80%E7%9A%84%E7%94%9F%E6%88%90%E8%AF%B7%E6%B1%82with-suffix-272428814e0.md): - 生成补全 [结构化输出请求(Structured Outputs)](https://ollama-docs.apifox.cn/%E7%BB%93%E6%9E%84%E5%8C%96%E8%BE%93%E5%87%BA%E8%AF%B7%E6%B1%82structured-outputs-272428815e0.md): - 生成补全 [JSON 模式请求(JSON Mode)](https://ollama-docs.apifox.cn/json-%E6%A8%A1%E5%BC%8F%E8%AF%B7%E6%B1%82json-mode-272428816e0.md): Important - 生成补全 [带图像的生成请求(with Images)](https://ollama-docs.apifox.cn/%E5%B8%A6%E5%9B%BE%E5%83%8F%E7%9A%84%E7%94%9F%E6%88%90%E8%AF%B7%E6%B1%82with-images-272428817e0.md): To submit images to multimodal models such as `llava` or `bakllava`, provide a list of base64-encoded `images`: - 生成补全 [原始模式请求(Raw Mode)](https://ollama-docs.apifox.cn/%E5%8E%9F%E5%A7%8B%E6%A8%A1%E5%BC%8F%E8%AF%B7%E6%B1%82raw-mode-272428818e0.md): In some cases, you may wish to bypass the templating system and provide a full prompt. In this case, you can use the `raw` parameter to disable templating. Also note that raw mode will not return a context. - 生成补全 [可复现输出请求(Reproducible Outputs)](https://ollama-docs.apifox.cn/%E5%8F%AF%E5%A4%8D%E7%8E%B0%E8%BE%93%E5%87%BA%E8%AF%B7%E6%B1%82reproducible-outputs-272428819e0.md): For reproducible outputs, set `seed` to a number: - 生成补全 [参数化生成请求(with Options)](https://ollama-docs.apifox.cn/%E5%8F%82%E6%95%B0%E5%8C%96%E7%94%9F%E6%88%90%E8%AF%B7%E6%B1%82with-options-272428820e0.md): If you want to set custom options for the model at runtime rather than in the Modelfile, you can do so with the `options` parameter. This example sets every available option, but you can set any of them individually and omit the ones you do not want to override. - 生成补全 [加载模型](https://ollama-docs.apifox.cn/%E5%8A%A0%E8%BD%BD%E6%A8%A1%E5%9E%8B-272428821e0.md): If an empty prompt is provided, the model will be loaded into memory. - 生成补全 [卸载模型](https://ollama-docs.apifox.cn/%E5%8D%B8%E8%BD%BD%E6%A8%A1%E5%9E%8B-272428822e0.md): If an empty prompt is provided and the `keep_alive` parameter is set to `0`, a model will be unloaded from memory. - 生成对话补全 [流式对话请求(Streaming)](https://ollama-docs.apifox.cn/%E6%B5%81%E5%BC%8F%E5%AF%B9%E8%AF%9D%E8%AF%B7%E6%B1%82streaming-272428823e0.md): Send a chat message with a streaming response. - 生成对话补全 [非流式对话请求(No Streaming)](https://ollama-docs.apifox.cn/%E9%9D%9E%E6%B5%81%E5%BC%8F%E5%AF%B9%E8%AF%9D%E8%AF%B7%E6%B1%82no-streaming-272428824e0.md): - 生成对话补全 [结构化输出对话请求(Structured Outputs)](https://ollama-docs.apifox.cn/%E7%BB%93%E6%9E%84%E5%8C%96%E8%BE%93%E5%87%BA%E5%AF%B9%E8%AF%9D%E8%AF%B7%E6%B1%82structured-outputs-272428825e0.md): - 生成对话补全 [带历史上下文的对话请求(With History)](https://ollama-docs.apifox.cn/%E5%B8%A6%E5%8E%86%E5%8F%B2%E4%B8%8A%E4%B8%8B%E6%96%87%E7%9A%84%E5%AF%B9%E8%AF%9D%E8%AF%B7%E6%B1%82with-history-272428826e0.md): Send a chat message with a conversation history. You can use this same approach to start the conversation using multi-shot or chain-of-thought prompting. - 生成对话补全 [带图像的对话请求(with Images)](https://ollama-docs.apifox.cn/%E5%B8%A6%E5%9B%BE%E5%83%8F%E7%9A%84%E5%AF%B9%E8%AF%9D%E8%AF%B7%E6%B1%82with-images-272428827e0.md): Send a chat message with images. The images should be provided as an array, with the individual images encoded in Base64. - 生成对话补全 [可复现输出的对话请求(Reproducible Outputs)](https://ollama-docs.apifox.cn/%E5%8F%AF%E5%A4%8D%E7%8E%B0%E8%BE%93%E5%87%BA%E7%9A%84%E5%AF%B9%E8%AF%9D%E8%AF%B7%E6%B1%82reproducible-outputs-272428828e0.md): - 生成对话补全 [支持工具调用的对话请求(with Tools)](https://ollama-docs.apifox.cn/%E6%94%AF%E6%8C%81%E5%B7%A5%E5%85%B7%E8%B0%83%E7%94%A8%E7%9A%84%E5%AF%B9%E8%AF%9D%E8%AF%B7%E6%B1%82with-tools-272428829e0.md): - 生成对话补全 [加载模型](https://ollama-docs.apifox.cn/%E5%8A%A0%E8%BD%BD%E6%A8%A1%E5%9E%8B-272428830e0.md): If the messages array is empty, the model will be loaded into memory. - 生成对话补全 [卸载模型](https://ollama-docs.apifox.cn/%E5%8D%B8%E8%BD%BD%E6%A8%A1%E5%9E%8B-272428831e0.md): If the messages array is empty and the `keep_alive` parameter is set to `0`, a model will be unloaded from memory. - 创建模型 [创建新模型](https://ollama-docs.apifox.cn/%E5%88%9B%E5%BB%BA%E6%96%B0%E6%A8%A1%E5%9E%8B-272428832e0.md): Create a new model from an existing model. - 创建模型 [量化模型](https://ollama-docs.apifox.cn/%E9%87%8F%E5%8C%96%E6%A8%A1%E5%9E%8B-272428833e0.md): Quantize a non-quantized model. - 创建模型 [从 GGUF 文件创建模型](https://ollama-docs.apifox.cn/%E4%BB%8E-gguf-%E6%96%87%E4%BB%B6%E5%88%9B%E5%BB%BA%E6%A8%A1%E5%9E%8B-272428834e0.md): Create a model from a GGUF file. The `files` parameter should be filled out with the file name and SHA256 digest of the GGUF file you wish to use. Use [/api/blobs/:digest](https://github.com/ollama/ollama/blob/main/docs/api.md#push-a-blob) to push the GGUF file to the server before calling this API. - 创建模型 [从 Safetensors 目录创建模型](https://ollama-docs.apifox.cn/%E4%BB%8E-safetensors-%E7%9B%AE%E5%BD%95%E5%88%9B%E5%BB%BA%E6%A8%A1%E5%9E%8B-272428835e0.md): The `files` parameter should include a dictionary of files for the safetensors model which includes the file names and SHA256 digest of each file. Use [/api/blobs/:digest](https://github.com/ollama/ollama/blob/main/docs/api.md#push-a-blob) to first push each of the files to the server before calling this API. Files will remain in the cache until the Ollama server is restarted. - 列出本地模型 [示例](https://ollama-docs.apifox.cn/%E7%A4%BA%E4%BE%8B-272428836e0.md): - 显示模型详情 [示例](https://ollama-docs.apifox.cn/%E7%A4%BA%E4%BE%8B-272428837e0.md): - 复制模型 [示例](https://ollama-docs.apifox.cn/%E7%A4%BA%E4%BE%8B-272428838e0.md): - 删除模型 [示例](https://ollama-docs.apifox.cn/%E7%A4%BA%E4%BE%8B-272428839e0.md): - 拉取模型 [示例](https://ollama-docs.apifox.cn/%E7%A4%BA%E4%BE%8B-272428840e0.md): - 生成嵌入向量 [示例](https://ollama-docs.apifox.cn/%E7%A4%BA%E4%BE%8B-272428841e0.md): - 生成嵌入向量 [多输入请求(Multiple Input)](https://ollama-docs.apifox.cn/%E5%A4%9A%E8%BE%93%E5%85%A5%E8%AF%B7%E6%B1%82multiple-input-272428842e0.md): - 列出运行中模型 [示例](https://ollama-docs.apifox.cn/%E7%A4%BA%E4%BE%8B-272428843e0.md): - 生成单个嵌入向量 [示例](https://ollama-docs.apifox.cn/%E7%A4%BA%E4%BE%8B-272428844e0.md):