|
Entropic 2.3.8
Local-first agentic inference engine
|
Config loader — YAML to C++ structs with validation. More...
#include <entropic/entropic_export.h>#include <entropic/types/config.h>#include <entropic/config/bundled_models.h>#include <filesystem>#include <string>

Go to the source code of this file.
Namespaces | |
| namespace | entropic |
| Activate model on GPU (WARM → ACTIVE). | |
Functions | |
| ENTROPIC_EXPORT std::string | entropic::config::load_config (const std::filesystem::path &global_path, const std::filesystem::path &project_path, const BundledModels ®istry, ParsedConfig &config) |
| Load config using layered resolution. | |
| ENTROPIC_EXPORT std::string | entropic::config::load_layered (const std::filesystem::path &project_dir, const std::filesystem::path &consumer_defaults, const BundledModels ®istry, ParsedConfig &config) |
| Load config with consumer defaults + global + project layers. | |
| ENTROPIC_EXPORT std::string | entropic::config::load_config_from_file (const std::filesystem::path &path, const BundledModels ®istry, ParsedConfig &config) |
| Load config from a single YAML file (no layering). | |
| ENTROPIC_EXPORT std::string | entropic::config::parse_config_file (const std::filesystem::path &path, const BundledModels ®istry, ParsedConfig &config) |
| Parse a config YAML file and overlay onto existing config. | |
| ENTROPIC_EXPORT void | entropic::config::apply_env_overrides (ParsedConfig &config) |
| Apply ENTROPIC_* environment variable overrides. | |
| ENTROPIC_EXPORT std::filesystem::path | entropic::config::resolve_data_dir (const ParsedConfig &config) |
| Resolve the bundled data directory. | |
| ENTROPIC_EXPORT std::string | entropic::config::load_config_from_string (const std::string &content, const BundledModels ®istry, ParsedConfig &config) |
| Load config from a YAML/JSON string (no layering). | |
Config loader — YAML to C++ structs with validation.
Loads configuration using layered resolution:
Definition in file loader.h.
| 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
| [in,out] | config | Config to override. |
| [in,out] | config | Config to override. |
Definition at line 68 of file env_overrides.cpp.
| std::string entropic::config::load_config | ( | const std::filesystem::path & | global_path, |
| const std::filesystem::path & | project_path, | ||
| const BundledModels & | registry, | ||
| ParsedConfig & | config | ||
| ) |
Load config using layered resolution.
Resolution order (highest wins):
| global_path | Path to global config file (may not exist). | |
| project_path | Path to project config file (may not exist). | |
| registry | Bundled models registry for path resolution. | |
| [out] | config | Output parsed config. |
| global_path | Path to global config file. | |
| project_path | Path to project config file. | |
| registry | Bundled models registry. | |
| [out] | config | Output parsed config. |
Definition at line 676 of file loader.cpp.
| std::string entropic::config::load_config_from_file | ( | const std::filesystem::path & | path, |
| const BundledModels & | registry, | ||
| ParsedConfig & | config | ||
| ) |
Load config from a single YAML file (no layering).
Load config from a single YAML file.
Applies compiled defaults first, then overlays the file. Used by entropic_configure_from_file().
| path | Path to YAML config file. | |
| registry | Bundled models registry for path resolution. | |
| [out] | config | Output parsed config. |
| path | Path to YAML config file. | |
| registry | Bundled models registry. | |
| [out] | config | Output parsed config. |
Definition at line 702 of file loader.cpp.
| std::string entropic::config::load_config_from_string | ( | const std::string & | content, |
| const BundledModels & | registry, | ||
| ParsedConfig & | config | ||
| ) |
Load config from a YAML/JSON string (no layering).
Load config from a YAML/JSON string with validation.
Parses the string with ryml (accepts both YAML and JSON since JSON is a YAML subset), applies env overrides, validates. Used by entropic_configure().
| content | Config string (YAML or JSON). | |
| registry | Bundled models registry for path resolution. | |
| [out] | config | Output parsed config. |
| content | Config string (YAML or JSON). | |
| registry | Bundled models registry. | |
| [out] | config | Output parsed config. |
Definition at line 1109 of file loader.cpp.
| std::string entropic::config::load_layered | ( | const std::filesystem::path & | project_dir, |
| const std::filesystem::path & | consumer_defaults, | ||
| const BundledModels & | registry, | ||
| ParsedConfig & | config | ||
| ) |
Load config with consumer defaults + global + project layers.
Load config with global → consumer defaults → project-local layering.
Resolution order (highest wins):
| project_dir | Project config directory (empty = skip project layer). | |
| consumer_defaults | Path to consumer defaults YAML (empty = skip). | |
| registry | Bundled models registry for path resolution. | |
| [out] | config | Output parsed config. |
Later layers override earlier ones (standard config-precedence semantics: more-specific wins). Order is:
~/.entropic/config.yaml) — personal defaults.default_config.yaml) — the app knows what it needs; overrides the user's global defaults.<project_dir>/config.local.yaml) — most specific.Prior to v2.0.6 consumer defaults loaded first and were overridden by the user's global config. That meant a user's aggressive global settings (e.g. context_length: 131072) would override an app's deliberate lightweight defaults (e.g. context_length: 16384) — reversing expected precedence semantics. Now consumer defaults win over global.
| project_dir | Project config directory. |
| consumer_defaults | Path to consumer defaults YAML. |
| registry | Bundled models registry. |
| config | Output config. |
Definition at line 1033 of file loader.cpp.
| std::string entropic::config::parse_config_file | ( | const std::filesystem::path & | path, |
| const BundledModels & | registry, | ||
| ParsedConfig & | config | ||
| ) |
Parse a config YAML file and overlay onto existing config.
Fields not present in YAML retain their current values. This is the merge primitive used for layered config loading.
| path | Path to YAML file. | |
| registry | Bundled models for path resolution. | |
| [in,out] | config | Config to overlay onto. |
Passes the bundled-models registry through to optional-section parsers so inference.speculative.draft_model can be resolved (bundled key or path) at parse time. (v2.1.11)
| path | Path to YAML file. | |
| registry | Bundled models for path resolution. | |
| [in,out] | config | Config to overlay onto. |
Definition at line 573 of file loader.cpp.
| std::filesystem::path entropic::config::resolve_data_dir | ( | const ParsedConfig & | config | ) |
Resolve the bundled data directory.
Priority:
| config | Parsed config. |
Priority (v2.0.5.1):
ENTROPIC_DATA_DIR env var (explicit operator override)config.config_dir / "data" (project-specific override)<prefix>/share/entropic derived from librentropic.so's on-disk location. Portable across install prefixes regardless of build-time CMAKE_INSTALL_PREFIX.CONFIG_ENTROPIC_DATA_DIR (compile-time install path, last resort; historically unreliable for relocated installs).CONFIG_ENTROPIC_SOURCE_DATA_DIR + CWD-relative data/ (development fallback when running from the build tree).First path that is_directory() on disk wins.
| config | Parsed config. |
Definition at line 81 of file data_dir.cpp.