Skip to main content
Vane Data / Reference

AI Functions API reference

Vane provides Prompt and Embed operations for model-backed column processing. Use this reference to choose an API and check its signatures, parameters, return values, and errors in vane-ai 0.1.0. See the Installation guide for setup and AI Functions for an introduction.

Choose an API

OperationPython ExpressionRelation-returning formSQL ExpressionResult
Promptvane.ai.promptvane.ai.prompt(rel, ...) or rel.prompt(...)ai_promptVARCHAR, native STRUCT, or raw-response JSON in VARCHAR
Embedvane.ai.embedvane.ai.embed(rel, ...) or rel.embed(...)ai_embedFixed-size FLOAT[n]

Expression calls return a lazy vane.Expression; name it with .alias(...). Relation calls retain the input columns and append an output column. If that name already exists, the Relation call replaces it case-insensitively. SQL calls are projection expressions and use AS to name their result.

Execution guarantees

  • Prompt and Embed preserve input row count and order.
  • Embed with a NULL text input and Prompt with one NULL message return NULL while preserving the result type, without calling the provider. In a Prompt message list, NULL parts are omitted; if no parts remain, the result is NULL.
  • Provider, model, JSON Schema, dimensions, and options apply to the whole operation. They cannot vary by input row.
  • Only documented options are accepted. Unknown or provider-incompatible names fail while the query is prepared.
  • Credentials are not function options. Pass them through environment variables or runtime secret management.
  • on_error="raise" stops on a row execution failure. on_error="ignore" writes NULL for that row; it does not hide invalid plans or option errors.
  • Remote Prompt and all Embed calls default to three retries after the first attempt. Native vLLM Prompt does not retry. A retry can issue a provider request more than once.

Providers

ProviderPromptEmbedDefault Prompt modelDefault Embed model
openaiYesYesgpt-4o-minitext-embedding-3-small
googleYesYesMust be configuredgemini-embedding-2
anthropicYesNoMust be configured—
vllmYesNoQwen/Qwen3-1.7B—
transformersNoYes—sentence-transformers/all-MiniLM-L6-v2

Install the optional dependency group for the selected provider and expose its credentials to every worker that may execute the operation. See AI Functions for installation and setup. In the Python APIs, the provider argument also accepts a custom Provider object that implements the selected operation.