Skip to content

Commit 4d25411

Browse files
authored
Merge pull request #95 from gsdali/fix/93-mlx-tokenizers-pin
Fix #93: pin mlx-swift-lm to last pre-v3 commit + declare swift-transformers
2 parents 1893caf + 808e071 commit 4d25411

2 files changed

Lines changed: 186 additions & 1 deletion

File tree

Package.resolved

Lines changed: 167 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Package.swift

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,24 @@ var packageDependencies: [Package.Dependency] = [
1515

1616
#if os(iOS) || os(macOS)
1717
packageDependencies.append(contentsOf: [
18-
.package(url: "https://github.com/ml-explore/mlx-swift-lm", branch: "main"),
18+
// mlx-swift-lm v3 (PR #118 merged 2026-04-01) removed
19+
// `loadTokenizer(configuration:hub:)` and reshaped the Hub/Downloader
20+
// API; `LocalLLMClientMLX/Context.swift` still uses the old API. Until
21+
// the MLX backend is migrated to v3 (`AutoTokenizer.from(directory:)` +
22+
// `Downloader`), pin to the last pre-v3 commit so consumers can build.
23+
// Tracked in LocalLLMClient#93 — switch back to `branch: "main"` once
24+
// Context.swift is migrated.
25+
.package(
26+
url: "https://github.com/ml-explore/mlx-swift-lm",
27+
revision: "2a296f145c3129fea4290bb6e4a0a5fb458efa06" // 2026-03-27, last pre-v3
28+
),
29+
// `Tokenizers` (from swift-transformers) is what `LocalLLMClientMLX`
30+
// imports for `any Tokenizer`. Pre-v3 mlx-swift-lm transitively pulled
31+
// swift-transformers in, but its Package.swift didn't declare it as a
32+
// public re-export, so consumers still need to depend on it directly.
33+
// Range matches the pre-v3 mlx-swift-lm transitive pin so SPM resolves.
34+
// Bump to `from: "1.3.0"` once Context.swift is migrated to mlx-swift-lm v3.
35+
.package(url: "https://github.com/huggingface/swift-transformers.git", "1.2.0"..<"1.3.0"),
1936
.package(url: "https://github.com/apple/swift-docc-plugin", from: "1.4.0")
2037
])
2138
#endif
@@ -135,6 +152,7 @@ packageTargets.append(contentsOf: [
135152
"LocalLLMClientCore",
136153
.product(name: "MLXLLM", package: "mlx-swift-lm"),
137154
.product(name: "MLXVLM", package: "mlx-swift-lm"),
155+
.product(name: "Tokenizers", package: "swift-transformers"),
138156
],
139157
),
140158
.testTarget(

0 commit comments

Comments
 (0)