Skip to main content

Pixeltable Quickstart

Pixeltable is declarative data infrastructure for building multimodal AI applications. It allows you to create and manage tables similar to how you create and use tables with database engines like Postgres. When you combine Pixeltable and Tigris, you get unlimited media storage with no egress fees and truly global scalability. This guide will tell you how to configure Pixeltable to work with Tigris.

Pixeltable contains a storage integration for Tigris as of version 0.5.0. This allows you to store your structured data in Pixeltable and have references to unstructured multimodal data in Tigris.

In order to configure Pixeltable to use Tigris, you need to set the following environment variables or make changes to the configuration file in ~/.pixeltable/config.toml:

[pixeltable]
# The location where new media files are stored when they are added to tables.
input_media_dest = "s3://contoso-data/input"
# The location where media files are stored when they are generated by Pixeltable operations.
output_media_dest = "s3://contoso-data/output"
# The name of the AWS configuration profile that is configured for accessing Tigris.
tigris_profile = "tigris"

Then when you insert a video into a table:

import pixeltable as pxt

videos = pxt.create_table(
"content",
schema={
"video": pxt.Video,
"title": pxt.String,
},
if_exists="ignore",
)

videos.insert(
[
{
"video": "./var/big-buck-bunny.mp4",
"title": "Big Buck Bunny",
},
]
)

Pixeltable will automatically upload the media file to Tigris as it ingests it.

If you create an image with the OpenAI image_generation user-defined function, the generated image will automatically be uploaded to Tigris:

import pixeltable as pxt
from pixeltable.functions import openai

pxt.drop_table("wallpapers")
wallpapers = pxt.create_table(
"wallpapers",
schema={
"text": pxt.String,
},
if_exists="ignore",
)

wallpapers.insert(
[
{"text": "A surrealist oil on canvas painting of a taco dancing in a datacentre"}
]
)

wallpapers.add_computed_column(
gen_image=openai.image_generations(wallpapers.text, model='dall-e-2')
)

You can then browse the generated images in Tigris.

From here, go read the Pixeltable documentation so you can get started building your next multimodal app.