Documentation
¶
Overview ¶
Package openai is the hosted ai://embed backend: OpenAI's /v1/embeddings endpoint. It's the production counterpart to the local ollama backend — reachable from any node and authenticated, so prod nodes (which have no local Ollama) embed via `WITH provider = "openai"`.
The cleartext API key (OPENAI_KEY) is read from the secrets.SecretBag once per call, placed in the Authorization header, and never stored on the backend, logged, or traced. A 401 body is discarded (providers occasionally echo a key prefix in error messages).
`WITH dimensions = N` is forwarded to OpenAI's `dimensions` parameter, which the text-embedding-3 models honour (e.g. text-embedding-3-large → 1536).
Click to show internal directories.
Click to hide internal directories.