Skip to content

Azure OpenAI embedder

Embeds through an Azure OpenAI deployment over the OpenAI-compatible wire format. Selected via EMBEDDING_PROVIDER=azure_openai.

Enable it

bash
EMBEDDING_PROVIDER=azure_openai
AZURE_OPENAI_ENDPOINT=https://your-resource.openai.azure.com
AZURE_OPENAI_EMBEDDING_DEPLOYMENT=your-embedding-deployment
AZURE_OPENAI_API_KEY=...
AZURE_OPENAI_API_VERSION=2024-02-01
EMBEDDING_DIMS=1536

Configuration

VariableDefaultDescription
EMBEDDING_PROVIDERopenaiSet to azure_openai.
AZURE_OPENAI_ENDPOINTnoneResource endpoint; a trailing slash is trimmed.
AZURE_OPENAI_EMBEDDING_DEPLOYMENTnoneDeployment name, which identifies the model and is used as the reported model.
AZURE_OPENAI_API_KEYnoneSent as the api-key header. Calls fail at runtime if unset.
AZURE_OPENAI_API_VERSION2024-02-01API version query parameter.
EMBEDDING_DIMS1536Vector dimension; must match the embedding model.

Notes

  • Azure diverges from stock OpenAI on two axes: the URL carries the deployment name and an api-version query parameter, and auth uses the api-key header rather than a Bearer token.
  • The deployment name identifies the model on Azure and is kept as the reported model, so EMBEDDING_DIMS must match whatever model that deployment serves.
  • Shares the OpenAI-compatible request loop: 429 and 5xx and network errors retry with backoff, other 4xx fail fast, and a final failure raises for a clean 503.

The memory layer for AI agents.