Entropic 2.3.8
Local-first agentic inference engine
Loading...
Searching...
No Matches
env_overrides.cpp File Reference

ENTROPIC_* environment variable override implementation. More...

#include <entropic/config/loader.h>
#include <entropic/types/logging.h>
#include <cstdlib>
Include dependency graph for env_overrides.cpp:

Go to the source code of this file.

Namespaces

namespace  entropic
 Activate model on GPU (WARM → ACTIVE).
 

Functions

static std::string entropic::config::get_env (const char *name)
 Get environment variable value or empty string.
 
static bool entropic::config::parse_bool (const std::string &val)
 Parse a boolean from string (true/false/yes/no/1/0).
 
template<typename Setter >
static void entropic::config::apply_env (const char *key, Setter setter)
 Apply one ENTROPIC_* override if the env var is set.
 
ENTROPIC_EXPORT void entropic::config::apply_env_overrides (ParsedConfig &config)
 Apply ENTROPIC_* environment variable overrides.
 

Variables

static auto s_log = entropic::log::get("config")
 

Detailed Description

ENTROPIC_* environment variable override implementation.

Version
1.8.1

Definition in file env_overrides.cpp.

Function Documentation

◆ apply_env()

template<typename Setter >
static void entropic::config::apply_env ( const char *  key,
Setter  setter 
)
static

Apply one ENTROPIC_* override if the env var is set.

Reads key; on a non-empty value logs it and hands it to setter. Collapses the repeated get/check/log/assign block so the dispatcher stays knots-clean.

Parameters
keyEnvironment variable name.
setterInvoked with the value when present. @utility
Version
2.3.7

Definition at line 55 of file env_overrides.cpp.

◆ apply_env_overrides()

void entropic::config::apply_env_overrides ( ParsedConfig config)

Apply ENTROPIC_* environment variable overrides.

Variable format: ENTROPIC_{SECTION}__{FIELD} (double underscore). Examples: ENTROPIC_LOG_LEVEL=DEBUG, ENTROPIC_ROUTING__ENABLED=true

Parameters
[in,out]configConfig to override.
Version
1.8.1
Parameters
[in,out]configConfig to override.
Version
2.3.7 @utility

Definition at line 68 of file env_overrides.cpp.

◆ get_env()

static std::string entropic::config::get_env ( const char *  name)
static

Get environment variable value or empty string.

Parameters
nameVariable name.
Returns
Value string, or empty if not set.

Definition at line 23 of file env_overrides.cpp.

◆ parse_bool()

static bool entropic::config::parse_bool ( const std::string &  val)
static

Parse a boolean from string (true/false/yes/no/1/0).

Parameters
valString value.
Returns
Parsed boolean.
Version
1.8.1 @utility

Definition at line 36 of file env_overrides.cpp.

Variable Documentation

◆ s_log

auto s_log = entropic::log::get("config")
static

Definition at line 12 of file env_overrides.cpp.