Working with Together AI in Pixeltable

Use Together AI from Pixeltable for chat completions and image generation.

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.

What it uses

Install
terminal
pip install pixeltable together
Environment variables it names
TOGETHER_API_KEY
Pixeltable calls
together.chat_completions()together.image_generations()pxt.create_table()add_computed_column()insert()

A look at the code

working-with-together.ipynb
from pixeltable.functions import together
chat_t = pxt.create_table('together_demo/chat', {'input': pxt.String})
messages = [{'role': 'user', 'content': chat_t.input}]
chat_t.add_computed_column(
output=together.chat_completions(
messages=messages,
model='Qwen/Qwen3.5-9B',
model_kwargs={
# Optional dict with parameters for the Together API
'max_tokens': 300,
'stop': ['\n'],
'temperature': 0.7,
'top_p': 0.9,
},
)
)
chat_t.add_computed_column(
response=chat_t.output.choices[0].message.content
)

One cell of the notebook, copied as it is. Open it in Colab for the rest.

Browse all 103