Skip to content

mlx_lm.server --draft-model fails to load any Qwen3.6 MTP checkpoint (model_type qwen3_5_mtp not registered) #1462

Description

@h9q2cyxvgm-ui

Summary

mlx_lm.server --draft-model fails immediately at load time for every Qwen3.6 MTP drafter checkpoint I've tried, regardless of which target model it's paired with. The drafter's config.json declares model_type: "qwen3_5_mtp", which has no corresponding module in mlx_lm.models and no entry in MODEL_REMAPPING, so _get_classes() raises immediately, before any inference is attempted.

This is a different failure mode from #1292 (which is about truncated completions on an already-loaded MTP model); this one never gets the model loaded at all.

Affected versions

  • mlx-lm 0.31.3 (pip, current latest at time of writing)
  • mlx 0.31.2
  • macOS 26.4.1, Apple Silicon (M5 Max, 128GB)
  • Python 3.13

Affected models

  • Target: unsloth/Qwen3.6-27B-UD-MLX-6bit (loads fine standalone — model_type: qwen3_5)
  • Draft: mlx-community/Qwen3.6-27B-MTP-bf16 (model_type: qwen3_5_mtp — this is what fails)

Minimal reproduction

pip install mlx-lm==0.31.3
mlx_lm.server \
    --model unsloth/Qwen3.6-27B-UD-MLX-6bit \
    --host 127.0.0.1 --port 8082 \
    --draft-model mlx-community/Qwen3.6-27B-MTP-bf16

Observed output

Traceback (most recent call last):
  ...
  File ".../mlx_lm/server.py", line 695, in _generate
    self.model_provider.load_default()
  File ".../mlx_lm/server.py", line 385, in load_default
    self.load("default_model", None, "default_model")
  File ".../mlx_lm/server.py", line 363, in _load
    draft_model, draft_tokenizer = load(draft_model_path)
  File ".../mlx_lm/utils.py", line 491, in load
    model, config = load_model(model_path, lazy, model_config=model_config)
  File ".../mlx_lm/utils.py", line 334, in load_model
    model_class, model_args_class = get_model_classes(config=config)
  File ".../mlx_lm/utils.py", line 191, in _get_classes
    raise ValueError(msg)
ValueError: Model type qwen3_5_mtp not supported.

Root cause

mlx_lm/utils.py's _get_classes() does:

model_type = config["model_type"]
model_type = MODEL_REMAPPING.get(model_type, model_type)
arch = importlib.import_module(f"mlx_lm.models.{model_type}")

MODEL_REMAPPING has no qwen3_5_mtp entry, and there's no mlx_lm/models/qwen3_5_mtp.py. Checked the full registry directly (pkgutil.iter_modules(mlx_lm.models.__path__), 118 entries): nothing containing mtp exists at all, for any model family. So this isn't specific to this one checkpoint, it affects every Qwen3.6 MTP drafter on the Hub today, since none of them have a registered loader.

Expected output

The draft model should load and speculative decoding should proceed (or fail with something actionable at generation time, not at import time for a documented CLI flag).

Workaround

None found. mlx_vlm (a separate package) does have gemma4-family multimodal classes registered, but nothing for qwen3_5_mtp either. The MTPLX project (github.com/youssofal/MTPLX) reportedly works around this by implementing its own inference path for MTP heads instead of going through mlx_lm's standard model registry, rather than fixing the registry gap itself.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions