This documentation page is also available as an interactive notebook. You can launch the notebook in
Kaggle or Colab, or download it for use with an IDE or local Jupyter installation, by clicking one of the
above links.
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.
Install Ollama
You’ll need to have an Ollama server instance to query. There are
several ways to do this.
Running on a local machine
If you’re running this notebook on your own machine, running Windows,
Mac OS, or Linux, you can install Ollama at: https://ollama.com/download
Running on Google Colab
- OR, if you’re running on Colab, you can install Ollama by uncommenting
and running the following code.
Running on a remote Ollama server
- OR, if you have access to an Ollama server running remotely, you can
uncomment and run the following line, replacing the default URL with
the URL of your remote Ollama instance.
Once you’ve completed the installation, run the following commands to
verify that it’s been successfully installed. This may result in an LLM
being downloaded, so it may take some time.
‘The capital of Missouri is Jefferson City. Jefferson City was originally named after the French explorer Pierre-Jacques Houget and the American statesman Thomas Jefferson, who lived in this city from 1764 to 1805. It became the seat of government for most of Jefferson County when it was established in 1836. In more recent times, the name has changed several times due to various political changes and legal changes.‘
Install Pixeltable
Now, let’s install Pixeltable and create a table for the demo.
Connected to Pixeltable database at: postgresql+psycopg://postgres:@/pixeltable?host=/Users/asiegel/.pixeltable/pgdata
Created directory ‘ollama_demo’.
<pixeltable.catalog.dir.Dir at 0x13e95cbb0>
Created table ‘chat’.
Added 0 column values with 0 errors in 0.01 s
No rows affected.
Added 0 column values with 0 errors in 0.01 s
No rows affected.
We can insert our input prompts into the table now. As always,
Pixeltable automatically updates the computed columns by calling the
relevant Ollama endpoint.
Inserted 1 row with 0 errors in 1.28 s (0.78 rows/s)
Learn More
To learn more about advanced techniques like RAG operations in
Pixeltable, check out the RAG Operations in
Pixeltable
tutorial.
If you have any questions, don’t hesitate to reach out.