tif1 can be configured using environment variables or a .tif1rc configuration file. Environment variables take precedence over file-based configuration.
Core Configuration
TIF1_CACHE_DIR
Location for the SQLite cache database.Default: Windows
%LOCALAPPDATA%/Temp/tif1; macOS ~/Library/Caches/tif1; Linux/other POSIX ~/.cache/tif1 when ~/.cache exists, otherwise ~/.tif1.TIF1_CACHE_ENABLED
Enable or disable caching globally.Default:
trueTIF1_LIB
Default DataFrame lib to use.Default:
pandasOptions: pandas, polarsNetwork Configuration
TIF1_CDNS
Configure multiple CDN sources for data fetching with automatic fallback.Default: jsDelivr (primary), Hugging Face buckets (fallback), StaticDelivr (last resort)The system tries CDNs in order and automatically falls back on failures.
TIF1_CDN_USE_MINIFICATION
Enable JSON minification for reduced file sizes.Default:
falseWhen enabled, tif1 requests .min.json files which are 20-40% smaller.TIF1_CDN_BASE_URL
Legacy single CDN configuration (deprecated: useTIF1_CDNS instead).
TIF1_REQUEST_TIMEOUT
Timeout for HTTP requests in seconds.Default:
10 secondsTIF1_MAX_RETRIES
Maximum number of retries for failed requests.Default:
3TIF1_RETRY_BACKOFF
Backoff multiplier for exponential retry delays.Default:
1.5Formula: delay = base_delay * (backoff ^ attempt)Circuit Breaker
TIF1_CIRCUIT_BREAKER_THRESHOLD
Number of consecutive failures before opening the circuit.Default:
5TIF1_CIRCUIT_BREAKER_TIMEOUT
Time in seconds before tif1 tries to close an open circuit.Default:
60 secondsLogging
TIF1_LOG_LEVEL
Set the logging verbosity.Default:
INFOOptions: DEBUG, INFO, WARNING, ERROR, CRITICALTIF1_LOG_FILE
Write logs to a file instead of stdout.Default: None (logs to stdout)
Performance Tuning
TIF1_ASYNC_WORKERS
Number of concurrent workers for async operations.Default:
10Higher values give more parallelism and more memory usage.TIF1_MEMORY_CACHE_SIZE
Size of the in-memory LRU cache (number of items).Default:
100TIF1_HTTP2_ENABLED
Enable HTTP/2 for network requests.Default:
trueDisable this option only when connection problems occur.Data Processing
TIF1_USE_CATEGORICAL
Convert string columns to categorical types for memory savings.Default:
trueThis option can reduce memory usage by 30-50%.TIF1_TELEMETRY_FREQUENCY
Telemetry sampling frequency in Hz.Default:
4 HzHigher values give more data points and larger files.Configuration File
Instead of environment variables, create a.tif1rc file in the home directory or the project root.
Example .tif1rc
Programmatic Configuration
Configure tif1 directly in code as an alternative.Priority Order
Configuration is resolved in this order (highest to lowest priority):- Programmatic configuration in code
- Environment variables
.tif1rcin current directory.tif1rcin home directory- Default values
Validation
Invalid configuration values raise aConfigError at startup.
Best Practices
Use .tif1rc for Projects
Commit
.tif1rc to version control for team consistency.Use ENV for Deployment
Use environment variables in production for flexibility.
Keep Defaults
Override only the values that must change.
Document Changes
Add a comment for each changed default value.