Repository navigation
feat: configuration-based MLXLanguageModel init + #huggingFaceLanguageModel macro - #8
Closed
thechriswebb wants to merge 8 commits into
Closed
thechriswebb wants to merge 8 commits into
thechriswebb wants to merge 8 commits into
Conversation
Replace the modelID + Downloader/TokenizerLoader initializer with a configuration-based one plus a single vendor-neutral container-load seam. modelID becomes configuration.name; weightsLocation is retained for the availability checks. Migrate the model-free unit helpers and call sites.
Declared in MLXFoundationModels, implemented in the existing MLXHuggingFaceMacros plugin. Expands to the configuration-based MLXLanguageModel init wired with the HuggingFace loaders, so the library keeps zero swift-transformers dependency.
…d example to the configuration init
…t MLXLLM in macro examples
Author
|
@ctymoszek This one will be the easiest to merge, but will have implications on the other PRs. Just a heads up! |
Merged
4 tasks done
ctymoszek
pushed a commit
that referenced
this pull request
Jul 14, 2026
ctymoszek
added a commit
that referenced
this pull request
Jul 15, 2026
ctymoszek
added a commit
that referenced
this pull request
Jul 15, 2026
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
MLXLanguageModel was the only model entry point in the package that didn't onboard like the rest of the library. A normal model loads in one line (#huggingFaceLoadModelContainer(configuration:)), but constructing an MLXLanguageModel required hand-wiring two macros, a locatedBy: closure, and a bare modelID string. This brings it in line: the initializer now takes a ModelConfiguration, and a new #huggingFaceLanguageModel macro makes the common case a single line. MLXFoundationModels stays vendor-neutral with no new package dependencies.
Before / after
What changed
Design notes
unchanged; the new load seam slots into the same cache path. Cache/identity keys off configuration.name, matching prior behavior (localized to the computed modelID if finer revision/source disambiguation is ever needed).
Testing
Notes