Configuration for the Ollama model provider.
A provider block with kind = "ollama" configures a local Ollama runtime.
Ollama runs entirely on the local machine and does not require an API key.
| Field | Type | Required | runtime() | Default | Description |
|---|---|---|---|---|---|
kind | ollama | yes | no | … | Provider kind. |
models | array<string | ModelEntry> | no | no | unset | Models permitted for this provider, with optional model-specific inference settings. |
config | ProviderConfig | no | unset | Base URL of the Ollama server. | |
params | InferenceParams | no | unset | Default inference settings for requests to this provider. |
When config.base_url is unset, the client connects to http://localhost:11434, which is the default
address of a locally running Ollama instance.
| Field | Type | Required | runtime() | Default | Description |
|---|---|---|---|---|---|
name | string | yes | no | … | Model identifier. |
params | InferenceParams | no | unset | Model-specific inference parameter overrides. |
| Field | Type | Required | runtime() | Default | Description |
|---|---|---|---|---|---|
base_url | string | no | yes | unset | Base URL of the Ollama server. |
headers | map<string, HeaderValue> | no | yes | {} | HTTP headers sent with every model request, keyed by header name. Header names are case insensitive. |
A header value is one of:
| Form | Header value |
|---|---|
| a string | The string, unchanged. |
expression("source") | The result of the CEL expression source, evaluated for each model request. |
config {
headers = {
"X-Team" = "platform"
"X-Tenant-Id" = expression("ctx.tenant_id")
}
}For the values an expression can read and how evaluation fails, see Send custom headers.
The params block sets inference parameter defaults for all models under this provider. All fields
are optional and support runtime().
| Field | Type | Required | runtime() | Default | Description |
|---|---|---|---|---|---|
max_tokens | integer | no | yes | unset | Maximum number of tokens to generate. |
temperature | number | no | yes | unset | Controls randomness when selecting the next token; higher values produce more varied output. |
top_p | number | no | yes | unset | Selects tokens from the smallest group whose combined probability reaches this value. |
top_k | integer | no | yes | unset | Limits the next-token choices to the K most likely tokens. |
stop_sequences | array<string> | no | yes | unset | Sequences that stop generation. |
frequency_penalty | number | no | yes | unset | Reduces repetition by penalizing tokens according to how often they have appeared. |
presence_penalty | number | no | yes | unset | Penalizes tokens that have already appeared to reduce repetition. |
seed | integer | no | yes | unset | Seed for deterministic sampling. |
provider_params | object | no | yes | unset | Additional provider-specific inference options sent directly to the API. |
provider "ollama" {
kind = "ollama"
models = [
"llama3.2",
{
name = "mistral"
params {
temperature = 0.9
seed = 42
}
}
]
config {
base_url = runtime("OLLAMA_BASE_URL", "http://localhost:11434")
}
params {
max_tokens = 2048
temperature = 0.6
}
}In this example, requests to llama3.2 use the provider-level defaults. Requests to mistral use
temperature = 0.9 and seed = 42 from its model-level params, while inheriting max_tokens from
the provider-level defaults.
© 2026 pogue.dev. All rights reserved.
CC BY 4.0