Add Qwen 3 VL 2B Thinking and 4B Instruct models#25
Merged
Conversation
There was a problem hiding this comment.
Pull request overview
This PR adds support for two new Qwen 3 VL model variants: the 2B Thinking and 4B Instruct models. The changes differentiate between "Instruct" and "Thinking" model variants by introducing separate response parsers and renaming existing structures to clarify which variant they support.
Key Changes:
- Added two new model variants to the download script and package resources
- Refactored response parsers to distinguish between Instruct models (standard parsing) and Thinking models (supports reasoning output)
- Renamed and reorganized test files to clearly differentiate between 2B/4B and Instruct/Thinking variants
Reviewed changes
Copilot reviewed 7 out of 8 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| bin/download.sh | Added entries for Qwen3-VL-2B-Thinking-4bit and Qwen3-VL-4B-Instruct-4bit models |
| Package.swift | Added commented-out resource copy entries for the two new models |
| Sources/SHLLM/ResponseParser.swift | Introduced qwen3VLInstructParser and qwen3VLThinkingParser, refactored parser implementations into hybridParser and defaultsToThinkingParser |
| Sources/SHLLM/LLM.swift | Added responseParser parameter to qwen3VL function; added static properties for new model directories |
| Tests/SHLLMTests/Models/Qwen3VL-4B-ThinkingTests.swift | Renamed struct from Qwen3VL_4BTests to Qwen3VL_4B_ThinkingTests and updated to use qwen3VLThinkingParser |
| Tests/SHLLMTests/Models/Qwen3VL-4B-InstructTests.swift | New test file for the 4B Instruct variant with appropriate parser configuration |
| Tests/SHLLMTests/Models/Qwen3VL-2B-ThinkingTests.swift | New test file for the 2B Thinking variant with reasoning test support |
| Tests/SHLLMTests/Models/Qwen3VL-2B-InstructTests.swift | Renamed from Qwen3VL_2BTests to Qwen3VL_2B_InstructTests, updated directory and parser references |
Comments suppressed due to low confidence (1)
Tests/SHLLMTests/Models/Qwen3VL-2B-InstructTests.swift:93
- The helper function name
qwen3VL_2Bis inconsistent with the 4B Instruct test file, which usesqwen3VL_4B_Instruct. For consistency and clarity, consider renaming this toqwen3VL_2B_Instructto match the naming pattern used in the 4B Instruct tests and better reflect that it's testing the Instruct variant.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
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.
Qwen3-VL-2B-Thinking-4bitandQwen3-VL-4B-Instruct-4bitmodels