You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
VLM (Vision-Language Model) Support Roadmap ( Est days should be ignored :), my local models - Antigravity is scary me )...
SwiftLM currently supports VLM inference via the --vision flag, routing image+text requests through the OpenAI-compatible /v1/chat/completions endpoint with standard base64 image payloads.
This document tracks which vision architectures are supported, which are planned, and the porting effort required.
Current VLM Support Matrix
Model Family
model_type
Swift VLM
Priority
Effort
Qwen2-VL
qwen2_vl
✅
—
—
Qwen2.5-VL
qwen2_5_vl
✅
—
—
Qwen3-VL
qwen3_vl
✅
—
—
Qwen3.5
qwen3_5
✅
—
—
Qwen3.5 MoE
qwen3_5_moe
✅
—
—
Gemma 3
gemma3
✅
—
—
PaliGemma
paligemma
✅
—
—
Idefics3
idefics3
✅
—
—
SmolVLM2
smolvlm
✅
—
—
FastVLM
fastvlm
✅
—
—
Pixtral
pixtral
✅
—
—
Mistral 3
mistral3
✅
—
—
LFM2-VL
lfm2_vl
✅
—
—
GLM-OCR
glm_ocr
✅
—
—
Total: 14 VLM architectures currently supported in Swift.
Planned VLM Ports
Phase 1 — High Priority (Popular models, strong community demand)
Model Family
model_type
Notes
Est. Effort
Gemma 4
gemma4
LLM text layer already in MLXLLM/Gemma4.swift. Vision requires new 2D-RoPE, ClippableLinear, VisionPooler, PatchEmbedder.
Top-level model that wires vision → projector → language model
Create a processor (<Model>Processor) for image preprocessing
Register the model_type string in VLMTypeRegistry.shared and VLMProcessorTypeRegistry.shared inside VLMModelFactory.swift
Test with python3 test_vlm.py <model-id>
Shared Infrastructure Already Built
✅ Base64 image decoding in Server.swift
✅ CIImage → MLXArray pixel conversion pipeline
✅ OpenAI-compatible multi-part content parsing
✅ --vision CLI flag and VLM/LLM factory routing
✅ SSD streaming + PAPPS compatible with VLM weight loading
Key Decision: Upstream Sync Strategy
Important
The upstream Apple ml-explore/mlx-swift-lm repo also adds new VLM architectures over time.
Before porting a model, always check if Apple has already added it upstream.
Use the /mlx-upstream-sync workflow to pull new models from upstream before writing custom ports.
Test Validation
All VLM ports must pass the automated test_vlm.py pipeline:
python3 test_vlm.py "mlx-community/<model-id>"
This downloads a 256×256 test image, spins up SwiftLM with --vision, fires a base64-encoded inference request, and validates the JSON response contains a valid choices[0].message.content field.
Activity
solderzzc commentedon Apr 7, 2026
Sure, that will be enabled for sure.
-Thanks for asking. I'm heavily working on a MAC/IOS application so we later could feed audio in.
notatestuser commentedon Apr 10, 2026
What about vision (image inputs)?
solderzzc commentedon Apr 10, 2026
@notatestuser
After checking the code base, I realized the vision is not working out-of-box :) This is definitely a must have, will implement it for sure.
solderzzc commentedon Apr 10, 2026
VLM (Vision-Language Model) Support Roadmap ( Est days should be ignored :), my local models - Antigravity is scary me )...
SwiftLM currently supports VLM inference via the
--visionflag, routing image+text requests through the OpenAI-compatible/v1/chat/completionsendpoint with standardbase64image payloads.This document tracks which vision architectures are supported, which are planned, and the porting effort required.
Current VLM Support Matrix
model_typeqwen2_vlqwen2_5_vlqwen3_vlqwen3_5qwen3_5_moegemma3paligemmaidefics3smolvlmfastvlmpixtralmistral3lfm2_vlglm_ocrTotal: 14 VLM architectures currently supported in Swift.
Planned VLM Ports
Phase 1 — High Priority (Popular models, strong community demand)
model_typegemma4MLXLLM/Gemma4.swift. Vision requires new 2D-RoPE, ClippableLinear, VisionPooler, PatchEmbedder.llama4mistral4phi4_siglipdeepseek_vl_v2Phase 2 — Medium Priority (Emerging models, specialized use cases)
model_typegemma3nkimi_vlmolmo/molmo2internvl_chathunyuan_vlgranite4_visionaya_visionphi3_vPhase 3 — OCR / Specialized Models
model_typedeepseekocrfalcon_ocrflorence2sam3/sam3_1moondream3glm4v_moePhase 4 — Long Tail
model_typellavallava_nextllava_bunnyidefics2jina_vlmminicpmoqwen3_vl_moeqwen3_omni_moepaddleocr_vlfalcon_perceptionrfdetrernie4_5_moe_vldots_ocrphi4mmPorting Methodology
Each VLM port follows the same pattern:
<model_type>Libraries/MLXVLM/Models/<Model>.swiftwith:<Model>Processor) for image preprocessingmodel_typestring inVLMTypeRegistry.sharedandVLMProcessorTypeRegistry.sharedinsideVLMModelFactory.swiftpython3 test_vlm.py <model-id>Shared Infrastructure Already Built
Server.swiftCIImage→ MLXArray pixel conversion pipeline--visionCLI flag and VLM/LLM factory routingKey Decision: Upstream Sync Strategy
Important
The upstream Apple
ml-explore/mlx-swift-lmrepo also adds new VLM architectures over time.Before porting a model, always check if Apple has already added it upstream.
Use the
/mlx-upstream-syncworkflow to pull new models from upstream before writing custom ports.Test Validation
All VLM ports must pass the automated
test_vlm.pypipeline:python3 test_vlm.py "mlx-community/<model-id>"This downloads a 256×256 test image, spins up SwiftLM with
--vision, fires a base64-encoded inference request, and validates the JSON response contains a validchoices[0].message.contentfield.solderzzc commentedon Apr 10, 2026
@notatestuser , @hiro-v , I've added Audio / Image /Vision support with this commit.
822aaca
solderzzc commentedon Apr 10, 2026
Vision support is on the way.
moodler commentedon Apr 12, 2026
What's the noise/junk characters there?
solderzzc commentedon Apr 12, 2026
They are UI template ... It's not generated by the model.
solderzzc commentedon Apr 15, 2026
SwiftLM.OMNI.Pipeline.mp4