|
Entropic 2.3.8
Local-first agentic inference engine
|
Bundled model registry loaded from bundled_models.yaml. More...
#include <entropic/config/bundled_models.h>
Public Member Functions | |
| std::string | load (const std::filesystem::path &path) |
| Load registry from YAML file. | |
| bool | contains (const std::string &key) const |
| Check if a key exists in the registry. | |
| const BundledModelEntry * | get (const std::string &key) const |
| Get entry by key. | |
| std::filesystem::path | resolve (const std::string &value) const |
| Resolve a model reference to a filesystem path. | |
| const std::unordered_map< std::string, BundledModelEntry > & | entries () const |
| Get all entries. | |
| std::string | find_by (const std::string &family, const std::string &size_label, const std::string &quant) const |
| Look up a registry key by (family, size, quant) (gh#62). | |
| std::string | auto_discover_and_load () |
| Auto-discover and load bundled_models.yaml. | |
Bundled model registry loaded from bundled_models.yaml.
Definition at line 77 of file bundled_models.h.
| std::string entropic::config::BundledModels::auto_discover_and_load | ( | ) |
Auto-discover and load bundled_models.yaml.
Searches compile-time install path, source tree path, and CWD-relative "data/" for bundled_models.yaml. Loads the first one found.
Discovery order (mirrors data_dir.cpp::resolve_data_dir): ENTROPIC_DATA_DIR env, then binary-relative via dladdr (<prefix>/share/entropic from librentropic.so's location), then the compile-time install path, source tree, and CWD-relative "data/" fallbacks. The dladdr step makes the registry findable on any install prefix, not just the build host.
Definition at line 267 of file bundled_models.cpp.
| bool entropic::config::BundledModels::contains | ( | const std::string & | key | ) | const |
Check if a key exists in the registry.
| key | Registry key. |
| key | Registry key. |
Definition at line 129 of file bundled_models.cpp.
| const std::unordered_map< std::string, BundledModelEntry > & entropic::config::BundledModels::entries | ( | ) | const |
Get all entries.
Definition at line 248 of file bundled_models.cpp.
| std::string entropic::config::BundledModels::find_by | ( | const std::string & | family, |
| const std::string & | size_label, | ||
| const std::string & | quant | ||
| ) | const |
Look up a registry key by (family, size, quant) (gh#62).
gh#62: look up a flat key by (family, size_label, quant).
Returns the flat key of the first matching entry, or empty string if no entry matches. All three selectors must match exactly. Intended for consumers that want to express their tier config as "qwen3_5 / 4b / Q8_0" without remembering the historical flat key.
Until the bundled_models.yaml is fully backfilled with family/size_label/quant on every entry, this query will return "" for entries that don't yet declare them — callers should fall back to direct key lookup.
| family | Family label (e.g. "qwen3_5"). |
| size_label | Size label (e.g. "4b"). |
| quant | Quant label (e.g. "Q8_0"). |
Linear scan — entries_.size() is small (< 100 in practice). All three selectors are required and matched exactly. Returns empty string when no entry matches OR when the matching entries haven't been backfilled with structured metadata yet.
Definition at line 161 of file bundled_models.cpp.
| const BundledModelEntry * entropic::config::BundledModels::get | ( | const std::string & | key | ) | const |
Get entry by key.
| key | Registry key. |
| key | Registry key. |
Definition at line 141 of file bundled_models.cpp.
| std::string entropic::config::BundledModels::load | ( | const std::filesystem::path & | path | ) |
Load registry from YAML file.
| path | Path to bundled_models.yaml. |
| path | Path to bundled_models.yaml. |
Definition at line 95 of file bundled_models.cpp.
| std::filesystem::path entropic::config::BundledModels::resolve | ( | const std::string & | value | ) | const |
Resolve a model reference to a filesystem path.
If value matches a registry key, returns ~/models/gguf/{name}.gguf. Otherwise treats value as a direct path with ~ expansion.
| value | Registry key or direct path string. |
If the argument is a known registry key, walk the v2.0.5 discovery order:
ENTROPIC_MODEL_DIR env var — if set, wins unconditionally (operator intent), even if the file doesn't exist there yet. This lets the caller pre-specify a download destination.~/.entropic/models/<name>.gguf (user convention)/opt/entropic/models/<name>.gguf (system convention)For 2 and 3, first directory that actually contains <name>.gguf wins; if neither exists on disk, #2 is returned so error messages point at the most-likely-intended location.
Otherwise the argument is treated as a direct path (with ~-expansion).
| value | Registry key or direct path string. |
Definition at line 199 of file bundled_models.cpp.