This documentation page is also available as an interactive notebook. You can launch the notebook in
Kaggle or Colab, or download it for use with an IDE or local Jupyter installation, by clicking one of the
above links.
Pixeltable’s Nebius Token Factory integration enables you to access
Nebius language and embedding models via an OpenAI-compatible API.
Nebius usage may incur costs based on your Nebius plan.
Be mindful of sensitive data and consider security measures when
integrating with external services.
First you’ll need to install the required libraries and enter a Nebius
API key. Nebius uses the OpenAI SDK as its Python API, so we need to
install it in addition to Pixeltable.
%pip install -qU pixeltable openai
import getpassimport osif 'NEBIUS_API_KEY' not in os.environ: os.environ['NEBIUS_API_KEY'] = getpass.getpass('Nebius API Key:')
Now let’s create a Pixeltable directory to hold the tables for our demo.
import pixeltable as pxt# Remove the 'nebius_demo' directory and its contents, if it existspxt.drop_dir('nebius_demo', force=True)pxt.create_dir('nebius_demo')
Chat completions
Create a Table: In Pixeltable, create a table with columns to represent
your input data and the columns where you want to store the results from
Nebius.
from pixeltable.functions import nebiuschat_t = pxt.create_table('nebius_demo/chat', {'input': pxt.String})messages = [{'role': 'user', 'content': chat_t.input}]chat_t.add_computed_column( output=nebius.chat_completions( messages=messages, model='Qwen/Qwen3-30B-A3B-Instruct-2507', model_kwargs={ # Optional dict with parameters for the Nebius API 'max_tokens': 300, 'temperature': 0.7, }, ))chat_t.add_computed_column( response=chat_t.output.choices[0].message.content)
Created table ‘chat’.
Added 0 column values with 0 errors in 0.01 s
Added 0 column values with 0 errors in 0.00 s
No rows affected.
# Start a conversationchat_t.insert( [ {'input': 'What is the capital of France?'}, {'input': 'Explain quantum computing in one sentence.'}, ])chat_t.select(chat_t.input, chat_t.response).head()
Inserted 2 rows with 0 errors in 4.43 s (0.45 rows/s)
Embeddings
Nebius currently serves the embedding model Qwen/Qwen3-Embedding-8B.
By default it produces 4096-dimensional embeddings, which exceed
Pixeltable’s embedding-index limit of 4000 dimensions. Request a smaller
size via model_kwargs when you need an indexable embedding.
emb_t.insert([{'input': 'Another sentence for you to index.'}])
Inserted 1 row with 0 errors in 3.62 s (0.28 rows/s)
1 row inserted.
sim = emb_t.input.similarity(string='Indexing sentences is fun.')emb_t.select(emb_t.input, sim=sim).order_by(sim, asc=False).collect()
Learn more
To learn more about advanced techniques like RAG operations in
Pixeltable, check out the RAG Operations in
Pixeltable
tutorial.If you have any questions, don’t hesitate to reach out.
Last modified on August 31, 2026
Was this page helpful?
Assistant
Responses are generated using AI and may contain mistakes.