Skip to content

Update mlx-swift-lm - #31

Merged
atdrendel merged 17 commits into
mainfrom
update-mlx-swift-lm
Jul 3, 2026
Merged

Update mlx-swift-lm#31
atdrendel merged 17 commits into
mainfrom
update-mlx-swift-lm

Conversation

@atdrendel

Copy link
Copy Markdown
Contributor
  • Add Gemma 3 model support (only 12B works at the moment because of remaining mlx-swift-lm bugs)
  • Pass tool schemas into MLXLMCommon.generate() to ensure function argument types are coerced into the types expected by the tools
  • Add verbose flags to build and test scripts

atdrendel added 3 commits July 3, 2026 12:49
- Bump mlx-swift-lm to 0.0.16
- Preserve input tool schemas when preparing loaded model input
- Add model coverage for non-string tool arguments and final tool responses
Copilot AI review requested due to automatic review settings July 3, 2026 15:01

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Updates SHLLM’s MLX dependencies and expands model/tooling support, including adding Gemma 4 model integration and improving tool-call argument coercion by passing tool schemas through to MLXLMCommon.generate().

Changes:

  • Bump mlx-swift-lm (and related pins) and add Gemma 4 model types/parsing support.
  • Pass tool schemas into generation to support non-string tool argument coercion (validated via new tests).
  • Add --verbose/-v flags to bin/build.sh and bin/test.sh, plus model download list updates.

Reviewed changes

Copilot reviewed 27 out of 31 changed files in this pull request and generated 13 comments.

Show a summary per file
File Description
Tests/SHLLMTests/Models/Qwen3-8BTests.swift Adds tool-call coercion test for non-string arguments.
Tests/SHLLMTests/Models/Qwen3-4BTests.swift Adds tool-call coercion test for non-string arguments.
Tests/SHLLMTests/Models/Qwen3-30BTests.swift Adds tool-call coercion test for non-string arguments.
Tests/SHLLMTests/Models/Qwen3-1_7BTests.swift Adds tool-call coercion test for non-string arguments.
Tests/SHLLMTests/Models/Qwen3-0_6BTests.swift Adds tool-call coercion test for non-string arguments.
Tests/SHLLMTests/Models/Qwen3_5-9BTests.swift Adds tool-call coercion test for non-string arguments.
Tests/SHLLMTests/Models/Qwen3_5-4BTests.swift Adds tool-call coercion test for non-string arguments.
Tests/SHLLMTests/Models/Qwen3_5-35B-A3BTests.swift Adds tool-call coercion test for non-string arguments.
Tests/SHLLMTests/Models/Qwen3_5-2BTests.swift Adds tool-call coercion test for non-string arguments (with thinking disabled).
Tests/SHLLMTests/Models/Qwen3_5-27BTests.swift Adds tool-call coercion test for non-string arguments.
Tests/SHLLMTests/Models/Qwen2_5-7BTests.swift Adds tool-call coercion test for non-string arguments.
Tests/SHLLMTests/Models/Qwen2_5-1_5BTests.swift Adds tool-call coercion test for non-string arguments.
Tests/SHLLMTests/Models/Orchestrator-8BTests.swift Adds tool-call coercion test for non-string arguments.
Tests/SHLLMTests/Models/NemotronNano-30BTests.swift Adds tool-call coercion test for non-string arguments.
Tests/SHLLMTests/Models/Ministral-3-14BTests.swift Adds tool-call coercion test for non-string arguments.
Tests/SHLLMTests/Models/LFM2-8B-A1BTests.swift Adds tool-call coercion test for non-string arguments.
Tests/SHLLMTests/Models/GPTOSS-20BTests.swift Adds tool-call coercion test for non-string arguments (Harmony helpers).
Tests/SHLLMTests/Models/Gemma4-E4BTests.swift New Gemma 4 E4B model tests (text, vision, tools).
Tests/SHLLMTests/Models/Gemma4-E2BTests.swift New Gemma 4 E2B model tests (text, vision, tools).
Tests/SHLLMTests/Models/Gemma4-12BTests.swift New Gemma 4 12B model tests (text, vision, tools).
Tests/SHLLMTests/Helpers.swift Adds mail_read tool schema + response types for tool coercion tests.
Tests/SHLLMTests/Gemma4ChannelParserTests.swift Adds unit tests for Gemma 4 channel parsing behavior.
Sources/SHLLM/SHLLM.swift Exports Gemma 4 model classes.
Sources/SHLLM/ResponseParser.swift Adds Gemma 4 channel parser and model parser bindings.
Sources/SHLLM/LLM.swift Passes tool schemas into MLXLMCommon.generate() and adds Gemma 4 entrypoints.
Package.swift Bumps mlx-swift-lm version and notes Gemma 4 resources.
Package.resolved Updates pinned dependency revisions/versions.
bin/test.sh Adds --verbose/-v and adjusts xcbeautify usage + Metal toolchain flow.
bin/download.sh Adds Gemma 4 model IDs to download list.
bin/build.sh Adds --verbose/-v and adjusts xcbeautify usage.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread Sources/SHLLM/ResponseParser.swift
Comment thread Tests/SHLLMTests/Models/Gemma4-E4BTests.swift Outdated
Comment thread Tests/SHLLMTests/Models/Gemma4-E4BTests.swift Outdated
Comment thread Tests/SHLLMTests/Models/Gemma4-E4BTests.swift Outdated
Comment thread Tests/SHLLMTests/Models/Gemma4-E4BTests.swift Outdated
Comment thread Tests/SHLLMTests/Models/Gemma4-E2BTests.swift Outdated
Comment thread Tests/SHLLMTests/Models/Gemma4-12BTests.swift Outdated
Comment thread Tests/SHLLMTests/Models/Gemma4-12BTests.swift Outdated
Comment thread Tests/SHLLMTests/Models/Gemma4-12BTests.swift Outdated
Comment thread Tests/SHLLMTests/Models/Gemma4-12BTests.swift Outdated
atdrendel and others added 14 commits July 3, 2026 18:20
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
@atdrendel
atdrendel merged commit f2c5af3 into main Jul 3, 2026
1 check passed
@atdrendel
atdrendel deleted the update-mlx-swift-lm branch July 3, 2026 16:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants