Working with Groq in Pixeltable

Pixeltable's Groq integration enables you to access Groq models via the Groq 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.

What it uses

Install
terminal
pip install pixeltable groq
Environment variables it names
GROQ_API_KEY
Pixeltable calls
groq.chat_completions()pxt.create_table()add_computed_column()insert()

A look at the code

working-with-groq.ipynb
from pixeltable.functions import groq
# Create a table in Pixeltable and add a computed column that calls OpenAI
t = pxt.create_table('groq_demo/chat', {'input': pxt.String})
messages = [{'role': 'user', 'content': t.input}]
t.add_computed_column(
output=groq.chat_completions(
messages=messages,
model='openai/gpt-oss-20b',
model_kwargs={
# Optional dict with parameters for the Groq 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.

Browse all 103