Generic config loader — return the ModelConfig for any name.
Use this when you only need the hyper-parameter dataclass for a registered model, without paying the cost of allocating its weights. Typical applications: introspecting layer widths, building parity tests, or feeding the config into a custom training loop.
Notes
AutoConfig is not instantiable — call
AutoConfig.from_pretrained directly. Resolution has two
fast paths:
- If the registry entry carries a
default_config(recommended for all Phase 1+ registrations), that config object is returned immediately — zero model construction. - Otherwise, the factory is invoked with
pretrained=Falseand the returned model's.configis read; no checkpoint is downloaded.
Local directories are also accepted: config.json is parsed and a
matching ModelConfig subclass is reconstructed via
ModelConfig.from_dict.
Examples
>>> from lucid.models import AutoConfig
>>> cfg = AutoConfig.from_pretrained("resnet_50")
>>> cfg.model_type
'resnet'
>>> cfg.num_classes
1000Used by 1
Constructors
1Class methods
1from_pretrained(name_or_path: str)Return the ModelConfig for name_or_path.
Parameters
name_or_pathstrRegistered model name (e.g.
"vit_base_16") or a directory
saved by PretrainedModel.save_pretrained.Returns
ModelConfigThe default configuration dataclass for that family (no weights are downloaded or instantiated).
Raises
ValueErrorIf the name is unknown to the registry.
FileNotFoundErrorIf a directory path is supplied but
config.json is absent.Notes
Resolution order:
default_configfast path — O(1) when the registry entry pre-declared one at@register_modeltime.- Factory fallback — invokes the factory with
pretrained=Falseand reads.configoff the resulting model. Still allocates parameters, but no checkpoint download.
Examples
>>> from lucid.models import AutoConfig
>>> cfg = AutoConfig.from_pretrained("bert_base")
>>> cfg.hidden_size
768