Decision 5 superseded (2026-07-20): mlx-lm implements DeepSeek V3/V3.2/V4 natively on MLX using safetensors with standard mlx ops - no GGUF or ds4 engine needed. Port from mlx-lm's deepseek_v3.py / deepseek_v32.py + mla.py, not from ds4.zig. Target checkpoint: mlx-community/DeepSeek-V4-Flash-4bit. The Stage A safetensors loader works. Also: qwen3_5_moe is the separate MODEL_QWEN3_5_MOE enum value from Stage A1. See spec - Resolved design decisions.
Decision 11 (2026-07-20): do not collapse DeepSeek variants into MODEL_DEEPSEEK_V4. mlx-lm keeps separate modules; V3.2 adds a DSA Indexer + dual cache (real forward/cache fork). Enum grain:
deepseek_v3 -> MODEL_DEEPSEEK_V3 (MLA + MoE)
deepseek_v3_2 / deepseek_v32 -> MODEL_DEEPSEEK_V32 (MLA + MoE + DSA)
deepseek_v4 -> MODEL_DEEPSEEK_V4 (own value; characterize Flash before any alias)
Shared code is primitives (fwd_mla_*, MoE gate, sanitize), not one family tag. A1 interim debt still maps all four strings to MODEL_DEEPSEEK_V4 - correct before or at start of E2 (#109). Reject messages must name the actual family.
E1 (#104)
├─ #107 fwd_moe
└─ #108 DeepSeek MoE gate
│
▼
E2 (#105) ─────────────────────────────────────┐
├─ #109 family split + config (first) │
├─ #110 MultiLinear ──► #111 MLA+cache │
├─ #112 sanitize │
├─ #113 V3 forward ◄── E1, #111, #112 │
├─ #114 V3.2 DSA ◄── #111, #113 │
├─ #115 V4 ◄── #113 (+ characterization) │
└─ #116 parity ◄── as families land │
│
E3 (#106) (MoE part needs E1; hybrid is local) │
├─ #117 hybrid cache + gate unify │
├─ #118 qwen3_5_moe ◄── E1, #117 │
├─ #119 lfm2 ◄── #117 │
├─ #120 nemotron_h ◄── #117 │
└─ #121 parity ◄── as families land │
Epic: Stage E - MoE + hybrid families
The two non-dense forward paths from the reference:
forwardMoeWith(expert dispatch viamlx_gather_qmm/mlx_gather_mm) andforwardHybridWith(conv/SSM layers with their own cache entries). Green + demoable: all remaining generate families pass parity gates.Spec:
doc/plans/engine-inference-core.md§ Stage EPart of: #51
Depends on: Stage D (#55, done)
Phases
E1 - MoE infrastructure
fwd_moe)E2 - DeepSeek V3 / V3.2 / V4 (MLA + MoE; separate families)
fwd_multi_linear)weights_expected_namesE3 - qwen3_5_moe, lfm2, nemotron_h
Dependency sketch
Tracking notes (from prior #56 comments)
weights_expected_names()(PR feat(engine): stage A - loading foundations (mlxbridge safetensors surface, weight loader) #62 pattern). Owned by E2: DeepSeek weight sanitization + weights_expected_names #112 (DeepSeek) and per-family E3 issues (E3: qwen3_5_moe (linear attention + MoE FFN) #118-E3: nemotron_h (mamba-style SSM + attention/MLP) #120).Out of scope (still under #51, not Stage E)