Skip to main content
Version: Next
embeddingINPUTBUFFERPROCESSOROUTPUT

Embedding

The embedding processor batch-embeds a text column of the incoming batch through an OpenAI-compatible embeddings API and appends the vectors as a FixedSizeList(Float32, dim) column. Any endpoint that speaks the OpenAI /embeddings protocol works: OpenAI, Azure OpenAI (via headers), vLLM, Ollama, or TEI-compatible gateways.

It pairs with the Qdrant output to form a streaming RAG / semantic-search ingestion pipeline.

Configuration​

FieldTypeRequiredDefaultDescription
typestringyes—embedding
api_basestringyes—API base URL; the request path is {api_base}/embeddings.
modelstringyes—Embedding model name (e.g. text-embedding-3-small).
api_keystringno—Sent as Authorization: Bearer. Supports secret references.
fieldstringyes—Input UTF-8 column to embed. Rows must be non-null.
target_fieldstringnoembeddingName of the appended vector column.
batch_sizeintegerno32Maximum rows per HTTP request.
timeout_msintegerno30000HTTP request timeout.
headersmapno—Extra HTTP headers (e.g. Azure's api-key).
note

Requests to loopback endpoints (a local vLLM/Ollama instance, for example) always bypass the system proxy.

Error semantics​

A failed API call (non-2xx), an inconsistent response (vector count or dimension mismatch, null input text) surfaces as a processing error, so the batch flows to the stream's error_output when configured. The processor does not retry embedding requests — retries would multiply API spend; rely on error_output or upstream redelivery instead.

Example​

- type: "embedding"
api_base: "https://api.openai.com/v1"
model: "text-embedding-3-small"
api_key: "${env:OPENAI_API_KEY:-}"
field: "text"
batch_size: 32

Complete Pipeline Example​

logging:
level: info

streams:
- id: docs-embedder
input:
type: kafka
brokers:
- broker1.example.com:9092
topics:
- documents
consumer_group: arkflow-embedder
start_from_latest: false
pipeline:
thread_num: 4
processors:
- type: json_to_arrow
- type: embedding
api_base: "https://api.openai.com/v1"
model: "text-embedding-3-small"
api_key: "${env:OPENAI_API_KEY:-}"
field: "text"
output:
type: stdout