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
+48 -49
View File
@@ -378,6 +378,8 @@ curl http://localhost:11434/api/generate -d '{
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.
`typical_p` is deprecated and may be removed in a future release.
##### Request
```shell
@@ -393,7 +395,6 @@ curl http://localhost:11434/api/generate -d '{
"top_k": 20,
"top_p": 0.9,
"min_p": 0.0,
"typical_p": 0.7,
"repeat_last_n": 33,
"temperature": 0.8,
"repeat_penalty": 1.2,
@@ -1178,16 +1179,17 @@ Create a model from:
- another model;
- a safetensors directory; or
- a GGUF file.
- one or more GGUF files.
If you are creating a model from a safetensors directory or from a GGUF file, you must [push a blob](#push-a-blob) for each of the files and then use the file name and SHA256 digest associated with each blob in the `files` field.
Use GGUF community tools to prepare and quantize GGUF files before importing.
If you are creating a model from a safetensors directory or from GGUF files, you must [push a blob](#push-a-blob) for each file and then use its file name and SHA256 digest in the `files` field.
### Parameters
- `model`: name of the model to create
- `from`: (optional) name of an existing model to create the new model from
- `files`: (optional) a dictionary of file names to SHA256 digests of blobs to create the model from
- `adapters`: (optional) a dictionary of file names to SHA256 digests of blobs for LORA adapters
- `template`: (optional) the prompt template for the model
- `renderer`: (optional) the name of the renderer for the model
- `parser`: (optional) the name of the parser for the model
@@ -1195,16 +1197,19 @@ If you are creating a model from a safetensors directory or from a GGUF file, yo
- `system`: (optional) a string containing the system prompt for the model
- `parameters`: (optional) a dictionary of parameters for the model (see [Modelfile](./modelfile.mdx#valid-parameters-and-values) for a list of parameters)
- `messages`: (optional) a list of message objects used to create a conversation
- `capabilities`: (optional) capabilities to add without removing inherited or inferred capabilities, such as `["decision"]` for compatible decision models
- `stream`: (optional) if `false` the response will be returned as a single response object, rather than a stream of objects
- `quantize` (optional): quantize a non-quantized (e.g. float16) model
- `quantize`: (optional) quantize safetensors model weights for MLX during import
#### Quantization types
| Type | Recommended |
| ------ | :---------: |
| q4_K_M | \* |
| q4_K_S | |
| q8_0 | \* |
| Type | Recommended |
| ----- | :---------: |
| nvfp4 | \* |
| mxfp8 | \* |
| mxfp4 | |
| int4 | |
| int8 | |
### Examples
@@ -1240,40 +1245,9 @@ A stream of JSON objects is returned:
{"status":"success"}
```
#### Quantize a model
Quantize a non-quantized model.
##### Request
```shell
curl http://localhost:11434/api/create -d '{
"model": "llama3.2:quantized",
"from": "llama3.2:3b-instruct-fp16",
"quantize": "q4_K_M"
}'
```
##### Response
A stream of JSON objects is returned:
```json
{"status":"quantizing F16 model to Q4_K_M","digest":"0","total":6433687776,"completed":12302}
{"status":"quantizing F16 model to Q4_K_M","digest":"0","total":6433687776,"completed":6433687552}
{"status":"verifying conversion"}
{"status":"creating new layer sha256:fb7f4f211b89c6c4928ff4ddb73db9f9c0cfca3e000c3e40d6cf27ddc6ca72eb"}
{"status":"using existing layer sha256:966de95ca8a62200913e3f8bfbf84c8494536f1b94b49166851e76644e966396"}
{"status":"using existing layer sha256:fcc5a6bec9daf9b561a68827b67ab6088e1dba9d1fa2a50d7bbcc8384e0a265d"}
{"status":"using existing layer sha256:a70ff7e570d97baaf4e62ac6e6ad9975e04caa6d900d3742d37698494479e0cd"}
{"status":"using existing layer sha256:56bb8bd477a519ffa694fc449c2413c6f0e1d3b1c88fa7e3c9d88d3ae49d4dcb"}
{"status":"writing manifest"}
{"status":"success"}
```
#### Create a model from GGUF
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](#push-a-blob) to push the GGUF file to the server before calling this API.
Create a model from GGUF files. The `files` parameter should contain the file name and SHA256 digest of each GGUF file. For a split GGUF model, include each shard under its original split filename. Use [/api/blobs/:digest](#push-a-blob) to push each file before calling this API.
##### Request
@@ -1299,7 +1273,7 @@ A stream of JSON objects is returned:
#### Create a model from a Safetensors directory
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](#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.
The `files` parameter should include the file name and SHA256 digest of each file in the Safetensors model. Use [/api/blobs/:digest](#push-a-blob) to push each file before calling this API. Files remain in the cache until the Ollama server is restarted.
##### Request
@@ -1322,11 +1296,8 @@ curl http://localhost:11434/api/create -d '{
A stream of JSON objects is returned:
```shell
{"status":"converting model"}
{"status":"creating new layer sha256:05ca5b813af4a53d2c2922933936e398958855c44ee534858fcfd830940618b6"}
{"status":"using autodetected template llama3-instruct"}
{"status":"using existing layer sha256:56bb8bd477a519ffa694fc449c2413c6f0e1d3b1c88fa7e3c9d88d3ae49d4dcb"}
{"status":"writing manifest"}
{"status":"importing fred (2 tensors)"}
{"status":"writing manifest for fred"}
{"status":"success"}
```
@@ -1523,6 +1494,12 @@ curl http://localhost:11434/api/copy -d '{
Returns a 200 OK if successful, or a 404 Not Found if the source model doesn't exist.
```json
{
"status": "success"
}
```
## Delete a Model
```
@@ -1697,7 +1674,7 @@ Generate embeddings from a model
### Parameters
- `model`: name of model to generate embeddings from
- `input`: text or list of text to generate embeddings for
- `input`: text or list of text to generate embeddings for. To embed media (images or audio) alongside text on models that accept multimodal embeddings, each entry may instead be an object with any of `text` (string), `image` (base64-encoded bytes), `audio` (base64-encoded bytes). In a list, entries can mix plain strings and such objects; each object owns its own media. `video` is not currently accepted.
Advanced parameters:
@@ -1761,6 +1738,28 @@ curl http://localhost:11434/api/embed -d '{
}
```
#### Request (With image)
```shell
curl http://localhost:11434/api/embed -d '{
"model": "embeddinggemma2",
"input": {"text": "a cat sitting on a windowsill", "image": "iVBORw0KGgo..."}
}'
```
#### Request (Batched, mixed modalities)
```shell
curl http://localhost:11434/api/embed -d '{
"model": "embeddinggemma2",
"input": [
"a plain text query",
{"image": "iVBORw0KGgo..."},
{"audio": "UklGRiQAAABXQVZF..."}
]
}'
```
## List Running Models
```