Loads llm_core configuration files (routing, providers, etc.) from disk and updates the store.
Handles the full TOML loading pipeline: reading multiple config layers, deep-merging, resolving environment variable placeholders, normalizing provider definitions, and broadcasting change notifications to dependent processes.
Configuration Layers (later overrides earlier)
- Compiled defaults —
priv/config/llm_core.toml(bundled with the library) - Global override —
~/.llm_core/config/llm_core.toml - Project override —
<project>/.llm_core/llm_core.toml - Environment variable — path in
LLM_CORE_CONFIG - Custom path — explicit
:pathoption
Environment Variable Interpolation
TOML values like "${ANTHROPIC_API_KEY}" are resolved at load time.
Supports defaults: "${OLLAMA_URL:http://localhost:11434}".
Key Functions
reload_providers/1— Full TOML load + provider normalization + store updatereload_routing/1— Load and apply routing rules onlyload_config/1— Read merged TOML without mutating runtime state
Summary
Functions
Returns the merged TOML configuration without mutating runtime state.
Loads the routing configuration from disk without mutating the store.
Loads TOML configuration (providers, memory, routing defaults) and writes the normalized provider metadata to the runtime store.
Loads the routing configuration and writes it to the runtime store. Broadcasts change notifications so dependent processes can refresh.
Functions
Returns the merged TOML configuration without mutating runtime state.
@spec load_routing(keyword()) :: {:ok, LlmCore.Router.RoutingTable.t()} | {:error, term()}
Loads the routing configuration from disk without mutating the store.
@spec reload_providers(keyword()) :: {:ok, %{optional(String.t()) => LlmCore.Provider.Definition.t()}} | {:error, term()}
Loads TOML configuration (providers, memory, routing defaults) and writes the normalized provider metadata to the runtime store.
@spec reload_routing(keyword()) :: {:ok, LlmCore.Router.RoutingTable.t()} | {:error, term()}
Loads the routing configuration and writes it to the runtime store. Broadcasts change notifications so dependent processes can refresh.
When routing.yml is missing, the existing Store routing is preserved
(e.g. a table already installed from TOML via reload_providers/1). Only
when the Store has no routing at all does the safe default => claude
fallback get installed.