1 Resources rag_embedding_config
Forgejo Actions edited this page 2026-11-26 06:34:52 +00:00

openwebui_rag_embedding_config (Resource)

Manages the embedding engine Open WebUI indexes and queries documents with.

POST /api/v1/retrieval/embedding/update assigns all five top-level keys from the form it receives, so this resource reads the current configuration and overlays the attributes the plan names before it writes.

An engine block is written only when rag_embedding_engine is ollama, openai, or azure_openai. A block this configuration leaves out keeps its stored values.

The update route loads the new embedding model into the Open WebUI process and unloads the previous one, so an apply that switches engines does real work and can take a while. It is idempotent.

Example Usage

resource "openwebui_rag_embedding_config" "example" {
  rag_embedding_engine     = "openai"
  rag_embedding_model      = "text-embedding-3-small"
  rag_embedding_batch_size = 100

  openai_config = {
    url = "https://api.openai.com/v1"
    key = var.openai_api_key
  }
}

variable "openai_api_key" {
  type      = string
  sensitive = true
}

Schema

Required

  • rag_embedding_engine (String) Embedding engine: ollama, openai, azure_openai, or the empty string for the built-in model. Stored as rag.embedding_engine.
  • rag_embedding_model (String) Embedding model name. Stored as rag.embedding_model.

Optional

  • azure_openai_config (Attributes) Azure OpenAI embedding endpoint. Stored as rag.azure_openai.base_url, rag.azure_openai.api_key, and rag.azure_openai.api_version. (see below for nested schema)
  • enable_async_embedding (Boolean) Whether embedding requests run asynchronously. Stored as rag.enable_async_embedding.
  • ollama_config (Attributes) Ollama embedding endpoint. Stored as rag.ollama.base_url and rag.ollama.api_key. (see below for nested schema)
  • openai_config (Attributes) OpenAI embedding endpoint. Stored as rag.openai.api_base_url and rag.openai.api_key. (see below for nested schema)
  • rag_embedding_batch_size (Number) Texts sent per embedding request. Stored as rag.embedding_batch_size.
  • rag_embedding_concurrent_requests (Number) Embedding requests in flight at once. Stored as rag.embedding_concurrent_requests.

Read-Only

  • id (String) Identifier of this singleton resource. Always rag_embedding.

Nested Schema for azure_openai_config

Required:

  • key (String, Sensitive) API key for the Azure OpenAI deployment. Sensitive.
  • url (String) Base URL of the Azure OpenAI deployment.
  • version (String) Azure OpenAI API version.

Nested Schema for ollama_config

Required:

  • key (String, Sensitive) API key for the Ollama server. Sensitive.
  • url (String) Base URL of the Ollama server.

Nested Schema for openai_config

Required:

  • key (String, Sensitive) API key for the embedding endpoint. Sensitive.
  • url (String) Base URL of the OpenAI-compatible embedding API.

Import

Import is supported using the following syntax:

The terraform import command can be used, for example:

# The embedding settings are one configuration block, so this resource is a
# singleton. Import it under its fixed id.
terraform import openwebui_rag_embedding_config.example rag_embedding