Expand description
2026-09-26: The typed model config (ModelConfig) parsed from a checkpoint’s config.json
or GGUF metadata, its capabilities, and the METRALE_* lever table.
Owner: config. Invariants: none beyond the types.
Re-exports§
pub use activation_quantization::ActQuantFormat;pub use activation_quantization::ActivationQuantization;pub use activation_quantization::ProjFamily;pub use precision_plan::DeclaredPrecisionPlan;pub use precision_plan::LayerPrecision;pub use weight_quantization::Nvfp4Act;pub use weight_quantization::W4a4Downcast;pub use weight_quantization::WeightQuantPolicy;pub use weight_quantization::WeightQuantTier;pub use weight_quantization::WeightQuantization;
Modules§
- activation_
quantization - 2026-09-30:
--activation-quantization: which activation precision each decode projection runs at, as a function of the projection family and of the number of rows in the launch (decode batch rows, MTP verify rows included). - capabilities
- 2026-09-26: Feature flags derived from a parsed
ModelConfigbyModelConfig::capabilities. - levers
- 2026-09-26: Every
METRALE_*environment variable the repository reads, declared once. - precision_
plan - 2026-09-28: The declared precision plan: what a checkpoint’s
quantization_configdeclares, per linear layer, for the weight AND the input activations. - recipe_
yaml - 2026-09-26: A small YAML reader for recipe files; the workspace has no YAML dependency.
- weight_
quantization - 2026-09-28:
--weight-quantization: the precision each linear layer runs at, and the one policy that loaders and kernel dispatch ask for it.
Structs§
- Gguf
Config Inputs - 2026-09-26: Inputs to
config_from_gguf: the metadata reader plus two facts from the tensor section. - Model
Config - Peft
Adapter Config - 2026-09-26: The fields of a PEFT
adapter_config.jsonthat the engine uses, as validated byparse_peft_adapter_config.lora_dropout, a training-only setting, is ignored. - Quantization
Config - 2026-09-26: The weight-quantization block of a checkpoint config (
quantization_config, into which the server merges a siblinghf_quant_config.json), as read byparse_quantization_config. That parser returnsNonewhen the block declares no method, algorithm or ignore list. - Vision
Config - 2026-09-26: Vision tower configuration:
parse_vision_configfor the Qwen family, and the GLM-5.3 parser, which also fills the fields the Qwen parser leaves at their defaults.
Enums§
- Attn
Position Encoding - 2026-09-29: What full attention does to Q and K before the dot product.
- Glm5
Next Router Mode - 2026-09-26: Which dtype ladder GLM-5.3’s MoE router runs in. The glm5_next parser reads
moe_router_dtypeand usesHfFp32when it is absent. - Layer
Type
Constants§
- PEFT_
SUPPORTED_ TARGET_ MODULES - 2026-09-26: The module names (last
.-segment of atarget_modulesentry) this parser accepts;validate_target_modulealso accepts the MoE router leafgate. On a gated-attention modelq_projis the whole Q-and-gate projection,2 * num_attention_heads * head_dimwide (metrale_model_layersLoraModule::dims). Which layers a module may target is decided per tensor byclassify_keyin the same crate.
Traits§
- Gguf
Meta - 2026-09-26: Typed read access to GGUF metadata. Integer getters widen to u64 and float
getters to f64. A getter returns
Nonewhen the key is absent or holds another value type; the builder decides whether absence is an error or has a fallback.
Functions§
- allow_
partial_ targets - 2026-09-26:
METRALE_LORA_ALLOW_PARTIAL(1ortrue, any case), read once per process: load an adapter that names target modules the engine cannot apply, skipping those. - config_
from_ gguf - 2026-09-26: Build a
ModelConfigfrom GGUF metadata and validate it withfinalize_config. - glm5_
next_ mtp_ layer_ index - 2026-09-26: The layer index of the MTP layer:
num_hidden_layers, one past the text stack, whichnum_hidden_layerscounts alone. - glm_
vision_ enabled - 2026-09-26: Whether GLM-5.3’s vision tower is enabled for this process
(
METRALE_GLM_VISION, seeglm_vision_enabled_from); off by default. - glm_
vision_ enabled_ from - 2026-09-26: The policy half of
glm_vision_enabled, taking the value instead of reading the environment, so tests need not set a variable. Only1,true,yesoron(trimmed, any case) enable; anything else, unset included, leaves the tower off. - parse_
config - 2026-09-26: Parse a checkpoint
config.jsoninto aModelConfig: the family parse, theneos_token_idsfrom every declared stop id, then the Kimi-K3 stop-set clean-up. - parse_
mistral_ params - parse_
peft_ adapter_ config - 2026-09-26: Parse a PEFT
adapter_config.jsonpayload. - parse_
quantization_ config - 2026-09-28:
Ok(None)when there is no block or it declares nothing; an error when the block’s precision declaration is malformed (DeclaredPrecisionPlan).