Integrate Qwen3.8 Flash Next loading and tokenizer behavior #94
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Area
Integrate the frozen Qwen3.8 Flash Next artifacts into DS4Server's model catalog, download/verification flow, tokenizer, chat formatting, and strict loader. This issue owns loading behavior completely; it does not implement transformer execution.
Sequence
Step 2 of 7. Previous: #93. Next: #95. Start only after #93 has frozen artifact hashes; #95 starts only after this loader contract is complete.
Implementation
qwen4expmetadata rather than filenames. Validate all fixed architecture values from the official config before allocating model memory: 48 layers in a 3 GDN + 1 full-attention cycle, hidden size 2560, GDN and QSA head geometry, rank-320 four-stream hyper-connections, 512/top-10 MoE, layer-2 PLE, MTP layout, vocabulary, and native context.Verification
Completion requirements
Non-goals
Define Qwen3.8 Flash Next artifacts and model contractto Integrate Qwen3.8 Flash Next loading and tokenizer behaviorImplemented and verified in commit
3773cfd(Integrate Qwen3.8 model intake).\n\nThe native model catalog and Model Manager now treat the pinned 29-file, 105,438,842,430-byte Bare Speed set as one resumable managed artifact with immutable revision URLs, per-file SHA-256 verification, partial recovery, strict promotion, re-verification, and complete removal. The Rust loader validates every frozen config/runtime pointer and all 2,527 tensor records, binds the 2,466 core, 3 PLE, and 58 MTP tensors separately, reports core/PLE/MTP/KV-recurrent/prefill memory classes, enforces the 262,144-token ceiling before allocation, and returns an explicit backend-unavailable result for #95.\n\nThe existing Rust tokenizer path now loads the pinned Qwen byte-level BPE, preserves exact special-token IDs and EOS/PLE reset boundaries, renders the official thinking/direct/tool/multi-turn ChatML contract, exposes only low/medium/xhigh/none, uses temperature 1.0, top-p 0.95, and top-k 20, and persists model/mode selection across restart. Qwen tool calls use the official nested function/parameter transport. Existing models retain their prior behavior.\n\nVerification: cargo fmt --all -- --check; cargo clippy --all-targets --all-features -- -D warnings; make bundle; cargo test --all-features (233 passed, 20 ignored, plus 4/4 artifact-tool tests). The pinned-source loader/chat golden test passed against /private/tmp/qwen38-bare-source. The isolated full managed-artifact test hashed all 105,438,842,430 bytes, rejected missing MTP before hashing, validated and reloaded the complete set, and removed it cleanly (682.42s). DS4 contains no Qwen3.8 implementation, so this is a new DS4Server feature. All implementation code is Rust; no C or Python code was introduced.