Repository navigation
feat: mlx-swift-lm 3.32 upgrade, real Stop, native tool calling, KV-cache settings (v6.4.0) - #8
Merged
Merged
Conversation
…ache settings (v6.4.0) Bugs / breaking changes - Upgrade mlx-swift-lm 2.30.3 -> 3.32.3 and mlx-swift 0.30.3 -> 0.32.3 (3.32.3 requires mlx-swift upToNextMinor(0.32.3); 0.33.x is only on untagged main). Migrate to HubClient + #huggingFaceTokenizerLoader(); add MLXHuggingFace, HuggingFace (swift-huggingface 0.13) and Tokenizers (swift-transformers 1.4) products. Commit Package.resolved. - Download *.jinja, *.txt and *.model too (MLXService.downloadPatterns). - Stop now cancels the generation Task; MLXService checks cancellation, ends the mlx-swift-lm stream and always resets its busy flag. Pass topK, minP and repetitionContextSize; default repetition penalty 1.8 -> 1.1 (legacy persisted 1.8 migrated). - Remove dead Python scripts, junk Python/=* files and their Resources entries; quote pip specifiers in setup.sh; replace daemon-protocol tests. Features - Native tool calling: ToolRegistry -> [ToolSpec] in UserInput; Generation.toolCall mapped into the existing <tool> approval flow (multiple calls per turn); </tool> text parser kept as fallback. - Model catalog refresh (Qwen3.5 9B default, Qwen3-Coder 30B-A3B, Devstral Small 2, Qwen3.6 27B / 35B-A3B, Gemma 4 E4B, Qwen3.5 2B); context window read from nested text_config. - KV-cache settings (bits none/8/4, max KV size, prefill step) mapped into GenerateParameters. Tests: InferenceEngineTests + rewritten MLXServiceTests with a mock InferenceGenerator (no model download), plus an opt-in real-model integration test (MLXCODE_INTEGRATION=1). Docs/CI: CHANGELOG, README (features, inference-path Mermaid diagram, version history), -skipMacroValidation in CI. MARKETING_VERSION 6.4.0, build 9 (extension 1.1 / build 2). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…needs Swift 6.3+) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The repo's Actions policy allows only GitHub-owned and verified actions, so maxim-lobanov/setup-xcode caused a startup_failure. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.
Summary
This brings MLX Code up to date with mlx-swift-lm 3.x and fixes the Stop button. Full detail is in CHANGELOG.md, under 6.4.0.
A. Bugs and breaking changes
mlx-swift upToNextMinor(0.32.3), and only untaggedmainmoves to 0.33.HubApi/defaultHubApibecameHubClient.loadContainer(hub:)becameloadContainer(from: URL, using: #huggingFaceTokenizerLoader()).MLXHuggingFace,HuggingFace(swift-huggingface 0.13.0) andTokenizers(swift-transformers 1.4.0) products.decode(tokens:), so that rename needed no change.Package.resolvedis now committed, with a.gitignoreexception.MLXService.downloadPatternsand add*.jinja,*.txtand*.model.HubClient(cache: nil)and write straight into<modelsPath>/models/<org>/<repo>. That's the same layout 2.x used, and nothing goes to~/.cache/huggingface.Task.MLXServicechecks for cancellation in the stream loop. Ending the stream cancels mlx-swift-lm's own generation task, and the busy flag is cleared in adefer.topK,minPandrepetitionContextSizeare now passed to the sampler.mlx_inference.py,mlx_daemon.py,huggingface_downloader.pyandrag_system.py. No Swift code referenced any of them.Python/=*junk files, their Resources entries and theadd_python_scripts.rbhelper.setup.shnow quotes its version specifiers.B. Features
ToolSpecBuilderturnsToolRegistryinto[ToolSpec], which is passed inUserInputand togenerate.Generation.toolCallis rendered as a<tool>{json}</tool>block, so the existing approval and execution flow handles it unchanged. Several calls in one response work.</tool>text parser remains as a fallback.model_typeis registered inLLMModelFactory3.32.3.text_configas well as the top level.GenerateParameters.C. Tests
InferenceGeneratorprotocol plus a mock covers:ChatViewModel;text_configparsing;ToolRegistry→ToolSpec;MLXCODE_INTEGRATION=1plusMLXCODE_MODEL_PATH).qwen2.5-0.5b-4bit.D. Docs and CI
-skipMacroValidationbuild notes.-skipMacroValidation -skipPackagePluginValidation, which the MLXHuggingFace macros need.gitleaks detect --no-gitfinds no leaks.Things to check
macos-15runner's default Xcode is older, CI will fail at package resolution, and the workflow will needmacos-26or anxcode-selectstep.🤖 Generated with Claude Code