Installation

Getting Started with Pixeltable

This is a step-by-step guide to setting up a local installation of Pixeltable. If you'd prefer to use a cloud notebook platform such as Kaggle or Colab, see the "Quick Start" section of the Overview instead.

You'll want to install Pixeltable in a Python virtual environment; we'll use Apache Miniconda in this guide, but any environment manager should work.

Pixeltable works with Python 3.9, 3.10, 3.11, or 3.12 running on Linux, MacOS, or Windows.

Install Pixeltable

  1. Install Miniconda here: Installing Miniconda

  2. Create your environment:

    • conda create --name pxt python=3.11 (You can choose to use any Python version between 3.9 and 3.12.)
    • conda activate pxt
  3. Install Pixeltable and Jupyter inside the new environment:

    • pip install pixeltable jupyter

Create a Notebook

  1. Start your Jupyter notebook server:

    • jupyter notebook
  2. Create a new notebook:

    • Select "Python 3 (ipykernel)" as the kernel
    • File / New / Notebook
  3. Test that everything is working by entering these commands into the notebook:

import pixeltable as pxt
pxt.init()
  1. Wait a minute for Pixeltable to load; then you should see a message indicating that
    Pixeltable has successfully connected to the database.

Configuration

Pixeltable configuration options can be specified in one of two ways:

  • Using environment variables, such as PIXELTABLE_HOME and OPENAI_API_KEY; and/or
  • In the system configuration file $PIXELTABLE_HOME/config.toml (usually ~/.pixeltable/config.toml).

The system configuration file follows the usual TOML format with headings and values:

[pixeltable]
file_cache_size_g = 250

[openai]
api_key = 'my-openai-api-key'

[label_studio]
url = 'http://localhost:8080/'
api_key = 'my-label-studio-api-key'

Most options can be specified either as an environment variable or in config.toml, although a few can only be specified as an environment variable. It is fine for some options to be given as environment variables and others in config.toml. If a configuration parameter is specified both ways, the environment variable will be used preferentially.

System Configuration

Environment VariableConfig FileMeaning
PIXELTABLE_HOME(string) Pixeltable user directory; default is ~/.pixeltable
PIXELTABLE_CONFIG(string) Pixeltable config file; default is $PIXELTABLE_HOME/config.toml
PIXELTABLE_PGDATA(string) Directory where Pixeltable DB is stored; default is $PIXELTABLE_HOME/pgdata
PIXELTABLE_DB(string) Pixeltable database name; default is pixeltable
PIXELTABLE_FILE_CACHE_SIZE_G[pixeltable]
file_cache_size_g
(float) Maximum size of the Pixeltable file cache, in GiB
PIXELTABLE_HIDE_WARNINGS[pixeltable]
hide_warnings
(bool) Suppress warnings generated by various libraries used by Pixeltable

APIs

Environment VariableConfig FileMeaning
ANTHROPIC_API_KEY[anthropic]
api_key
(string) API key to use for Anthropic services
FIREWORKS_API_KEY[fireworks]
api_key
(string) API key to use for Fireworks AI services
LABEL_STUDIO_API_KEY[label_studio]
api_key
(string) API key to use for Label Studio
LABEL_STUDIO_URL[label_studio]
url
(string) URL of the Label Studio server to use
MISTRAL_API_KEY[mistral]
api_key
(string) API key to use for Mistral AI services
OPENAI_API_KEY[openai]
api_key
(string) API key to use for OpenAI services
REPLICATE_API_TOKEN[replicate]
api_token
(string) API token to use for Replicate services
TOGETHER_API_KEY[together]
api_key
(string) API key to use for Together AI services