Skip to main content
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: true

TIF1_LIB

Default DataFrame lib to use.
Default: pandasOptions: pandas, polars

Network 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: use TIF1_CDNS instead).
Change this variable only for a privately hosted data mirror. Never use raw.githubusercontent.com because of rate limits.Use TIF1_CDNS for multi-CDN support with automatic fallback.

TIF1_REQUEST_TIMEOUT

Timeout for HTTP requests in seconds.
Default: 10 seconds

TIF1_MAX_RETRIES

Maximum number of retries for failed requests.
Default: 3

TIF1_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: 5

TIF1_CIRCUIT_BREAKER_TIMEOUT

Time in seconds before tif1 tries to close an open circuit.
Default: 60 seconds

Logging

TIF1_LOG_LEVEL

Set the logging verbosity.
Default: INFOOptions: DEBUG, INFO, WARNING, ERROR, CRITICAL

TIF1_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: 100

TIF1_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):
  1. Programmatic configuration in code
  2. Environment variables
  3. .tif1rc in current directory
  4. .tif1rc in home directory
  5. Default values

Validation

Invalid configuration values raise a ConfigError 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.
Last modified on September 8, 2026