Skip to content

Add new models#28

Merged
atdrendel merged 6 commits intomainfrom
update-mlx-swift-lm
Mar 18, 2026
Merged

Add new models#28
atdrendel merged 6 commits intomainfrom
update-mlx-swift-lm

Conversation

@atdrendel
Copy link
Copy Markdown
Contributor

  • Add Devstral and Ministral
  • Add Nemotron
  • Add Qwen3.5
  • Append assistant tool calls to transcripts to fix tool calling

Copilot AI review requested due to automatic review settings March 18, 2026 00:08
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR expands SHLLM’s model surface area (Devstral/Ministral, Nemotron, Qwen3.5) and adjusts parsing + transcript construction to support multi-step tool workflows more reliably.

Changes:

  • Add new model wrappers + response parsers for Mistral3VLM (Devstral/Ministral), NemotronHModel, and Qwen3.5 (incl. MoE).
  • Update tool-workflow tests to append assistant tool-call messages into transcripts before appending tool results.
  • Bump MLX Swift LM dependency and switch swift-transformers to the shareup fork.

Reviewed changes

Copilot reviewed 20 out of 22 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
bin/download.sh Adds new model IDs for download helper script.
Tests/SHLLMTests/Models/Qwen3_5-9BTests.swift New test suite for Qwen3.5-9B (streaming/awaiting/tools/VLM).
Tests/SHLLMTests/Models/Qwen3_5-35B-A3BTests.swift New test suite for Qwen3.5-35B-A3B (MoE) workflows.
Tests/SHLLMTests/Models/Qwen3_5-2BTests.swift New test suite for Qwen3.5-2B including thinking on/off behavior.
Tests/SHLLMTests/Models/Qwen3_5-27BTests.swift New test suite for Qwen3.5-27B workflows.
Tests/SHLLMTests/Models/Qwen3-8BTests.swift Ensures assistant tool calls are appended before tool results in tool workflows.
Tests/SHLLMTests/Models/Qwen3-4BTests.swift Same transcript fix for Qwen3-4B tool workflows.
Tests/SHLLMTests/Models/Qwen3-30BTests.swift Same transcript fix for Qwen3-30B tool workflows.
Tests/SHLLMTests/Models/Orchestrator-8BTests.swift Same transcript fix for Orchestrator tool workflows (tests remain disabled where applicable).
Tests/SHLLMTests/Models/NemotronNano-30BTests.swift New test suite for Nemotron Nano tool workflows.
Tests/SHLLMTests/Models/Ministral-3-14BTests.swift New test suite for Ministral-3-14B including VLM extraction.
Tests/SHLLMTests/Models/LFM2-8B-A1BTests.swift Appends assistant tool calls and re-enables multi-tool workflow test.
Tests/SHLLMTests/Models/Devstral2Small-24BTests.swift New test suite for Devstral2 Small 24B (Mistral3VLM).
Tests/SHLLMTests/Helpers.swift Minor wording tweak in image input system prompt.
Tests/SHLLMTests/HarmonyTests.swift Adds missing MLXLMCommon import (ToolCall usage).
Sources/SHLLM/UserInput+SHLLM.swift Adds appendAssistantToolCall and changes generic tool-result message content to JSON string.
Sources/SHLLM/ThinkingTagProcessor.swift Adds documentation clarifying parsing modes.
Sources/SHLLM/SHLLM.swift Re-exports new model types (Mistral3TextModel, NemotronHModel, Mistral3VLM, Qwen35, Qwen35MoE).
Sources/SHLLM/ResponseParser.swift Adds parsers for Qwen3.5, Nemotron, Mistral3VLM (and shared Qwen3.5 parser selection).
Sources/SHLLM/LLM.swift Adds new model constructors + resource directory helpers for Devstral2/Ministral/Nemotron/Qwen3.5.
Package.swift Bumps mlx-swift-lm and switches swift-transformers dependency source/version.
Package.resolved Updates resolved graph to match new dependency versions/sources.

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

You can also share your feedback on Copilot code review. Take the survey.

Comment thread Sources/SHLLM/ResponseParser.swift
Comment on lines +5 to +17
mutating func appendAssistantToolCall(_ call: ToolCall) {
ensureMessagesForm()
let message: Message = [
"role": "assistant",
"tool_calls": [[
"type": "function",
"function": [
"name": call.function.name,
"arguments": call.function.arguments
.mapValues { $0.anyValue },
] as [String: Any],
]],
]
@atdrendel atdrendel merged commit c868b0d into main Mar 18, 2026
1 check passed
@atdrendel atdrendel deleted the update-mlx-swift-lm branch March 18, 2026 00:26
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