Skip to content

Conversation

@tpae
Copy link
Contributor

@tpae tpae commented Nov 25, 2025

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
Copy link
Owner

mattt commented Dec 3, 2025

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 mattt: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