Skip to content

[Feature Request] Add Qwen3.5 architecture support #1136

Description

@aiindigo925

[Feature Request] Add Qwen3.5 architecture support

Summary

Requesting support for Qwen3.5 model architecture in mlx-lm. This would enable running Qwen3.5-27B, Qwen3.5-9B, Qwen3.5-4B and their fine-tunes on Apple Silicon with MLX quantization.

Motivation

Qwen3.5 series (especially 27B and 9B) are highly capable instruction-tuned models that rival Llama-3.1 and compete well with larger closed-source models. Popular use cases:

  • Agent workflows (Carnice-27B fine-tune with Hermes training)
  • Coding assistants (Qwen3.5-Coder variants)
  • General reasoning at efficient parameter counts

Currently these models cannot load due to qwen3_5 model type not being recognized.

Requested Models

Model Parameters Status
Qwen/Qwen3.5-27B 27B Native base
Qwen/Qwen3.5-9B 9B Native base
Qwen/Qwen3.5-4B 4B Native base
kai-os/Carnice-27b 27B Hermes-agent fine-tune
mlx-community/Qwen3.5-* Various MLX community quants

Error Reproduction

python (1/2)

from mlx_lm import load
model, tokenizer = load("Qwen/Qwen3.5-27B")

Error:

ValueError: Model type qwen3_5 not supported.

Full traceback:

File "mlx_lm/utils.py", line 71, in _get_classes
arch = importlib.import_module(f"mlx_lm.models.{model_type}")
ModuleNotFoundError: No module named 'mlx_lm.models.qwen3_5'

Environment

  • Device: Mac Studio M4 Max 128GB
  • OS: macOS 15.x
  • mlx-lm: 0.29.1
  • Python: 3.12

Related Architectures

Qwen3.5 appears to share some similarities with:

  • Qwen2/Qwen2.5 (already supported)
  • Llama architecture (grouped query attention, RMS norm)

Config.json structure (from kai-os/Carnice-27b):
json
{
"model_type": "qwen3_5",
"hidden_size": 6144,
"intermediate_size": 32768,
"num_hidden_layers": 36,
"num_attention_heads": 48,
"num_key_value_heads": 6,
"max_position_embeddings": 131072,
...
}

Offer to Help

We can:

  • Test any PR immediately on Mac Studio M4 Max
  • Provide benchmarks vs existing supported models (Llama-3.1, Qwen2.5)
  • Verify tool-calling accuracy with Hermes-style prompts
  • Share model weights analysis if helpful for implementation

Thank you for the excellent mlx-lm framework! 🙏

References

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