You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Thank you for this valuable repository that consolidates the necessary resources. I am planning to switch to it.
Currently, when I'm building my AI app, it takes 75% of the time building MLX-related codes, which takes really long. I'm wondering if it is possible to build a variant that packs all the backend (MLX, llama.cpp, ...) into a single .xcframework that is static for linking. This would save many hours and computing time on Xcode Cloud.
And if you accept PR, I'd like to make one.
:)
Reacted by Mattt, lin72h, Micahel H, Rudrank Riyam, Hexa and Noor Bhatia
@Lakr233 Glad to hear that you found this to be useful!
I agree that a binary XCFramework dependency for MLX would be a big improvement. I've been tracking this issue, which recently got this PR, which should help get us there.
I just opened up ml-explore/mlx-swift#351 to add release automation so that future releases of mlx-swift have XCFramework assets that we can target directly.
Update: ml-explore/mlx-swift#351 merged in February, so releases of mlx-swift now ship XCFramework assets. That removes the blocker here. Anyone who wants to take a pass at targeting them in Package.swift is welcome; otherwise I'll get to it after 1.0.
Hi @Lakr233. Following up on my last update: after looking into this more closely, I don't think we can do this well from AnyLanguageModel, so I'm going to close it as not planned.
mlx-swift now attaches XCFrameworks to its releases, but AnyLanguageModel uses MLX through mlx-swift-lm, which builds from source and brings in mlx-swift as source too. Adding the binary MLX and Cmlx targets next to that would put two copies of each module in the package. To make it work, we'd also have to build and host XCFrameworks for mlx-swift-lm (Cmlx alone is over 200 MB zipped per release), replace its #huggingFaceTokenizerLoader() macro, and keep all of it in step with every MLX release. That's more than we can maintain here. A binary target in mlx-swift itself was declined in ml-explore/mlx-swift#406, for reasons that apply to us too, like keeping source builds and Linux working.
If mlx-swift-lm ships a binary distribution someday, I'd be glad to revisit this. Let me know if you have any more thoughts on the matter!
Activity
mattt commentedon Oct 29, 2025
@Lakr233 Glad to hear that you found this to be useful!
I agree that a binary XCFramework dependency for MLX would be a big improvement. I've been tracking this issue, which recently got this PR, which should help get us there.
[-]Prebuilt Binary for Faster Build[/-][+]Use prebuilt XCFramework distribution of MLX[/+]mattt commentedon Feb 5, 2026
I just opened up ml-explore/mlx-swift#351 to add release automation so that future releases of mlx-swift have XCFramework assets that we can target directly.
mattt commentedon Sep 2, 2026
Update: ml-explore/mlx-swift#351 merged in February, so releases of mlx-swift now ship XCFramework assets. That removes the blocker here. Anyone who wants to take a pass at targeting them in
Package.swiftis welcome; otherwise I'll get to it after 1.0.mattt commentedon Oct 1, 2026
Hi @Lakr233. Following up on my last update: after looking into this more closely, I don't think we can do this well from AnyLanguageModel, so I'm going to close it as not planned.
mlx-swift now attaches XCFrameworks to its releases, but AnyLanguageModel uses MLX through mlx-swift-lm, which builds from source and brings in mlx-swift as source too. Adding the binary
MLXandCmlxtargets next to that would put two copies of each module in the package. To make it work, we'd also have to build and host XCFrameworks for mlx-swift-lm (Cmlxalone is over 200 MB zipped per release), replace its#huggingFaceTokenizerLoader()macro, and keep all of it in step with every MLX release. That's more than we can maintain here. A binary target in mlx-swift itself was declined in ml-explore/mlx-swift#406, for reasons that apply to us too, like keeping source builds and Linux working.If mlx-swift-lm ships a binary distribution someday, I'd be glad to revisit this. Let me know if you have any more thoughts on the matter!