fix: text-only Qwen3.5/Qwen3.6 MoE checkpoints falsely auto-detected as VLM - #157
Merged
Merged
Conversation
…as VLM Fixes #156. qwen3_5 and qwen3_5_moe are registered as that exact model_type string in both LLMModelFactory (text_config only, no vision field at all) and VLMModelFactory (vision_config required) — the same ambiguity already fixed for gemma4 in #152. Matching on model_type alone routed every text-only checkpoint sharing that string (e.g. the reported destynova002/Qwen3.6-35B-A3B-mixed-3-4bit-3.85bpw-mlx, which has no vision_config) to a factory whose config decoder requires a field the checkpoint never has — a hard startup failure, not a degraded one. Removes qwen3_5/qwen3.5/qwen3_5_moe from knownVisionModelTypes; the existing vision_config-presence check already distinguishes the two correctly, and continues to catch genuine Qwen3.5-VL checkpoints (e.g. mlx-community/Qwen3.5-2B-4bit, which does carry a real vision_config even when used as a text-only speculative-decoding model in this repo's own CI — unaffected by this change). Reported with full root-cause diagnosis by @traderjoe1968.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes #156, reported and fully root-caused by @traderjoe1968.
qwen3_5/qwen3_5_moeare registered as that exactmodel_typestring in bothLLMModelFactory(text_config only, no vision field at all) andVLMModelFactory(vision_config required) — the identical ambiguity already fixed forgemma4in #152. Matching onmodel_typealone routed every text-only checkpoint sharing that string to the VLM factory, whose config decoder requires a field the checkpoint never has:Repro from the issue:
destynova002/Qwen3.6-35B-A3B-mixed-3-4bit-3.85bpw-mlx, a genuinely text-only checkpoint with novision_config.Fix
Removes
qwen3_5/qwen3.5/qwen3_5_moefromknownVisionModelTypes. The existingvision_config-presence check already distinguishes the two correctly, since only the VLM struct requires that field.Verified unaffected
mlx-community/Qwen3.5-2B-4bit— used as a text-only speculative-decoding model in this repo's own CI — genuinely carries avision_configin its checkpoint even in that role, confirmed by inspecting its cachedconfig.jsondirectly. It's still correctly detected as VLM-capable via the presence check, independent of this model-type-list removal, so this fix doesn't reopen or interact with the earlier--draft-model/--dflash/--mtpauto-detect guard from #152.Test plan
swift build --target SwiftLMsucceeds.