Configuration options
Pixeltable can be configured through:- Environment variables
- System configuration file (
~/.pixeltable/config.tomlon Linux/macOS orC:\Users\<username>\.pixeltable\config.tomlon Windows) pxt.init(), for the calling process only:pxt.init({'openai.api_key': '...'})
file_cache_size_g and file_cache_lease_s.
Prefer environment variable names (
PIXELTABLE_API_KEY, PIXELTABLE_OUTPUT_MEDIA_DEST). Create PIXELTABLE_API_KEY under API Keys and export it, not api_key in config.toml. Pixeltable resolves environment variables from the process environment and never loads a .env file itself, so source one yourself first (set -a; source .env; set +a) or load it with a dotenv library. Provider keys go under Secrets or pxt secret. On a hosted Cloud database the home bucket is already the default media store; dest env vars are for local Pixeltable and bring-your-own buckets. See Cloud storage.config.toml:
System settings
API configuration
Rate limit configuration
Pixeltable supports two patterns for configuring API rate limits inconfig.toml. Refer to the docstring of the
relevant udf in the SDK 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 arate_limit key to the provider’s config section:
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:
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_gbased 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 when you restart your Python session.Installation Guide
Return to the installation guide for setup instructions