Skip to content

expose HubApi and model directory configuration for MLX#44

Merged
mattt merged 4 commits into
huggingface:mainfrom
tpae:main
Dec 3, 2025
Merged

expose HubApi and model directory configuration for MLX#44
mattt merged 4 commits into
huggingface:mainfrom
tpae:main

Conversation

@tpae

@tpae tpae commented Nov 25, 2025

Copy link
Copy Markdown
Contributor

HubApi provides additional configurations such as download directory, something like this:

    let modelsDirectory = DirectoryPickerService.modelsDirectory()
    let hub = HubApi(downloadBase: modelsDirectory)
    
    return MLXLanguageModel(modelId: modelId, hub: hub)

It should be backwards compatible and shouldn't break existing API.

@tpae tpae changed the title expose HubApi configuration for MLX expose HubApi and model directory configuration for MLX Nov 26, 2025
@mattt

mattt commented Dec 3, 2025

Copy link
Copy Markdown
Collaborator

This looks great. Thank you for contributing this, @tpae!

FYI — I'm working to replace HubApi in swift-transformers with swift-huggingface, which should provide better performance and ergonomics for managing models. When the time comes, we can update this code to that new API.

@mattt mattt merged commit 53a93e8 into huggingface:main Dec 3, 2025
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