Skip to main content

Module config

Module config 

Source
Expand description

Configuration file management for llmshim.

Config file location: ~/.llmshim/config.toml

Precedence (highest to lowest):

  1. Environment variables (OPENAI_API_KEY, etc.)
  2. ~/.llmshim/config.toml

Structs§

Config
The full config file structure.
Keys
ProxyConfig

Functions§

apply_to_env
Apply config keys as environment variables (only if not already set). This implements the precedence: env vars > config file.
config_dir
Get the config directory path (~/.llmshim/).
config_path
Get the config file path (~/.llmshim/config.toml).
load
Load config from ~/.llmshim/config.toml. Returns default if file doesn’t exist.
save
Save config to ~/.llmshim/config.toml. Creates the directory if needed.