include/entropic/config/bundled_models.h

← API

include/entropic/config/bundled_models.h

entropic::config::BundledModelEntry

Entry in the bundled model registry.

std::string entropic::config::BundledModelEntry::key

Registry key (e.g., "primary")

std::string entropic::config::BundledModelEntry::name

Model filename stem (e.g., "Qwen3.5-35B-A3B-UD-IQ3_XXS")

std::string entropic::config::BundledModelEntry::url

Download URL.

double entropic::config::BundledModelEntry::size_gb

Model size in GB.

std::string entropic::config::BundledModelEntry::adapter

Adapter name (e.g., "qwen35")

std::string entropic::config::BundledModelEntry::description

Human-readable description.

std::string entropic::config::BundledModelEntry::mmproj_key

Paired mmproj registry key, or empty (gh#42, v2.1.8).

When non-empty, the base model is multimodal and ships with a vision-projector sibling at the named key (typically suffixed _mmproj). The entropic download CLI auto-fetches the paired entry; tier configs reference it via mmproj: <key>.

std::string entropic::config::BundledModelEntry::provider

e.g. "unsloth"

std::string entropic::config::BundledModelEntry::family

e.g. "qwen3_5", "gemma4", "nemotron3"

std::string entropic::config::BundledModelEntry::size_label

e.g. "0_8b", "2b", "4b", "9b", "e2b", "nano_4b"

std::string entropic::config::BundledModelEntry::quant

e.g. "Q8_0", "Q4_K_M", "UD-IQ4_XS"

entropic::config::BundledModels

Bundled model registry loaded from bundled_models.yaml.

std::string entropic::config::BundledModels::load(const std::filesystem::path &path)

Load registry from YAML file.

Parameters
  • path — Path to bundled_models.yaml.
Returns
Empty string on success, error message on failure.

bool entropic::config::BundledModels::contains(const std::string &key) const

Check if a key exists in the registry.

Parameters
  • key — Registry key.
Returns
true if key exists.

const BundledModelEntry * entropic::config::BundledModels::get(const std::string &key) const

Get entry by key.

Parameters
  • key — Registry key.
Returns
Pointer to entry, or nullptr if not found.

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. 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).

Parameters
  • value — Registry key or direct path string.
Returns
Resolved filesystem path.

const std::unordered_map< std::string, BundledModelEntry > & entropic::config::BundledModels::entries() const

Get all entries.

Returns
Reference to the entries map.

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. 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.

Parameters
  • family — Family label (e.g. "qwen3_5").
  • size_label — Size label (e.g. "4b").
  • quant — Quant label (e.g. "Q8_0").
Returns
  • Flat key string, or empty if no match.
  • Flat registry key of the first matching entry, or empty string.

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.

Returns
  • Empty string on success, error message if not found.
  • Empty string on success, error message if none found.