Skip to content

feat(models): port Moondream2 (SigLIP vision + Phi text + crop tiling) #522

Closed

Description

@inureyes

Summary

Add Moondream2 support. mlxcel has Moondream3 (a custom fused-QKV + sparse-MoE arch), but not Moondream2, which is architecturally distinct: a SigLIP vision tower + a Phi-style dense text model + an image-crop tiling preprocessor. A Moondream2 checkpoint currently errors "Unsupported model type" (src/models/detection.rs has only a moondream3 arm).

In-tree reuse

  • SigLIP encoder src/vision/encoders/siglip.rs + processor src/vision/processors/siglip.rs.
  • Phi text src/models/phi.rs / src/models/phi3.rs.
  • The Moondream3 crop preprocessor (src/vision/processors/moondream3.rs, global + overlapping local crops) is close in spirit; Moondream2's tiling is simpler and needs its own glue.

Scope

  • Add ModelType::Moondream2VLM + detection.rs arm for the moondream2 model_type.
  • Wire SigLIP encoder + Phi text backbone + a Moondream2 crop preprocessor + connector.
  • VL loader glue (mirror src/loading/vlm_special.rs load_moondream3_vlm).
  • Register across the arch/metadata tables; update docs/supported-models.md; add tests + validate on a real Moondream2 checkpoint.

Effort: low-medium (the heavy components already exist in-tree).

Activity

  1. added
    type:enhancement
    status:ready
    priority:medium
    area:models
    status:in-progress
    status:done
    and removed
    status:ready
    status:in-progress
    on Jul 1, 2026
  2. self-assigned this
    on Jul 4, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

area:modelspriority:mediumstatus:donetype:enhancement

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions