⚠ This page is served via a proxy. Original site: https://github.com
This service does not collect credentials or authentication data.
Skip to content

Conversation

@alexey1312
Copy link
Contributor

Summary

  • Replace branch: "main" with from: "2.29.3" for mlx-swift-lm dependency

Problem

When consumers try to use AnyLanguageModel with semantic versioning:

.package(url: "...", from: "0.5.3")

SPM fails to resolve dependencies because branch: "main" is incompatible with version-based transitive dependency resolution:

error: exhausted attempts to resolve the dependencies graph, with the following dependencies unresolved:
* 'mlx-swift-lm' from https://github.com/ml-explore/mlx-swift-lm

Solution

Pin mlx-swift-lm to version 2.29.3 (latest stable release) instead of tracking the main branch.

Test plan

  • swift package resolve succeeds
  • swift build succeeds

Replace `branch: "main"` with `from: "2.29.3"` for mlx-swift-lm dependency.

This fixes SPM dependency resolution failures when consumers use
AnyLanguageModel with semantic versioning (e.g., `from: "0.5.3"`).
The branch-based dependency is incompatible with version-based
transitive dependency resolution.
@mattt
Copy link
Owner

mattt commented Jan 19, 2026

@alexey1312 Thank you for this PR. I believe the guidance from mlx-swift-lm to pin to a semantic tag is relatively new. Or at least is new since they migrated from mlx-swift-examples. I'm just as happy to do it this way to allow for semantic versioning.

Taking a look at this now to see what the earliest version is that will work, to make the constraint as loose as possible (and therefore less likely to cause conflicts).

@mattt
Copy link
Owner

mattt commented Jan 19, 2026

Alright, so apparently mlx-swift-lm introduced some ToolSpec/tool-call APIs and the UserInput.chat/tools initializer MLXLanguageModel uses in a patch release (2.25.4 → 2.25.5). So let's target that with a from:. If a package consumer pins to a later version or more strictly, like .upToNextMinor(from: "2.30.0"), this should resolve no problem.

@mattt mattt merged commit 4c2883f into mattt:main Jan 19, 2026
3 checks passed
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