Configuration Options

Pixeltable can be configured through:
  • Environment variables
  • System configuration file (~/.pixeltable/config.toml on Linux/macOS or C:\Users\<username>\.pixeltable\config.toml on Windows)
Example config.toml:
[pixeltable]
file_cache_size_g = 250
time_zone = "America/Los_Angeles"
hide_warnings = true
verbosity = 2

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

[openai.rate_limits]
tts-1 = 500  # OpenAI uses a per-model rate limit configuration (see below for details)

[mistral]
api_key = 'my-openai-api-key'
rate_limit = 600  # Mistral uses a single rate limit for all models

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

System Settings

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; required
PIXELTABLE_TIME_ZONE[pixeltable]
time_zone
(string) Default time zone in IANA format; defaults to the system time zone
PIXELTABLE_HIDE_WARNINGS[pixeltable]
hide_warnings
(bool) Suppress warnings generated by various libraries used by Pixeltable; default is false
PIXELTABLE_VERBOSITY[pixeltable]
verbosity
(int) Verbosity for Pixeltable console logging (0: minimum, 1: normal, 2: maximum); default is 1

API Configuration

Environment VariableConfig FileMeaning
ANTHROPIC_API_KEY[anthropic]
api_key
(string) API key to use for Anthropic services
DEEPSEEK_API_KEY[deepseek]
api_key
(string) API key to use for Deepseek services
FIREWORKS_API_KEY[fireworks]
api_key
(string) API key to use for Fireworks AI services
GEMINI_API_KEY[gemini]
api_key
(string) API key to use for Google Gemini 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
OPENAI_BASE_URL[openai]
base_url
(string, optional) Base URL to use for OpenAI services
OPENAI_API_VERSION[openai]
api_version
(string) API version for use with Azure OpenAI; must be 'latest' or 'preview'
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

Rate Limit Configuration

Pixeltable supports two patterns for configuring API rate limits in config.toml. Refer to the docstring of the relevant udf in the API reference for details on the rate limiting pattern used by that udf.

Single Rate Limit per Provider

For providers with a single rate limit across all models, add a rate_limit key to the provider’s config section:
[mistral]
api_key = 'my-mistral-api-key'
rate_limit = 600  # requests per minute

[fireworks]
api_key = 'my-fireworks-api-key'
rate_limit = 300

Per-Model Rate Limits

For providers that support different rate limits for different models, add a <provider>.rate_limits section and list the rate limits for each model:
[openai]
api_key = 'my-openai-api-key'

[openai.rate_limits]
gpt-4o = 500
gpt-4o-mini = 1000
tts-1 = 50
dall-e-3 = 10

[gemini.rate_limits]
gemini-pro = 600
gemini-pro-vision = 300
If no rate limit is configured, Pixeltable uses a default of 600 requests per minute.

Configuration Best Practices

Security Considerations

When configuring API keys and sensitive information:
  • Avoid hardcoding API keys in your code
  • Use environment variables for temporary access
  • Use the config file for persistent configuration
  • Ensure your config.toml file has appropriate permissions (readable only by you)

Performance Tuning

  • Adjust file_cache_size_g based on your available system memory
  • For large datasets, increase the cache size to improve performance
  • Set appropriate verbosity level based on your debugging needs

Applying Configuration Changes

Configuration changes take effect:
  • For environment variables: When you restart your Python session
  • For config file changes: When you restart your Python session or call pxt.init() again

Installation Guide

Return to the installation guide for setup instructions