Skip to main content

Ollama conversation

Type: conversation.ollama

Status: alpha

Reference: https://docs.dapr.io/reference/components-reference/supported-conversation/ollama/

Example​

apiVersion: cra.diagrid.io/v1beta1
kind: Component
metadata:
name: <name>
spec:
type: conversation.ollama
version: v1
metadata:
# A time-to-live value for a prompt cache to expire. Uses Golang durations (Optional)
#- name: cacheTTL
# value: "10m"
# The URL of the Ollama server. (Optional)
#- name: endpoint
# value: "http://localhost:11434/v1"
# HTTP headers to send on every request to the model endpoint, as a JSON object of header names to string values. Use it for headers that a gateway or proxy in front of the provider requires, for example a tenant ID or a gateway key. A header in this field replaces the header of the same name that the component sets. Host, Content-Length and hop-by-hop headers are not allowed. When this field is set, the component does not follow redirects to a different origin. (Optional)
#- name: headers
# value: "{"X-Tenant-ID": "tenant-a", "X-Gateway-Key": "**********"}"
# Default maximum number of tokens the model may generate per request. A request-level maxTokens value greater than zero overrides this default. When unset, no cap is sent and the provider's own default applies. (Optional)
#- name: maxTokens
# value: "2048"
# The Ollama LLM to use. Configurable via OLLAMA_MODEL environment variable. (Optional)
#- name: model
# value: "llama3.2:latest"

Metadata​

cacheTTL (string)​

A time-to-live value for a prompt cache to expire. Uses Golang durations

Example value: 10m

endpoint (string)​

The URL of the Ollama server.

Default value: http://localhost:11434/v1

Example value: http://10.20.23.21:11434/v1

headers (string)​

HTTP headers to send on every request to the model endpoint, as a JSON object of header names to string values. Use it for headers that a gateway or proxy in front of the provider requires, for example a tenant ID or a gateway key. A header in this field replaces the header of the same name that the component sets. Host, Content-Length and hop-by-hop headers are not allowed. When this field is set, the component does not follow redirects to a different origin.

Example value: {"X-Tenant-ID": "tenant-a", "X-Gateway-Key": "**********"}

maxTokens (number)​

Default maximum number of tokens the model may generate per request. A request-level maxTokens value greater than zero overrides this default. When unset, no cap is sent and the provider's own default applies.

Example value: 2048

model (string)​

The Ollama LLM to use. Configurable via OLLAMA_MODEL environment variable.

Default value: llama3.2:latest

Example value: llama3.2:latest