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
+18 -33
View File
@@ -12,15 +12,15 @@ A Modelfile is the blueprint to create and share customized models using Ollama.
- [FROM (Required)](#from-required)
- [Build from existing model](#build-from-existing-model)
- [Build from a Safetensors model](#build-from-a-safetensors-model)
- [Build from a GGUF file](#build-from-a-gguf-file)
- [Build from a GGUF model](#build-from-a-gguf-model)
- [PARAMETER](#parameter)
- [Valid Parameters and Values](#valid-parameters-and-values)
- [TEMPLATE](#template)
- [Template Variables](#template-variables)
- [SYSTEM](#system)
- [ADAPTER](#adapter)
- [LICENSE](#license)
- [MESSAGE](#message)
- [CAPABILITY](#capability)
- [Notes](#notes)
## Format
@@ -38,10 +38,10 @@ INSTRUCTION arguments
| [`PARAMETER`](#parameter) | Sets the parameters for how Ollama will run the model. |
| [`TEMPLATE`](#template) | The full prompt template to be sent to the model. |
| [`SYSTEM`](#system) | Specifies the system message that will be set in the template. |
| [`ADAPTER`](#adapter) | Defines the (Q)LoRA adapters to apply to the model. |
| [`LICENSE`](#license) | Specifies the legal license. |
| [`MESSAGE`](#message) | Specify message history. |
| [`REQUIRES`](#requires) | Specify the minimum version of Ollama required by the model. |
| [`CAPABILITY`](#capability) | Declare an additional model capability. |
## Examples
@@ -119,14 +119,7 @@ FROM <model directory>
The model directory should contain the Safetensors weights for a supported architecture.
Currently supported model architectures:
- Llama (including Llama 2, Llama 3, Llama 3.1, and Llama 3.2)
- Mistral (including Mistral 1, Mistral 2, and Mixtral)
- Gemma (including Gemma 1 and Gemma 2)
- Phi3
#### Build from a GGUF file
#### Build from a GGUF model
```
FROM ./ollama-model.gguf
@@ -134,6 +127,12 @@ FROM ./ollama-model.gguf
The GGUF file location should be specified as an absolute path or relative to the `Modelfile` location.
For a split GGUF model, keep the original split filenames and use a wildcard that matches every shard. Shards can also be listed with separate `FROM` instructions.
```
FROM ./model-*.gguf
```
### PARAMETER
The `PARAMETER` instruction defines a parameter that can be set when the model is run.
@@ -187,28 +186,6 @@ The `SYSTEM` instruction specifies the system message to be used in the template
SYSTEM """<system message>"""
```
### ADAPTER
The `ADAPTER` instruction specifies a fine tuned LoRA adapter that should apply to the base model. The value of the adapter should be an absolute path or a path relative to the Modelfile. The base model should be specified with a `FROM` instruction. If the base model is not the same as the base model that the adapter was tuned from the behaviour will be erratic.
#### Safetensor adapter
```
ADAPTER <path to safetensor adapter>
```
Currently supported Safetensor adapters:
- Llama (including Llama 2, Llama 3, and Llama 3.1)
- Mistral (including Mistral 1, Mistral 2, and Mixtral)
- Gemma (including Gemma 1 and Gemma 2)
#### GGUF adapter
```
ADAPTER ./ollama-lora.gguf
```
### LICENSE
The `LICENSE` instruction allows you to specify the legal license under which the model used with this Modelfile is shared or distributed.
@@ -246,6 +223,14 @@ MESSAGE user Is Ontario in Canada?
MESSAGE assistant yes
```
### CAPABILITY
Adds a capability to a GGUF or MLX model without removing inherited or inferred capabilities. Repeat the instruction to add more than one. Declare `decision` only for weights trained for System One's decision prompts:
```
CAPABILITY decision
```
### REQUIRES
The `REQUIRES` instruction allows you to specify the minimum version of Ollama required by the model.