Repository navigation
Studio MLX: refuse an architecture the installed mlx-vlm and mlx-lm cannot build, before the download - #19003
Merged
Merged
Conversation
…g.json, before the download Inkling 2 Mini MLX (mlx-community/Inkling-2-Mini-4bit, model_type inkling2_loop) failed after its 17 GB download with mlx-vlm's raw registry error, whose tail (No module named 'mlx_vlm.speculative.drafters.inkling2_loop') reads like a drafter load. mlx-vlm 0.8.0, the newest release and Studio's pin ceiling, builds Inkling 2 Small only; Mini landed on mlx-vlm main after it. The MLX load now checks config.json against the installed mlx-vlm and mlx-lm module registries and refuses up front with a message naming the GGUF build; an inconclusive check never refuses. The load route rewrites the libraries' own Model type X not supported error the same way. Fixes #18972
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
1 of 5 tasks
Member
Author
|
@codex review |
|
Codex Review: Didn't find any major issues. 👍 Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
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.
Fixes #18972.
What happened
Loading
mlx-community/Inkling-2-Mini-4biton Apple Silicon downloads about 17 GB, then fails with:Both lines in the report come from one call, mlx-vlm's
get_model_and_args. It looks for the model type inmlx_vlm.modelsand then inmlx_vlm.speculative.drafters, and the ImportError it appends is from that second lookup. Studio never tried to load an Inkling drafter here. Studio's own drafter checks (mlx_speculative.has_builtin_head, unsloth-zoo's_native_mtp_head) already catch import errors, and they look for MTP weights, which this checkpoint does not ship (its README says the DSpark draft is not included).The real problem is that no released mlx-vlm or mlx-lm can build
inkling2_loop:studio/install_python_stack.py_MLX_VLM_SPEC = "mlx-vlm>=0.6.4,<=0.8.0", same range inutils/mlx_repair.py). It hasmodels/inkling2from Add Inkling 2 Neywa-Labs/mlx-vlm#2738, which covers Inkling 2 Small (model_type: inkling2). It has noinkling2_loopentry inMODEL_REMAPPING."inkling2_loop": "inkling2") came in Add Inkling 2 Mini model Neywa-Labs/mlx-vlm#2778, merged 2026-11-20, after 0.8.0. It is on main and not released yet.So a pin bump cannot fix this today.
Change
New
core/inference/mlx_model_support.py. It readsconfig.jsonand checks whether the installed mlx-vlm (get_model_type, falling back toMODEL_REMAPPING, then afind_specin both packages its loader searches) or mlx-lm (model_package, falling back toMODEL_REMAPPING) has a module for the checkpoint's architecture. If the check can't decide (no config, a checkpoint-localmodel_file, a library that won't import, a resolver that raises), it returns None, so it never blocks a load.MLXInferenceBackend.load_modelruns this check right after the GGUF guard. That is beforeFastMLXModel.from_pretrained, so nothing is downloaded. When neither library has the architecture, the load fails with:Other architectures get a generic hint instead (update later, or use a GGUF build).
routes/inference.py_maybe_unsupported_messagealso rewrites the libraries' ownModel type X not supportederror into the same message. This covers loads where the check could not decide. The text avoids_NOT_SUPPORTED_HINTS, so the route does not wrap it again.When an mlx-vlm that maps
inkling2_loopis installed, the check passes and the load goes ahead. I checked this against mlx-vlm main at 36565bc1.The model hub does not list or recommend this MLX repo, so nothing changes there.
Tests
studio/backend/tests/test_mlx_model_support.py(16 tests, run on Linux with fakemlx_vlm.utils/mlx_lm.utils):inkling2_loopis remappedload_modelrefusing before the loader is calledOne fixture in
test_mlx_inference_backend.py(_text_family_backend) stubs a loader that builds a made-up family (mm_family). It now also stubs the new check.Base (b3ecd8d) vs head, same host, failing test IDs compared:
test_each_plain_helper_stub_matches_zoos_bodytest_each_plain_helper_stub_matches_zoos_body(fails on base too)test_mlx_inference_backend.py)The real-library check also runs over every model type installed mlx-vlm 0.8.0 / mlx-lm 0.32.2 ship (315 module and remap names) and refuses none of them.
Apple Silicon
macos-15 staging run, real mlx 0.32.4 / mlx-vlm 0.8.0 / mlx-lm 0.32.2 on Metal, real
config.jsonof the reported repo. Only unsloth-zoo'sFastMLXModel(the step that downloads and builds the weights) is a recorder:Model type inkling2_loop not supported. Error: No module named 'mlx_vlm.speculative.drafters.inkling2_loop'load_modelFailed to load model: Model type inkling2_loop not supported. Error: No module named ...(exactly what the reporter saw)Failed to load model: mlx-community/Inkling-2-Mini-4bit uses the 'inkling2_loop' architecture ... Use the GGUF build instead: unsloth/Inkling-2-Mini-GGUF.test_mlx_model_support.py,test_mlx_inference_backend.py,test_mlx_speculative.py,test_unsupported_hint_reads_only_our_diagnosis.pyDevice was
Device(gpu, 0)on both arms.Not covered: a real end-to-end load of the 17 GB checkpoint (it does not fit a hosted macOS runner). Also, Studio cannot serve Inkling 2 Mini on MLX until a released mlx-vlm maps
inkling2_loopand the pin ceiling is raised. That is a follow-up once mlx-vlm releases.