RFC: Model naming consistency in LlmConfig#
Status: RFC
Author: Mahesh Madhavan
Last Update: 2026-06-10
Scope#
This RFC is scoped to the generic, backend-agnostic config in
extension/llm/export/config/llm_config.py — specifically BaseConfig and the
ModelType enum that backs base.model_class.
Motivation#
A single field, base.model_class (a ModelType enum), currently encodes two
different things at once, inconsistently:
Architecture/family — e.g.
llama3_2.A concrete model id — e.g.
qwen2_5_0_5b(the normalized HuggingFace name, which also drives auto-download viaHUGGING_FACE_REPO_IDS).static_llama- this doesn’t fall under either category, it’s not a family or a specific model id.
This RFC proposes segregating the two types into explicit fields so each has a single, clear meaning.
Proposal: two fields#
@dataclass
class BaseConfig:
- model_class: ModelType = ModelType.llama3
+ model_class: Optional[ModelType] = None
+ model_family: Optional[ModelFamily] = None
+ model_id: Optional[str] = None # concrete upstream HF id
params: Optional[str] = None
checkpoint: Optional[str] = None
...
model_family — the architecture#
An enum of architectures/versions only:
llama2,llama3,llama3_1,llama3_2,llama3_2_vision,qwen2_5etc.Optional. When provided, this would require the checkpoint and params.
model_id — the concrete-model id#
Optional string: the normalized upstream HuggingFace model name (
qwen2_5_0_5b,phi_4_mini).When
checkpointis provided along with themodel_id, download is skipped.When omitted, the
model_family+params+checkpointfully determine the export (today’s model_class behavior).
How the three weight/identity inputs relate#
Field |
Meaning |
Required |
Example |
|---|---|---|---|
|
which architecture/code path |
optional |
|
|
which concrete HF model |
optional |
|
|
explicit local weights (overrides |
optional |
|
|
architecture dims |
user-supplied |
|
model_class - existing field#
This will become optional - existing models will remain as-is, for backward compatibility
How it works — examples#
# Family + explicit local weights (today's Llama flow)
base:
model_family: llama3_2
params: /path/to/1b_config.json
checkpoint: /path/to/consolidated.00.pth
# Concrete id → auto-download the pinned HF checkpoint
base:
model_id: qwen2_5_0_5b # → Qwen/Qwen2.5-0.5B via HUGGING_FACE_REPO_IDS
params: examples/models/qwen2_5/config/0_5b_config.json
# Concrete id + checkpoint override (use local weights, keep the id label)
base:
model_id: qwen2_5_0_5b
checkpoint: /path/to/local.pth # overrides the download
params: /path/to/0_5b_config.json
The family alone is enough to export (with user params/checkpoint); model_id
adds concrete identity and enables HF auto-download.
Backward compatibility & migration#
The
model_classfield can stay for backward compatibility, but we could eventually deprecate the--modelarg.params,checkpoint, and all otherBaseConfigfields are unchanged.
Affected code#
extension/llm/export/config/llm_config.py—model_family(newModelFamilyenum) +model_id(str)examples/models/llama/export_llama_lib.py— readmodel_familyfor the code-path dispatch (:1599,:674) andmodel_idfor theHUGGING_FACE_REPO_IDSlookup (:672).
What we’re asking for#
Agreement on splitting
model_classintomodel_family(architecture) +model_id(concrete HF id).
Open questions#
Decision on
static_llama— under this split it is neither a family nor a model_id. It seems like this functionally behaves the same as llama3_2. Where should this live?Is the migration cost of a split justified, over just having an overloaded
ModelType, and supporting bothmodel_familyandmodel_idthrough the existingmodel_class(ModelType)?