Skip to content

vox-hf-layout API Reference (generated)

Crate: vox-hf-layout · Version: 0.6.0 · Target: Library (lib.rs)

Shared Hugging Face config.json parsing for transformer layout (MENS / Candle plugins).

Minimal Hugging Face config.json parsing for architecture diagnostics and layout validation. SSOT for vox-populi MENS tensor code and vox-plugin-mens-candle-cuda.

DependencyKind
vox-bounded-fsNormal
StructDescription
ConfigDims—
HfTransformerLayoutStructured transformer layout from HF config.json (GPT-2, Qwen2-style, qwen3_5-style).
ParsedTransformerLayoutLayout + coarse [HfArchitecture] bucket (GPT-2 vs stacked causal LM field layout).
EnumDescription
HfArchitecture—
FunctionDescription
is_vision_or_mtp_keyTrue for tensor keys belonging to Qwen3.8-27B’s vision tower (model.visual.*) or its multi-token-prediction head (mtp.*) — neither is part of the text tower this crate extracts a layout for, and neither should be requested, downloaded, or validated against by a text-only QLoRA loader.
from_config_pathParse config.json at path into a structured layout.
from_config_json_strParse a config.json string (tests + tooling).
parse_transformer_layoutParse config.json and classify architecture for legacy CLI / tests.
detect_hf_architecture—
config_dims_for_architectureLoad [ConfigDims] from a Hugging Face config.json for arch. Prefer [HfTransformerLayout::from_config_path] for new code; this keeps older call sites stable.
Dependency Topology, diagram 16 nodes, 5 edges: vox-hf-layout → vox-bounded-fs; vox-plugin-mens-candle-… → vox-hf-layout; vox-plugin-mens-candle-… → vox-hf-layout; vox-plugin-mens-candle-… → vox-hf-layout; vox-populi → vox-hf-layoutvox-hf-layoutvox-bounded-fsvox-plugin-mens-candle-corevox-plugin-mens-candle-cudavox-plugin-mens-candle-metalvox-populi
Diagram source
graph {
direction: right
node vox_hf_layout: "vox-hf-layout"
node vox_bounded_fs: "vox-bounded-fs"
vox_hf_layout -> vox_bounded_fs
node vox_plugin_mens_candle_core: "vox-plugin-mens-candle-core"
vox_plugin_mens_candle_core -> vox_hf_layout
node vox_plugin_mens_candle_cuda: "vox-plugin-mens-candle-cuda"
vox_plugin_mens_candle_cuda -> vox_hf_layout
node vox_plugin_mens_candle_metal: "vox-plugin-mens-candle-metal"
vox_plugin_mens_candle_metal -> vox_hf_layout
node vox_populi: "vox-populi"
vox_populi -> vox_hf_layout
}
Consumer CrateRole
vox-plugin-mens-candle-coreDirect workspace dependent
vox-plugin-mens-candle-cudaDirect workspace dependent
vox-plugin-mens-candle-metalDirect workspace dependent
vox-populiDirect workspace dependent
KindSymbolSignatureSourceDescription
enumHfArchitecturepub enum HfArchitecturecrates/vox-hf-layout/src/lib.rs#L13-L16—
structConfigDimspub struct ConfigDimscrates/vox-hf-layout/src/lib.rs#L19-L24—
structHfTransformerLayoutpub struct HfTransformerLayoutcrates/vox-hf-layout/src/lib.rs#L28-L66Structured transformer layout from HF config.json (GPT-2, Qwen2-style, qwen3_5-style).
fnis_vision_or_mtp_keypub fn is_vision_or_mtp_key(key: &str) -> boolcrates/vox-hf-layout/src/lib.rs#L73-L75True for tensor keys belonging to Qwen3.8-27B’s vision tower (model.visual.*) or its multi-token-prediction head (mtp.*) — neither is part of the text tower this crate extracts a layout for, and neither should be requested, downloaded, or validated against by a text-only QLoRA loader.
fnfrom_config_pathpub fn from_config_path(path: &Path) -> anyhow::Result<Self>crates/vox-hf-layout/src/lib.rs#L79-L83Parse config.json at path into a structured layout.
fnfrom_config_json_strpub fn from_config_json_str(raw: &str) -> anyhow::Result<Self>crates/vox-hf-layout/src/lib.rs#L86-L89Parse a config.json string (tests + tooling).
structParsedTransformerLayoutpub struct ParsedTransformerLayoutcrates/vox-hf-layout/src/lib.rs#L356-L361Layout + coarse [HfArchitecture] bucket (GPT-2 vs stacked causal LM field layout).
fnparse_transformer_layoutpub fn parse_transformer_layout(path: &Path) -> anyhow::Result<ParsedTransformerLayout>crates/vox-hf-layout/src/lib.rs#L364-L379Parse config.json and classify architecture for legacy CLI / tests.
fndetect_hf_architecturepub fn detect_hf_architecture(config_path: &Path) -> anyhow::Result<HfArchitecture>crates/vox-hf-layout/src/lib.rs#L397-L402—
fnconfig_dims_for_architecturepub fn config_dims_for_architecture(crates/vox-hf-layout/src/lib.rs#L426Load [ConfigDims] from a Hugging Face config.json for arch. Prefer [HfTransformerLayout::from_config_path] for new code; this keeps older call sites stable.