Working with OpenRouter in Pixeltable
Pixeltable's OpenRouter integration enables you to access multiple LLM providers through a unified API via OpenRouter.
Pixeltable's OpenAI integration enables you to access OpenAI models via the OpenAI API.
Providers · Notebook · Updated
Colab runs it in your browser. If it calls a model provider, it asks for that provider's API key in a cell.
pip install pixeltable openai
OPENAI_API_KEYopenai.chat_completions()openai.responses()openai.decisions()openai.embeddings()openai.image_generations()openai.transcriptions()pxt.create_table()@pxt.udfadd_computed_column()insert()from pixeltable.functions import openai# Create a table in Pixeltable and add a computed column that calls OpenAIt = pxt.create_table('openai_demo/chat', {'input': pxt.String})messages = [{'role': 'user', 'content': t.input}]t.add_computed_column(output=openai.chat_completions(messages=messages,model='gpt-4o-mini',model_kwargs={# Optional dict with parameters for the OpenAI API'max_tokens': 300,'top_p': 0.9,'temperature': 0.7,},))
One cell of the notebook, copied as it is. Open it in Colab for the rest.
Pixeltable's OpenRouter integration enables you to access multiple LLM providers through a unified API via OpenRouter.
Pixeltable's Pydantic integration enables type-safe data insertion using Pydantic models. Instead of inserting raw dictionaries, you can define structured models with validation and insert them directly into Pixeltable tables.
Pixeltable's Replicate integration enables you to access Replicate's models via the Replicate API.
Pixeltable's RunwayML integration lets you generate and transform images and videos using RunwayML's Gen-4.5, Veo, and other models, directly from your Pixeltable tables.