# ollama_embeddings

> For the complete documentation index, see [llms.txt](https://docs.redpanda.com/llms.txt). Component-specific: [connect-full.txt](https://docs.redpanda.com/connect-full.txt)

---
title: ollama_embeddings
latest-connect-version: 4.117.0
latest-operator-version: v26.2.6
latest-console-tag: v3.14.0
latest-redpanda-tag: v26.2.6
docname: processors/ollama_embeddings
page-component-name: connect
page-version: master
page-component-version: master
page-component-title: Connect
page-relative-src-path: processors/ollama_embeddings.adoc
page-edit-url: https://github.com/redpanda-data/rp-connect-docs/edit/main/modules/components/pages/processors/ollama_embeddings.adoc
description: Generates vector embeddings from text, using the Ollama API.
page-git-created-date: "2024-08-15"
page-git-modified-date: "2026-10-29"
page-generated-sources:
  - include: connect:components:partial$descriptions/processors/ollama_embeddings.adoc
    generator: null
    version: null
    source: the component specs in https://github.com/redpanda-data/connect
  - include: connect:components:partial$availability/processors/ollama_embeddings.adoc
    generator: null
    version: null
    source: the component specs in https://github.com/redpanda-data/connect
  - include: connect:components:partial$fields/processors/ollama_embeddings.adoc
    generator: null
    version: null
    source: the component specs in https://github.com/redpanda-data/connect
  - include: connect:components:partial$examples/processors/ollama_embeddings.adoc
    generator: null
    version: null
    source: the component specs in https://github.com/redpanda-data/connect
page-generated-content: partial
---

<!-- Source: https://docs.redpanda.com/connect/components/processors/ollama_embeddings.md -->

Generates vector embeddings from text, using the Ollama API.

Introduced in version 4.32.0.

This processor sends text to your chosen Ollama large language model (LLM) and creates vector embeddings, using the Ollama API. Vector embeddings are long arrays of numbers that represent values or objects, in this case text.

By default, the processor starts and runs a locally installed Ollama server. Alternatively, to use an already running Ollama server, add your server details to the `server_address` field. You can [download and install Ollama from the Ollama website](https://ollama.com/download).

For more information, see the [Ollama documentation](https://github.com/ollama/ollama/tree/main/docs).

#### Common

```yml
processor:
  label: ""
  ollama_embeddings:
    model: "" # No default (required)
    text: "" # No default (optional)
    runner:
      context_size: 0 # No default (optional)
      batch_size: 0 # No default (optional)
    server_address: "" # No default (optional)
```

#### Advanced

```yml
processor:
  label: ""
  ollama_embeddings:
    model: "" # No default (required)
    text: "" # No default (optional)
    runner:
      context_size: 0 # No default (optional)
      batch_size: 0 # No default (optional)
      gpu_layers: 0 # No default (optional)
      threads: 0 # No default (optional)
      use_mmap: false # No default (optional)
    server_address: "" # No default (optional)
    cache_directory: "" # No default (optional)
    download_url: "" # No default (optional)
```

## [](#fields)Fields

### [](#cache_directory)`cache_directory`

If `server_address` is not set, download the Ollama binary to this directory and use it as a model cache.

Requires version 4.34.0 or later.

**Type**: `string`

```yaml
# Examples:
cache_directory: /opt/cache/connect/ollama
```

### [](#download_url)`download_url`

If `server_address` is not set, download the Ollama binary from this URL. The default value is the official Ollama GitHub release for this platform.

Requires version 4.34.0 or later.

**Type**: `string`

### [](#model)`model`

The name of the Ollama model to use. For a full list of models, see the [Ollama website](https://ollama.com/models).

**Type**: `string`

```yaml
# Examples:
model: nomic-embed-text

# ---

model: mxbai-embed-large

# ---

model: snowflake-artic-embed

# ---

model: all-minilm
```

### [](#runner)`runner`

Options for the model runner that are used when the model is first loaded into memory.

Requires version 4.34.0 or later.

**Type**: `object`

### [](#runner-batch_size)`runner.batch_size`

The maximum number of requests to process in parallel.

**Type**: `int`

### [](#runner-context_size)`runner.context_size`

Sets the size of the context window used to generate the next token. Using a larger context window uses more memory and takes longer to process.

**Type**: `int`

### [](#runner-gpu_layers)`runner.gpu_layers`

Sets the number of layers to offload to the GPU for computation. This generally results in increased performance. By default, the runtime decides the number of layers dynamically.

**Type**: `int`

### [](#runner-threads)`runner.threads`

Sets the number of threads to use during response generation. For optimal performance, set this value to the number of physical CPU cores your system has. By default, the runtime decides the optimal number of threads.

**Type**: `int`

### [](#runner-use_mmap)`runner.use_mmap`

Map the model into memory. Set to `true` to load only the necessary parts of the model into memory. This setting is only supported on Unix systems.

**Type**: `bool`

### [](#server_address)`server_address`

The address of the Ollama server to use. Leave this field blank and the processor starts and runs a local Ollama server, or specify the address of your own local or remote server.

**Type**: `string`

```yaml
# Examples:
server_address: http://127.0.0.1:11434
```

### [](#text)`text`

The text you want to generate vector embeddings for. By default, the processor submits the entire payload of each message as a string.

This field supports [interpolation functions](https://docs.redpanda.com/connect/configuration/interpolation/#bloblang-queries).

**Type**: `string`

## [](#examples)Examples

### [](#store-embedding-vectors-in-qdrant)Store embedding vectors in Qdrant

Computes embeddings for some generated data and stores them in [Qdrant](https://docs.redpanda.com/connect/components/outputs/qdrant/).

```yaml
input:
  generate:
    interval: 1s
    mapping: |
      root = {"text": fake("paragraph")}
pipeline:
  processors:
  - ollama_embeddings:
      model: snowflake-artic-embed
      text: "${!this.text}"
output:
  qdrant:
    grpc_host: localhost:6334
    collection_name: "example_collection"
    id: "root = uuid_v4()"
    vector_mapping: "root = this"
```

### [](#store-embedding-vectors-in-cyborgdb)Store embedding vectors in CyborgDB

Computes embeddings for some generated data and stores them in [CyborgDB](https://docs.redpanda.com/connect/components/outputs/cyborgdb/).

```yaml
input:
  generate:
    interval: 1s
    mapping: |
      root = {"text": fake("paragraph")}
pipeline:
  processors:
  - ollama_embeddings:
      model: snowflake-artic-embed
      text: "${!this.text}"
output:
  cyborgdb:
    host: "${CYBORGDB_HOST}"
    api_key: "${CYBORGDB_API_KEY}"
    index_key: "${CYBORGDB_INDEX_KEY}"
    index_name: "my_encrypted_index"
    operation: "upsert"
    id: "root = uuid_v4()"
    vector_mapping: "root = this"
```

### [](#store-embedding-vectors-in-clickhouse)Store embedding vectors in Clickhouse

Compute embeddings for some generated data and store it within [Clickhouse](https://clickhouse.com/)

```yaml
input:
  generate:
    interval: 1s
    mapping: |
      root = {"text": fake("paragraph")}
pipeline:
  processors:
  - branch:
      processors:
      - ollama_embeddings:
          model: snowflake-artic-embed
          text: "${!this.text}"
      result_map: |
        root.embeddings = this
output:
  sql_insert:
    driver: clickhouse
    dsn: "clickhouse://localhost:9000"
    table: searchable_text
    columns: ["id", "text", "vector"]
    args_mapping: "root = [uuid_v4(), this.text, this.embeddings]"
```