module pixeltable.functions.nebius
Pixeltable UDFs for Nebius Token Factory models. Provides integration with Nebius Token Factory’s language and embedding models. In order to use them, you must firstpip install openai and configure your Nebius Token Factory API key, by
setting the NEBIUS_API_KEY environment variable or nebius.api_key in the Pixeltable config file.
udf chat_completions()
Signature
chat/completions API endpoint.
For additional details, see: https://docs.tokenfactory.nebius.com/api-reference/inference/create-chat-completion
Nebius Token Factory exposes an OpenAI-compatible API, so you will need to install the
openai package to use this UDF.
Request throttling:
Applies the rate limit set in the config (section nebius, key rate_limit). If no rate
limit is configured, a default rate limit is applied.
Requirements:
pip install openai
messages(pxt.Json[(Json): A list of messages to use for chat completion, as described in the Nebius API documentation.model(Any): The model to use for chat completion.model_kwargs(Any): Additional keyword args for the Nebiuschat/completionsAPI. For details on the available parameters, see: https://docs.tokenfactory.nebius.com/api-reference/inference/create-chat-completiontools(Any): An optional list of Pixeltable tools to use for the request.tool_choice(Any): An optional tool choice configuration.
pxt.Json: A dictionary containing the response and other metadata.
meta-llama/Llama-3.3-70B-Instruct
to an existing Pixeltable column tbl.prompt of the table tbl:
Qwen/Qwen2.5-VL-72B-Instruct, by passing image data directly in the input dictionary, in
the 'image_url' field of the message content, as in this example:
udf embeddings()
Signature
embeddings API endpoint.
For additional details, see: https://docs.tokenfactory.nebius.com/api-reference/inference/create-embeddings
Request throttling:
Applies the rate limit set in the config (section nebius, key rate_limit). If no rate
limit is configured, a default rate limit is applied.
Requirements:
pip install openai
input(pxt.String): A string providing the text for the model to embed.model(pxt.String): The name of the embedding model to use.model_kwargs(pxt.Json | None): Additional keyword args for the NebiusembeddingsAPI, e.g.dimensionsto request a truncated embedding for models that support it (see the note below).
pxt.Array[(None,), float32]: An array representing the application of the given embedding toinput.
Qwen/Qwen3-Embedding-8B
to an existing Pixeltable column tbl.text of the table tbl:
Qwen/Qwen3-Embedding-8B produces 4096-dimensional embeddings by default, which exceed
the maximum of 4000 dimensions supported by Pixeltable embedding indexes. Request a
smaller, indexable size via model_kwargs: