Skip to main content

Overview

The Config API provides a centralized way to manage Strix configuration through environment variables and persistent settings.

Config Class

Main configuration manager for Strix.

Class Variables

Configuration defaults stored as class attributes:
str | None
default:"None"
LLM model name
str | None
default:"None"
API key for LLM provider
str | None
default:"None"
Custom API base URL
str
default:"'high'"
Reasoning effort: “low”, “medium”, or “high”
str
default:"'5'"
Maximum retry attempts
str
default:"'300'"
Request timeout in seconds
str
default:"'ghcr.io/usestrix/strix-sandbox:0.1.12'"
Docker image for sandboxes
str
default:"'docker'"
Runtime backend (currently only “docker”)
str
default:"'120'"
Tool execution timeout in seconds
str
default:"'1'"
Enable/disable telemetry

Methods

get

Gets a configuration value from environment or defaults.
str
required
Configuration key in lowercase (e.g., “strix_llm”)
str | None
Configuration value or None
Example:

config_dir

Returns the configuration directory path.
Path
Path to ~/.strix directory
Example:

config_file

Returns the configuration file path.
Path
Path to ~/.strix/cli-config.json

load

Loads configuration from the config file.
dict[str, Any]
Configuration dictionary
Example:

save

Saves configuration to the config file.
dict[str, Any]
required
Configuration dictionary to save
bool
True if successful, False otherwise
Example:

apply_saved

Applies saved configuration to environment variables.
bool
default:"False"
Force apply even if environment variables are already set
dict[str, str]
Dictionary of applied environment variables
Example:

save_current

Saves current environment variables to the config file.
bool
True if successful
Example:

tracked_vars

Returns list of tracked environment variable names.
list[str]
List of uppercase environment variable names
Example:

Helper Functions

apply_saved_config

Applies saved configuration to environment.
bool
default:"False"
Force apply variables
dict[str, str]
Applied variables

save_current_config

Saves current environment to config file.
bool
True if successful

resolve_llm_config

Resolves LLM configuration from environment.
tuple[str | None, str | None, str | None]
Tuple of (model_name, api_key, api_base)
Example:

Configuration File Format

The config file is stored at ~/.strix/cli-config.json:

Environment Variables

LLM Configuration

str
required
Model name (e.g., “claude-3-5-sonnet-20241022”)
str
required
API key for the provider
str
default:"None"
Custom API base URL
str
default:"None"
OpenAI-specific API base
str
default:"None"
LiteLLM base URL
str
default:"None"
Ollama API base
str
default:"'high'"
Reasoning effort for o1 models: “low”, “medium”, “high”
str
default:"'5'"
Maximum retry attempts
str
default:"'30'"
Memory compression timeout in seconds
str
default:"'300'"
Request timeout in seconds

Runtime Configuration

str
default:"'ghcr.io/usestrix/strix-sandbox:0.1.12'"
Docker image for sandboxes
str
default:"'docker'"
Runtime backend
str
default:"'120'"
Tool execution timeout in seconds
str
default:"'10'"
Connection timeout in seconds

Feature Configuration

str
default:"None"
API key for Perplexity web search
str
default:"'false'"
Disable browser tools
str
default:"'1'"
Enable telemetry (1 or 0)

Usage Examples

Basic Configuration

Persistent Configuration

Custom Configuration File

Checking Configuration