Expand description
Architecture configs. Prefer GGUF / config.json over preset defaults.
Unconfirmed preset fields must be listed in best_effort_fields.
What actually runs: docs/MODELS.md.
Structs§
- KdaConfig
- KDA (Kimi Delta Attention) hyperparameters, verified against Kimi
K3’s real
config.jsonlinear_attn_configblock and the real gated delta-rule reference implementation infla-org/flash-linear-attention’sfla/ops/kda/naive.py(the exact recurrence: decay state byexp(g), then add a rank-1beta * k ⊗ (v - kᵀS)correction, then reado = qᵀS) andfla/ops/kda/gate.py(the lower-bounded gate:g = gate_lower_bound * sigmoid(exp(A_log) * (raw_g + dt_bias)), andbeta = sigmoid(raw_beta)). - Kimi
Hybrid Attention - Kimi K3’s real attention topology, transcribed from the published
huggingface.co/moonshotai/Kimi-K3/config.json’slinear_attn_configblock.kda_layers/full_attn_layersare kept exactly as published – 1-indexed (layer 1 is the model’s first transformer layer), notferrox’s usual 0-indexedlayersslice – so a caller wiring this intoDecodermust subtract 1 before indexing. - MlaConfig
- Gated MLA (multi-head latent attention) hyperparameters, verified
against Kimi K3’s real
config.jsontext_configblock and the realKimiMLAAttentionreference implementation (modeling_kimi_linear.py). - MlaRope
Config - RoPE parameters for the decoupled
q_rot/k_rotslices of an MLA attention layer that does apply rotation (unlike Kimi K3 – seeMlaConfig::rope’s doc comment). Always the interleaved convention (ferrox_core::attention::apply_rope_interleaved) for every real architecture confirmed so far to use this (GLM-5.2’srope_interleave: true); a separate split-half variant isn’t wired in here since no confirmed real user of it exists yet. - Model
Config
Enums§
- Attention
Kind - Which attention mechanism a model uses.
Gqa(grouped-query attention + RoPE, uniform across every layer) is the only variantferrox-core/ferrox-models::decoderactually implement today – it’s what every preset runs through, including the two whose real published attention differs (DeepSeek V4 Pro’s CSA/HCA, Kimi K3’s hybrid KDA/Gated-MLA).KimiHybridexists so Kimi K3’s real, cited attention hyperparameters are captured accurately rather than silently discarded, even thoughDecoderitself still runs the GQA path for every layer (the dedicated Kimi decoder is the one consumer of the hybrid variant today). - FfnActivation
- Dense / expert FFN non-linearity used by the generic decoder.
- Layer
Attention Kind - Which concrete attention mechanism a single 0-indexed layer uses –
the resolved answer
Decoderneeds per layer once it dispatches onAttentionKindinstead of always running GQA (seeModelConfig::layer_attention_kind; only the dedicated Kimi decoder actually dispatches on it today). - Rope
Layout - Which RoPE pairing convention a model uses. Confirmed against
llama.cpp’s
llama_model_rope_type(src/llama-model.cpp):Normis adjacent-pair / GPT-J (LLAMA_ROPE_TYPE_NORM);Neoxis split-half / GPT-NeoX (LLAMA_ROPE_TYPE_NEOX). Getting this wrong silently produces fluent-but-wrong logits (the real Llama-3.1-8B early-stop bug: ferrox applied NeoX to a Norm architecture).
Constants§
- MODEL_
LEVEL_ TENSORS_ READ_ BY_ CONFIG - Model-level (not per-layer) tensors
ModelConfig::from_ggufreads.
Functions§
- deepseek_
v4_ pro - DeepSeek V4 Pro structural sketch only — CSA/HCA is not on this
GQA
Decoderpath. Real primitives live underdeepseek_v4_attention/hyper_connectionsand are not assembled into a served decoder yet. Hparams (~1.6T / ~49B active) are placeholders for smoke/bench. - glm_5_2
- GLM-5.2 (Z.ai) structural sketch only — not a supported real
inference path. Real DSA lives in
glm_dsa/glm52_decoderand is not wired intoDecoder/ferrox-server. This preset drives smoke/bench with synthetic GQA weights only (~744B / ~40B active hparams as published placeholders). - kimi_k3
- Kimi K3 structural sketch only for the generic GQA
Decoder. Real checkpoint work uses the dedicated Kimi stack (kimi_loader/KimiEngine); slice-verified, not a full end-to-end run. Do not treat this preset as a runnable Kimi substitute. - test_
dense_ fixture - Matches the generated on-disk fixture exactly (hidden_dim, head
counts, ffn_dim, vocab, rope_theta, eps).
Used by
ferrox inspect-runand the cross-validation test incrates/ferrox-models/tests/gguf_roundtrip.rsto prove the real GGUF loader + forward pass produce the same numbers as an independent NumPy reference implementation reading the same file. - test_
mixed_ fixture - Matches the generated on-disk mixed-topology fixture: 3 layers, the
first of which is
an ordinary dense FFN and the remaining two are genuine MoE (3
experts, top-1 routing, 1 shared expert each). Used to verify the
“leading dense layers” loading path
(
ModelConfig::layer_is_dense) against a real file – the pattern found in DeepSeek-2/3-family models via ik_llama.cpp’s source (LLM_KV_LEADING_DENSE_BLOCK_COUNT), which was previously only documented, not implemented or tested. - test_
moe_ fixture - Matches the generated on-disk multi-expert MoE fixture: 4 experts,
top-2 routing, 1 shared
expert, packed 3D expert tensors. Used to verify the previously-
untested multi-expert loading path (
split_expert_tensorinferrox-models::loader) against a real file, the same waytest_dense_fixtureverifies the single-expert path.