Sync ollama docs from eab97e9f on 2026-10-12

This commit is contained in:
The Librarian
2026-10-12 04:00:05 +00:00
parent f10d4bfbcc
commit a8b97b807a
26 changed files with 1820 additions and 782 deletions
+723 -15
View File
@@ -96,11 +96,7 @@ components:
type: boolean
default: true
think:
oneOf:
- type: boolean
- type: string
enum: [high, medium, low, max]
description: When true, returns separate thinking output in addition to content. Can be a boolean (true/false) or a string ("high", "medium", "low", "max") for supported models, with "max" requesting the highest thinking level.
$ref: "#/components/schemas/ThinkValue"
raw:
type: boolean
description: When true, returns the raw response from the model without any prompt templating
@@ -294,11 +290,7 @@ components:
type: boolean
default: true
think:
oneOf:
- type: boolean
- type: string
enum: [high, medium, low, max]
description: When true, returns separate thinking output in addition to content. Can be a boolean (true/false) or a string ("high", "medium", "low", "max") for supported models, with "max" requesting the highest thinking level.
$ref: "#/components/schemas/ThinkValue"
keep_alive:
oneOf:
- type: string
@@ -410,6 +402,29 @@ components:
done:
type: boolean
description: True for the final event in the stream
ThinkValue:
description: Controls a model's thinking output. Use `/api/show` to discover the supported values and default for the selected model. `true` requests thinking, `false` requests no thinking output, and `null` uses the model default. String values are model-defined; supported names must match `/api/show` exactly. Numbers are not supported.
oneOf:
- type: boolean
- type: string
- type: "null"
Thinking:
type: object
required: [values, default]
description: Thinking controls advertised by a model. Models without thinking metadata omit this field.
properties:
values:
type: array
description: Values explicitly supported by the model's `think` request field. Booleans represent on/off controls and strings represent model-defined levels. An array containing only `false` identifies a model without thinking support.
items:
oneOf:
- type: boolean
- type: string
default:
description: Value used when `think` is not set. For models that use this metadata for named thinking levels, unsupported names resolve to this default.
oneOf:
- type: boolean
- type: string
StatusEvent:
type: object
properties:
@@ -498,6 +513,16 @@ components:
parser:
type: string
description: Name of the parser for the model
files:
type: object
additionalProperties:
type: string
description: Source file names mapped to their SHA-256 digests. Split GGUF models must include each shard under its original split filename.
draft_files:
type: object
additionalProperties:
type: string
description: Draft source file names mapped to their SHA-256 digests
license:
oneOf:
- type: string
@@ -518,7 +543,18 @@ components:
$ref: "#/components/schemas/ChatMessage"
quantize:
type: string
description: Quantization level to apply (e.g. `q4_K_M`, `q8_0`)
description: Quantization level to apply during import (e.g. `nvfp4`)
draft_quantize:
type: string
description: Quantization level to apply to draft weights during import
requires:
type: string
description: Minimum Ollama version required by the model
capabilities:
type: array
items:
type: string
description: Capabilities to add without removing inherited or inferred capabilities (e.g. `decision` for compatible decision models)
stream:
type: boolean
default: true
@@ -581,6 +617,8 @@ components:
ShowResponse:
type: object
properties:
thinking:
$ref: "#/components/schemas/Thinking"
parameters:
type: string
description: Model parameter settings serialized as text
@@ -790,6 +828,324 @@ components:
items:
$ref: "#/components/schemas/TokenLogprob"
description: Most likely tokens and their log probabilities at this position
SystemOneContent:
description: A nonempty string, or an object or array serialized as JSON text. Not interpreted as chat messages or multimodal input.
oneOf:
- type: string
pattern: '\S'
- type: object
additionalProperties: true
- type: array
items: {}
SystemOneChoiceQuestion:
title: Choice
type: object
required: [type, instructions, criteria]
properties:
type:
type: string
enum: [choice]
instructions:
$ref: "#/components/schemas/SystemOneContent"
criteria:
type: object
description: Option keys mapped to descriptions, or null for a bare label. Keys must not be blank; ties follow the model's option order. The option limit depends on the model.
minProperties: 2
maxProperties: 255
propertyNames:
pattern: '\S'
additionalProperties:
type: [string, "null"]
SystemOneNoulQuestion:
title: Noul
type: object
required: [type, instructions]
properties:
type:
type: string
enum: [noul]
instructions:
$ref: "#/components/schemas/SystemOneContent"
criteria:
type: object
description: Optional descriptions for the two outcomes. Omitted entries use model-specific defaults.
properties:
"false":
type: string
default: "No"
"true":
type: string
default: "Yes"
additionalProperties: false
SystemOneScoreQuestion:
title: Score
type: object
required: [type, instructions, criteria]
properties:
type:
type: string
enum: [score]
instructions:
$ref: "#/components/schemas/SystemOneContent"
criteria:
type: array
description: Descriptions ordered from the lowest score (index 0) to the highest. Defines a scale from 0 to the number of criteria minus 1. The maximum number of levels depends on the model.
minItems: 2
maxItems: 26
items:
type: string
SystemOneRequest:
type: object
required: [model, state, questions]
properties:
model:
type: string
pattern: '\S'
description: Local model trained for System One, such as nimble. Requires compatible GGUF weights and a scoring-capable runner; cloud and MLX/Safetensors models are not supported.
state:
$ref: "#/components/schemas/SystemOneContent"
images:
type: array
description: Base64-encoded images shared by all questions, in request order. Requires Clef or Clef Flash with vision weights. URLs and data URLs are not supported.
items:
type: string
format: byte
questions:
type: object
description: Named questions about the shared state. Answers are not passed to later questions.
minProperties: 1
maxProperties: 64
propertyNames:
pattern: '\S'
additionalProperties:
oneOf:
- $ref: "#/components/schemas/SystemOneChoiceQuestion"
- $ref: "#/components/schemas/SystemOneNoulQuestion"
- $ref: "#/components/schemas/SystemOneScoreQuestion"
keep_alive:
oneOf:
- type: string
- type: number
description: How long to keep the model loaded after the request, as a duration string (such as 5m) or seconds. Zero unloads after the request; a negative value keeps it loaded. Defaults to the server's keep-alive setting (5m unless configured otherwise).
SystemOneProbabilities:
type: object
description: Probabilities normalized over the supplied candidates, summing to 1 subject to floating-point precision.
additionalProperties:
type: number
minimum: 0
maximum: 1
SystemOneConfidence:
type: number
minimum: 0
maximum: 1
description: Distribution concentration, calculated as 1 - H(p) / ln(N), where H(p) is entropy and N is the candidate count. Zero means uniform probabilities; values near 1 mean one candidate dominates. Not calibrated correctness.
SystemOneChoiceAnswer:
title: Choice
type: object
required: [type, choice, probabilities, confidence]
properties:
type:
type: string
enum: [choice]
choice:
type: string
description: Option key with the highest probability. Ties follow the model's option order.
probabilities:
$ref: "#/components/schemas/SystemOneProbabilities"
confidence:
$ref: "#/components/schemas/SystemOneConfidence"
SystemOneNoulAnswer:
title: Noul
type: object
required: [type, noul]
properties:
type:
type: string
enum: [noul]
noul:
type: number
minimum: 0
maximum: 1
description: Probability of true among the false and true candidates. This is a number, not a Boolean.
SystemOneScoreAnswer:
title: Score
type: object
required: [type, score, legend, probabilities, confidence]
properties:
type:
type: string
enum: [score]
score:
type: number
minimum: 0
maximum: 25
description: Probability-weighted average of the zero-based criterion indices, from 0 to the number of criteria minus 1. Not rounded to a level or normalized to 0–1.
legend:
type: object
description: Zero-based indices as string keys mapped to the criterion descriptions.
additionalProperties:
type: string
probabilities:
$ref: "#/components/schemas/SystemOneProbabilities"
description: Probabilities keyed by zero-based criterion indices as strings.
confidence:
$ref: "#/components/schemas/SystemOneConfidence"
SystemOneResponse:
type: object
required: [model, answers, usage]
properties:
model:
type: string
description: Model name from the request.
answers:
type: object
description: Answers keyed by the question names in the request.
additionalProperties:
oneOf:
- $ref: "#/components/schemas/SystemOneChoiceAnswer"
- $ref: "#/components/schemas/SystemOneNoulAnswer"
- $ref: "#/components/schemas/SystemOneScoreAnswer"
usage:
type: object
required: [input_tokens, output_tokens]
properties:
input_tokens:
type: integer
minimum: 0
description: Total evaluated input tokens, including image positions. Shared context is counted again when the model scores questions separately.
output_tokens:
type: integer
minimum: 0
description: Tokens generated internally for scoring, including prefix preparation and retries. May exceed the question count; not the length of the JSON response.
UsageMetrics:
type: object
required: [request_count]
properties:
request_count:
type: integer
minimum: 0
description: Number of recorded requests.
usage_usd:
type: number
description: Total value of the requests in USD, including usage covered by your plan and usage paid from purchased credits.
input_tokens:
type: integer
description: Recorded input tokens, including cached input tokens.
cached_input_tokens:
type: integer
description: Recorded input tokens read from cache, already included in input_tokens.
output_tokens:
type: integer
description: Recorded output tokens.
UsageBucket:
allOf:
- $ref: "#/components/schemas/UsageMetrics"
- type: object
required: [from, until]
properties:
from:
type: string
format: date-time
description: Start of the bucket in UTC, inclusive.
until:
type: string
format: date-time
description: End of the bucket in UTC, exclusive.
partial:
type: boolean
description: Present and true for the current hour or day, which is still in progress.
UsageResponse:
type: object
required: [range, scope, granularity, from, until, totals, buckets]
properties:
range:
type: string
enum: [24h, 7d, 30d]
description: Selected time range.
scope:
type: string
enum: [self, team]
description: Selected usage scope.
granularity:
type: string
enum: [hour, day]
description: "Set automatically: hour for 24h, day for 7d and 30d."
from:
type: string
format: date-time
description: Start of the range in UTC, inclusive.
until:
type: string
format: date-time
description: End of the range in UTC, exclusive.
totals:
$ref: "#/components/schemas/UsageMetrics"
description: Usage across the entire range.
buckets:
type: array
description: Usage in chronological order, including buckets with no recorded requests.
items:
$ref: "#/components/schemas/UsageBucket"
IncludedBalance:
title: Included credits
type: object
required: [balance_usd, allowance_usd, period]
properties:
balance_usd:
type: number
description: Remaining included credits in USD.
allowance_usd:
type: number
description: Included credits available for the full period in USD.
period:
type: object
required: [from, until]
properties:
from:
type: string
format: date-time
description: Start of the included period in UTC, inclusive.
until:
type: string
format: date-time
description: End of the included period in UTC, exclusive.
LegacyBalanceLimit:
type: object
required: [remaining_percent, resets_at]
properties:
remaining_percent:
type: number
minimum: 0
maximum: 100
description: Percentage of the limit remaining.
resets_at:
type: string
format: date-time
description: Next reset time in UTC.
LegacyIncludedBalance:
title: Legacy plan limits
type: object
required: [session, weekly]
properties:
session:
$ref: "#/components/schemas/LegacyBalanceLimit"
weekly:
$ref: "#/components/schemas/LegacyBalanceLimit"
BalanceResponse:
type: object
required: [included, purchased]
properties:
included:
oneOf:
- $ref: "#/components/schemas/IncludedBalance"
- $ref: "#/components/schemas/LegacyIncludedBalance"
purchased:
type: object
required: [balance_usd]
properties:
balance_usd:
type: number
description: Remaining unexpired purchased credits in USD.
ErrorResponse:
type: object
properties:
@@ -797,12 +1153,117 @@ components:
type: string
description: Error message describing what went wrong
paths:
/v1/systemone:
post:
summary: Answer typed questions
description: |
Answer choice, yes/no, and scoring questions with a local System One model. Requires Ollama v0.35.0 or later. See the [decision guide](/capabilities/decision) for examples.
operationId: systemone
x-mint:
href: /api/systemone
metadata:
title: System One
sidebarTitle: /v1/systemone
content: |
<Note>
Currently available locally in Ollama.
</Note>
- Returns one JSON response; streaming, video, tools, and generation controls are not supported.
- Requests without images must fit within 64 KiB; requests with images must fit within 32 MiB, including base64 and JSON. The complete input must fit the loaded context window. Nimble and Tev also require two token positions for scoring. Input is never truncated.
x-codeSamples:
- lang: bash
label: Choose a label
source: |
curl http://localhost:11434/v1/systemone \
-H 'Content-Type: application/json' \
-d '{
"model": "nimble",
"state": "Our checkout has returned 500 errors since 9am.",
"questions": {
"label": {
"type": "choice",
"instructions": "Which label fits this ticket?",
"criteria": {
"billing": "Payments and refunds",
"bug": "Software errors",
"account": "Login and account access"
}
}
}
}'
requestBody:
required: true
content:
application/json:
schema:
$ref: "#/components/schemas/SystemOneRequest"
example:
model: nimble
state: Our checkout has returned 500 errors since 9am.
questions:
label:
type: choice
instructions: Which label fits this ticket?
criteria:
billing: Payments and refunds
bug: Software errors
account: Login and account access
responses:
"200":
description: Answers and token usage for all questions. Example probabilities and confidence are rounded to four decimal places; results and usage can vary with the model and server configuration.
content:
application/json:
schema:
$ref: "#/components/schemas/SystemOneResponse"
example:
model: nimble
answers:
label:
type: choice
choice: bug
probabilities:
billing: 0.0125
bug: 0.9781
account: 0.0093
confidence: 0.8906
usage:
input_tokens: 174
output_tokens: 1
"400":
description: Invalid request, unsupported model or runner, or a rendered prompt that exceeds the loaded context. Cloud models are rejected.
content:
application/json:
schema:
$ref: "#/components/schemas/ErrorResponse"
"404":
description: Local model not found. Download the model before making a request.
content:
application/json:
schema:
$ref: "#/components/schemas/ErrorResponse"
"413":
description: Request body exceeds 64 KiB without images or 32 MiB with images.
content:
application/json:
schema:
$ref: "#/components/schemas/ErrorResponse"
example:
error: request body must not exceed 64 KiB without images
"500":
description: Model loading, rendering, or scoring failed.
content:
application/json:
schema:
$ref: "#/components/schemas/ErrorResponse"
/api/generate:
post:
summary: Generate a response
description: Generates a response for the provided prompt
operationId: generate
x-mint:
metadata:
sidebarTitle: /api/generate
href: /api/generate
x-codeSamples:
- lang: bash
@@ -820,6 +1281,15 @@ paths:
"prompt": "Why is the sky blue?",
"stream": false
}'
- lang: bash
label: Thinking
source: |
curl http://localhost:11434/api/generate -d '{
"model": "gpt-oss",
"prompt": "What is 1+1?",
"think": "low",
"stream": false
}'
- lang: bash
label: With options
source: |
@@ -915,6 +1385,8 @@ paths:
description: Generate the next chat message in a conversation between a user and an assistant.
operationId: chat
x-mint:
metadata:
sidebarTitle: /api/chat
href: /api/chat
x-codeSamples:
- lang: bash
@@ -1073,6 +1545,8 @@ paths:
description: Creates vector embeddings representing the input text
operationId: embed
x-mint:
metadata:
sidebarTitle: /api/embed
href: /api/embed
x-codeSamples:
- lang: bash
@@ -1148,6 +1622,8 @@ paths:
description: Fetch a list of models and their details
operationId: list
x-mint:
metadata:
sidebarTitle: /api/tags
href: /api/tags
x-codeSamples:
- lang: bash
@@ -1181,6 +1657,8 @@ paths:
description: Retrieve a list of models that are currently running
operationId: ps
x-mint:
metadata:
sidebarTitle: /api/ps
href: /api/ps
x-codeSamples:
- lang: bash
@@ -1215,6 +1693,9 @@ paths:
post:
summary: Show model details
operationId: show
x-mint:
metadata:
sidebarTitle: /api/show
x-codeSamples:
- lang: bash
label: Default
@@ -1229,6 +1710,18 @@ paths:
"model": "gemma4",
"verbose": true
}'
- lang: bash
label: Thinking controls
source: |
curl http://localhost:11434/api/show -d '{
"model": "gpt-oss"
}'
- lang: bash
label: Thinking controls
source: |
curl http://localhost:11434/api/show -d '{
"model": "gpt-oss"
}'
requestBody:
required: true
content:
@@ -1249,7 +1742,13 @@ paths:
license: "Gemma Terms of Use \n\nLast modified: February 21, 2024..."
capabilities:
- "completion"
- "thinking"
- "vision"
thinking:
values:
- false
- true
default: true
modified_at: "2025-08-14T15:49:43.634137516-07:00"
details:
parent_model: ""
@@ -1321,6 +1820,8 @@ paths:
summary: Create a model
operationId: create
x-mint:
metadata:
sidebarTitle: /api/create
href: /api/create
x-codeSamples:
- lang: bash
@@ -1340,12 +1841,13 @@ paths:
"system": "You are Ollama the llama."
}'
- lang: bash
label: Quantize
label: Create from GGUF
source: |
curl http://localhost:11434/api/create -d '{
"model": "llama3.1:8b-instruct-Q4_K_M",
"from": "llama3.1:8b-instruct-fp16",
"quantize": "q4_K_M"
"model": "my-gguf-model",
"files": {
"model.gguf": "sha256:432f310a77f4650a88d0fd59ecdd7cebed8d684bafea53cbff0473542964f0c3"
}
}'
requestBody:
required: true
@@ -1371,11 +1873,69 @@ paths:
$ref: "#/components/schemas/StatusEvent"
example:
status: "success"
/api/blobs/{digest}:
head:
summary: Check if a blob exists
operationId: headBlob
parameters:
- $ref: "#/components/parameters/DigestParam"
responses:
"200":
description: Blob exists
"400":
description: Invalid digest
content:
application/json:
schema:
$ref: "#/components/schemas/ErrorResponse"
"404":
description: Blob not found
content:
application/json:
schema:
$ref: "#/components/schemas/ErrorResponse"
"500":
description: Failed to inspect blob
content:
application/json:
schema:
$ref: "#/components/schemas/ErrorResponse"
post:
summary: Push a blob
operationId: createBlob
parameters:
- $ref: "#/components/parameters/DigestParam"
requestBody:
required: true
content:
application/octet-stream:
schema:
type: string
format: binary
responses:
"200":
description: Blob already exists
"201":
description: Blob created
"400":
description: Invalid digest or blob content
content:
application/json:
schema:
$ref: "#/components/schemas/ErrorResponse"
"500":
description: Failed to write blob
content:
application/json:
schema:
$ref: "#/components/schemas/ErrorResponse"
/api/copy:
post:
summary: Copy a model
operationId: copy
x-mint:
metadata:
sidebarTitle: /api/copy
href: /api/copy
x-codeSamples:
- lang: bash
@@ -1397,11 +1957,31 @@ paths:
responses:
"200":
description: Model successfully copied
content:
application/json:
schema:
$ref: "#/components/schemas/StatusResponse"
example:
status: "success"
"400":
description: Model could not be copied
content:
application/json:
schema:
$ref: "#/components/schemas/ErrorResponse"
"404":
description: Source model not found
content:
application/json:
schema:
$ref: "#/components/schemas/ErrorResponse"
/api/pull:
post:
summary: Pull a model
operationId: pull
x-mint:
metadata:
sidebarTitle: /api/pull
href: /api/pull
x-codeSamples:
- lang: bash
@@ -1444,6 +2024,8 @@ paths:
summary: Push a model
operationId: push
x-mint:
metadata:
sidebarTitle: /api/push
href: /api/push
x-codeSamples:
- lang: bash
@@ -1486,6 +2068,8 @@ paths:
summary: Delete a model
operationId: delete
x-mint:
metadata:
sidebarTitle: /api/delete
href: /api/delete
x-codeSamples:
- lang: bash
@@ -1510,6 +2094,9 @@ paths:
summary: Get version
description: Retrieve the version of the Ollama
operationId: version
x-mint:
metadata:
sidebarTitle: /api/version
x-codeSamples:
- lang: bash
label: Default
@@ -1524,3 +2111,124 @@ paths:
$ref: "#/components/schemas/VersionResponse"
example:
version: "0.12.6"
/api/usage:
get:
summary: Cloud usage
description: Usage statistics for cloud inference, web search, and web fetch.
operationId: usage
servers:
- url: https://ollama.com
description: Ollama Cloud
security:
- bearerAuth: []
parameters:
- name: range
in: query
description: Completed UTC hours or days to include, plus the current partial hour or day.
schema:
type: string
enum: [24h, 7d, 30d]
default: 7d
- name: scope
in: query
description: Your requests, or your team's requests. Team scope requires being a team admin.
schema:
type: string
enum: [self, team]
default: self
responses:
"200":
description: Usage for the selected range and scope.
content:
application/json:
schema:
$ref: "#/components/schemas/UsageResponse"
"400":
description: Invalid query parameters.
content:
application/json:
schema:
$ref: "#/components/schemas/ErrorResponse"
"401":
description: Invalid credentials.
content:
application/json:
schema:
$ref: "#/components/schemas/ErrorResponse"
"403":
description: Account suspended or team scope requested without team admin access.
content:
application/json:
schema:
$ref: "#/components/schemas/ErrorResponse"
"429":
description: Too many requests.
content:
application/json:
schema:
$ref: "#/components/schemas/ErrorResponse"
headers:
Retry-After:
description: Seconds to wait before retrying.
schema:
type: integer
minimum: 1
"503":
description: Usage reporting is temporarily unavailable.
content:
application/json:
schema:
$ref: "#/components/schemas/ErrorResponse"
/api/balance:
get:
summary: Balance
description: Check your remaining usage credits.
operationId: balance
servers:
- url: https://ollama.com
description: Ollama Cloud
security:
- bearerAuth: []
responses:
"200":
description: Current included and purchased balances.
content:
application/json:
schema:
$ref: "#/components/schemas/BalanceResponse"
"400":
description: Invalid query parameters.
content:
application/json:
schema:
$ref: "#/components/schemas/ErrorResponse"
"401":
description: Invalid credentials.
content:
application/json:
schema:
$ref: "#/components/schemas/ErrorResponse"
"403":
description: Account suspended.
content:
application/json:
schema:
$ref: "#/components/schemas/ErrorResponse"
"429":
description: Too many requests.
content:
application/json:
schema:
$ref: "#/components/schemas/ErrorResponse"
headers:
Retry-After:
description: Seconds to wait before retrying.
schema:
type: integer
minimum: 1
"503":
description: Balance reporting is temporarily unavailable.
content:
application/json:
schema:
$ref: "#/components/schemas/ErrorResponse"