Ollama Integration
Call a local Ollama model from a Pixeltable computed column. chat() on insert, cached per row, with OLLAMA_HOST when the server is remote.
Challenge
Ollama serves local models over HTTP. Wiring that into a table still means a client, a stored prompt, a stored reply, and a rule for when to call again. A script that posts /api/chat for every row will re-run completed prompts unless you add a cache. Moving the server to another host then means changing that script. Pixeltable already has the table. The integration is pixeltable.functions.ollama.chat (and generate) so the model is a column, and OLLAMA_HOST when the daemon is not on localhost.
Solution
Install Ollama and pull a model (the docs use qwen3:0.6b). pip install ollama pixeltable. Assign chat() on a TableModel. Insert a prompt and the Message object lands in output; output.message.content is the text. options passes max_tokens, temperature, top_p, and the rest of Ollama valid parameters. Set OLLAMA_HOST to a remote base URL when the daemon is not local. There is no cloud API key on this path. The notebook uses create_table; an application file uses the class assignment and pxt schema update.
Integration Steps
Step 1 of 3Run a local daemon, pull the model Pixeltable will call, then install the Python client.
# Install the daemon: https://ollama.com/download# ollama pull qwen3:0.6b# pip install -U 'pixeltable[serve]' ollama# Optional remote daemon:# export OLLAMA_HOST=http://127.0.0.1:11434# pxt initimport pixeltable as pxtfrom pixeltable.functions.ollama import chatTableModel = pxt.model_base()
💡 Verify the daemon with ollama.generate before you depend on the column. Colab and Linux can install via the Ollama install script. A remote server is only OLLAMA_HOST.
Key Benefits
Use Cases
Technical Requirements
Related articles
Ready to Integrate Ollama?
Get started with Pixeltable and Ollama in minutes.
pip install pixeltable