Skip to content

Move the Unsloth Studio MLX pins to mlx-vlm 0.7.8 - #13699

Merged
danielhanchen merged 3 commits into
unslothai:mainfrom
Lyxot:chore/studio-mlx-vlm-078
Oct 14, 2026
Merged

danielhanchen merged 3 commits into
unslothai:mainfrom
Lyxot:chore/studio-mlx-vlm-078

Conversation

@Lyxot

@Lyxot Lyxot commented Oct 14, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

Raises the mlx-vlm range that the Unsloth Studio installer and the MLX self-heal install to <=0.7.8, matching the ceiling raise in unsloth-zoo (unslothai/unsloth-zoo#1742). It also stops the self-heal from upgrading unrelated dependencies, which 0.7.8's new datasets dependency would otherwise take past Unsloth's pins.

before after
mlx-vlm >=0.4.4,<=0.7.4 >=0.4.4,<=0.7.8
mlx / mlx-metal ==0.32.3 unchanged (0.7.8's floor)
mlx-lm ==0.31.3 unchanged

Self-heal upgrades only the MLX packages

mlx-vlm 0.7.8 adds datasets>=4.0.0 with no upper bound. That brings datasets and its dependencies (pandas, pyarrow, aiohttp, ...) into the MLX self-heal's install. The self-heal (attempt_mlx_repair) installed with a bare uv pip install --upgrade, which re-resolves every transitive dependency to its newest release. A dry run of the self-heal command on an environment with the pinned stack (datasets 4.3.0, pandas 2.3.3):

<=0.7.4 range, bare --upgrade               41 packages replaced (numpy, huggingface-hub, ... already moved)
<=0.7.8 range, bare --upgrade               49 packages replaced, including datasets 4.3.0 -> 5.1.0, pandas 2.3.3 -> 3.0.6, pyarrow 23 -> 26
<=0.7.8 range, --upgrade-package per name   3 packages replaced (mlx, mlx-lm, mlx-vlm)

datasets 5.x is outside unsloth's datasets<5.0.0, and pandas 3 is outside Unsloth Studio's pandas==2.3.3. The self-heal now upgrades only the MLX packages by name, as the installer's MLX step does, so other dependencies move only when the MLX packages require it. The constraint file also holds the running datasets version next to transformers, so a resolve that has to move datasets fails, leaving Unsloth chat-only, instead of picking 5.x. The installer's MLX step is unaffected: it already upgrades per name and applies the single-env constraints, which pin datasets==4.3.0.

What a real install resolves

With the installer's constraints and macOS arm64 overrides:

mlx==0.32.3
mlx-metal==0.32.3
mlx-lm==0.31.3
mlx-vlm==0.7.8
mlx-audio==0.5.9
transformers==5.5.0
datasets==4.3.0
cryptography==50.0.2   (new dependency of mlx-vlm 0.7.8; unsloth allows >=42)

The old range resolves to the same set apart from mlx-vlm 0.7.4, and has no datasets or cryptography edge from mlx-vlm. overrides-darwin-arm64.txt needs no change: mlx-vlm 0.7.8's transformers requirement is unchanged from 0.7.4.

Ordering

As with the previous bump, this should merge after an unsloth-zoo release carries unslothai/unsloth-zoo#1742. On 0.7.8, an older unsloth-zoo cannot build its LoRA layers (they moved to mlx_vlm.trainer.peft), so training would fail. The installer narrows the mlx-vlm range to the one the installed unsloth-zoo declares, so an older unsloth-zoo keeps getting at most 0.7.4.

Compatibility of Unsloth Studio's mlx-vlm usage

  • Every mlx-vlm symbol Unsloth Studio references resolves on 0.7.8.
  • These functions it calls are unchanged from 0.7.4: generate_step, prepare_inputs, should_add_special_tokens, make_prompt_cache, maybe_quantize_kv_cache, load_video and update_module_configs.
  • detect_mtp_splitter keeps its contract; the only new MTP family is the alias inkling.
  • prompt_utils now defaults qwen3_omni_moe to enable_thinking=True. The real Qwen3-Omni templates only act on an explicit false, so the audio prompt Unsloth Studio renders is unchanged.

Validation

Unsloth Studio MLX test files, mlx-vlm 0.7.4 vs 0.7.8:   2198 passed on both, same 19 pre-existing failures
pin + self-heal tests on this branch:                     test_mlx_repair, test_mlx_stack_blockers, test_mlx_install, test_dependency_pass_skips pass (apart from 2 environment-dependent pip-probe tests that fail on main too)

The updated self-heal tests fail when datasets is dropped from the held set, or when the bare --upgrade is restored.

@Lyxot
Lyxot requested a review from danielhanchen as a code owner October 14, 2026 09:17
@Lyxot Lyxot added the MLX label Oct 14, 2026
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 14, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-14T14:06:37.199286Z 7d37860 Manual request
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@Lyxot

Lyxot commented Oct 14, 2026

Copy link
Copy Markdown
Collaborator Author

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 2577540729

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

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".

Comment thread studio/backend/utils/mlx_repair.py Resolved
@Lyxot

Lyxot commented Oct 14, 2026

Copy link
Copy Markdown
Collaborator Author

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 2577540729

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

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".

Comment thread studio/backend/utils/mlx_repair.py Resolved
mlx-vlm 0.7.8 adds a `datasets>=4.0.0` dependency with no upper bound, which brings datasets and its dependencies (pandas, pyarrow, aiohttp, ...) into the MLX self-heal's install. The self-heal installed with a bare `uv pip install --upgrade`, which re-resolves every transitive dependency to its newest release: on 0.7.8 that moved datasets 4.3.0 to 5.1.0 (past unsloth's `datasets<5.0.0`), pandas 2.3.3 to 3.0.6 and pyarrow 23 to 26, on top of the numpy and huggingface-hub upgrades it already made on 0.7.4. The self-heal now upgrades only the MLX packages by name, as the installer's MLX step does, so other dependencies move only when the MLX packages require it. The constraint file also holds the running datasets version beside transformers, so a resolve that has to move datasets fails instead of picking 5.x.
@Lyxot
Lyxot force-pushed the chore/studio-mlx-vlm-078 branch from 2577540 to 1d64543 Compare October 14, 2026 09:41
@Lyxot

Lyxot commented Oct 14, 2026

Copy link
Copy Markdown
Collaborator Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Breezy!

Reviewed commit: 1d645434cc

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

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".

@Lyxot

Lyxot commented Oct 14, 2026

Copy link
Copy Markdown
Collaborator Author

Codex review and CI

  • Codex: converged at head 1d645434cc, with Didn't find any major issues.
  • CI (staging copy Lyxot/unsloth#164, same head, based on the then-current main 34b84f7, now closed): 78 passed, 8 skipped, 1 failed.
    • Passed jobs include the macOS installs (Install + load on macos-15, macos-15-intel, macos-26 and macos-26-intel), Repo tests (CPU, studio-install), Shell installer tests and Unsloth Updating Tests (macOS).
    • The failure is Repo tests (CPU, studio), in six frontend contract tests: test_deep_research_frontend_contract::test_research_is_one_shot_per_thread_without_disabling_normal_chat, and five test_token_count_prompt_parity cases failing with ReferenceError: skillsForTools is not defined. They fail identically on the base commit 34b84f7 without this PR, so the failure is already on main and unrelated to these pins.

Changes during review:

  • Second Codex finding, fixed in 1d645434cc: with 0.7.8's new datasets dependency, the self-heal's bare uv pip install --upgrade also upgraded datasets' own dependencies (pandas 2.3.3 -> 3.0.6, pyarrow 23 -> 26). The self-heal now passes --upgrade-package for each MLX package, as the installer's MLX step does. A dry run of the exact command replaces only mlx, mlx-lm and mlx-vlm. The description's self-heal section is updated.
  • First Codex finding (no datasets pin when its metadata is unreadable): declined, with the reasons in the thread.

@danielhanchen

Copy link
Copy Markdown
Member

@codex review

1 similar comment
@danielhanchen

Copy link
Copy Markdown
Member

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Chef's kiss.

Reviewed commit: 7d3786050d

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

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".

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants