ollama_embeddings
Generates vector embeddings from text, using the Ollama API.
This processor sends text to a large language model served by Ollama and generates a vector embedding for each message. By default it starts and runs a local Ollama server, or you can connect to an existing server using the server_address field.
# Config fields, showing default values
processor:
label: ""
ollama_embeddings:
cache_directory: ""
download_url: ""
model: "" # No default (required)
runner:
batch_size: 0
context_size: 0
gpu_layers: 0
threads: 0
use_mmap: false
server_address: ""
text: ""
Examples
- Embed message content
- Use an existing server
Generate a vector embedding for the contents of each message using a local Ollama server.
processor:
ollama_embeddings:
model: nomic-embed-text
Embed a document field using a model served by an existing Ollama server.
processor:
ollama_embeddings:
model: mxbai-embed-large
text: "${! this.document }"
server_address: http://127.0.0.1:11434
Fields
cache_directory
If server_address is not set, the directory used to download the Ollama binary and store the model cache.
Type: string
Default: ""
download_url
If server_address is not set, the URL to download the Ollama binary from. By default this points to the official Ollama release for your platform.
Type: string
Default: ""
model
The name of the Ollama LLM to use, for example nomic-embed-text, mxbai-embed-large, or all-minilm.
Type: string
runner
Options for the model runner that are applied when the model is first loaded into memory.
Type: object
runner.batch_size
The maximum number of requests to process in parallel.
Type: int
Default: 0
runner.context_size
Sets the size of the context window used to generate the next token.
Type: int
Default: 0
runner.gpu_layers
The number of model layers to offload to the GPU for computation.
Type: int
Default: 0
runner.threads
The number of threads to use during generation.
Type: int
Default: 0
runner.use_mmap
Map the model into memory. This is only supported on Unix systems.
Type: bool
Default: false
server_address
The address of the Ollama server to use. Leave this field blank and the processor starts and runs a local Ollama server.
Type: string
Default: ""
text
The text you want to create vector embeddings for. By default the processor submits the entire message payload as a string. This field supports interpolation functions.
Type: string
Default: ""