Working with Ollama in Pixeltable

Ollama is a popular platform for local serving of LLMs. In this tutorial, we'll show how to integrate Ollama models into a Pixeltable workflow.

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 ollama pixeltable
Pixeltable calls
ollama.chat()pxt.create_table()add_computed_column()insert()

A look at the code

working-with-ollama.ipynb
t = pxt.create_table('ollama_demo/chat', {'input': pxt.String})
messages = [{'role': 'user', 'content': t.input}]
# Add a computed column that runs the model to generate responses
t.add_computed_column(
output=chat(
messages=messages,
model='qwen3:0.6b',
# These parameters are optional and can be used to tune model behavior:
options={'max_tokens': 300, 'top_p': 0.9, 'temperature': 0.5},
)
)

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

Browse all 103