14namespace entropic::config {
23static std::string
get_env(
const char* name)
25 const char* val = std::getenv(name);
26 return val !=
nullptr ? std::string(val) :
"";
38 return val ==
"true" || val ==
"True" || val ==
"TRUE"
39 || val ==
"yes" || val ==
"1";
54template <
typename Setter>
55static void apply_env(
const char* key, Setter setter) {
57 if (val.empty()) {
return; }
58 s_log->info(
"Env override: {}={}", key, val);
71 [&](
const std::string& v) { config.
log_level = v; });
75 [&](
const std::string& v) {
78 apply_env(
"ENTROPIC_ROUTING__FALLBACK_TIER",
80 apply_env(
"ENTROPIC_COMPACTION__THRESHOLD_PERCENT",
81 [&](
const std::string& v) {
85 [&](
const std::string& v) {
89 [&](
const std::string& v) {
93 [&](
const std::string& v) {
static bool parse_bool(const std::string &val)
Parse a boolean from string (true/false/yes/no/1/0).
static void apply_env(const char *key, Setter setter)
Apply one ENTROPIC_* override if the env var is set.
static std::string get_env(const char *name)
Get environment variable value or empty string.
Config loader — YAML to C++ structs with validation.
ENTROPIC_EXPORT void apply_env_overrides(ParsedConfig &config)
Apply ENTROPIC_* environment variable overrides.
spdlog initialization and logger access.
ENTROPIC_EXPORT std::shared_ptr< spdlog::logger > get(const std::string &name)
Get or create a named logger.
float threshold_percent
Compaction trigger (0.5–0.99)
bool enabled
Enable auto-compaction.
std::string default_tier
Default tier name.
Full parsed configuration.
int vram_reserve_mb
Reserved VRAM headroom (MB, 0–65536)
CompactionConfig compaction
Auto-compaction settings.
RoutingConfig routing
Routing rules.
ModelsConfig models
Tiers + router.
std::string log_level
Log level string.
std::filesystem::path config_dir
Config dir — base for bundled data discovery.
std::string fallback_tier
Fallback when routing fails.
bool enabled
Enable routing.