Ollama 官方中文文档
  1. 创建模型
Ollama 官方中文文档
  • 接口 Endpoints
  • 规范 Conventions
  • 生成补全
    • 概括
    • 流式生成请求(Streaming)
      POST
    • 非流式生成请求(No Streaming)
      POST
    • 带后缀的生成请求(with Suffix)
      POST
    • 结构化输出请求(Structured Outputs)
      POST
    • JSON 模式请求(JSON Mode)
      POST
    • 带图像的生成请求(with Images)
      POST
    • 原始模式请求(Raw Mode)
      POST
    • 可复现输出请求(Reproducible Outputs)
      POST
    • 参数化生成请求(with Options)
      POST
    • 加载模型
      POST
    • 卸载模型
      POST
  • 生成对话补全
    • 概括
    • 流式对话请求(Streaming)
      POST
    • 非流式对话请求(No Streaming)
      POST
    • 结构化输出对话请求(Structured Outputs)
      POST
    • 带历史上下文的对话请求(With History)
      POST
    • 带图像的对话请求(with Images)
      POST
    • 可复现输出的对话请求(Reproducible Outputs)
      POST
    • 支持工具调用的对话请求(with Tools)
      POST
    • 加载模型
      POST
    • 卸载模型
      POST
  • 创建模型
    • 概括
    • 创建新模型
      POST
    • 量化模型
      POST
    • 从 GGUF 文件创建模型
      POST
    • 从 Safetensors 目录创建模型
      POST
  • 检查 Blob 是否存在
    • 概括
  • 推送 Blob
    • 概括
  • 列出本地模型
    • 概括
    • 示例
  • 显示模型详情
    • 概括
    • 示例
  • 复制模型
    • 概括
    • 示例
  • 删除模型
    • 概括
    • 示例
  • 拉取模型
    • 概括
    • 示例
  • 推送模型
    • 概括
  • 生成嵌入向量
    • 概括
    • 示例
    • 多输入请求(Multiple Input)
  • 列出运行中模型
    • 概括
    • 示例
  • 生成单个嵌入向量
    • 概括
    • 示例
  • 版本信息
    • 概括
  1. 创建模型

创建新模型

POST
http://localhost:11434/api/create
Create a new model from an existing model.
请求示例请求示例
Shell
JavaScript
Java
Swift
curl --location --request POST 'http://localhost:11434/api/create' \
--header 'Content-Type: application/json' \
--data-raw '{
    "model": "mario",
    "from": "llama3.2",
    "system": "You are Mario from Super Mario Bros."
}'
响应示例响应示例
{"status":"reading model metadata"}
{"status":"creating system layer"}
{"status":"using already created layer sha256:22f7f8ef5f4c791c1b03d7eb414399294764d7cc82c7e94aa81a1feb80a983a2"}
{"status":"using already created layer sha256:8c17c2ebb0ea011be9981cc3922db8ca8fa61e828c5d3f44cb6ae342bf80460b"}
{"status":"using already created layer sha256:7c23fb36d80141c4ab8cdbb61ee4790102ebd2bf7aeff414453177d4f2110e5d"}
{"status":"using already created layer sha256:2e0493f67d0c8c9c68a8aeacdf6a38a2151cb3c4c1d42accf296e19810527988"}
{"status":"using already created layer sha256:2759286baa875dc22de5394b4a925701b1896a7e3f8e53275c36f75a877a82c9"}
{"status":"writing layer sha256:df30045fe90f0d750db82a058109cecd6d4de9c90a3d75b19c09e5f64580bb42"}
{"status":"writing layer sha256:f18a68eb09bf925bb1b669490407c1b1251c5db98dc4d3d81f3088498ea55690"}
{"status":"writing manifest"}
{"status":"success"}

请求参数

Body 参数application/json
model
enum<string> 
必需
枚举值:
mario
示例值:
mario
from
enum<string> 
必需
枚举值:
llama3.2
示例值:
llama3.2
system
enum<string> 
必需
枚举值:
You are Mario from Super Mario Bros.
示例值:
You are Mario from Super Mario Bros.
示例

返回响应

🟢200Success
application/json
A stream of JSON objects is returned:
Body
status
string 
必需
修改于 2025-03-27 09:17:50
上一页
概括
下一页
量化模型
Built with