A command line tool for downloading and managing MLX models
Project description
MLX Hub
MLX-Hub is a tool for downloading and managing MLX AI models from Hugging Face Hub on Apple Silicon Devices.
The python package provides a command line interface (CLI) and a Python library to conveniently search, download, and manage MLX models without leaving your development environment.
The mlx_hub python package has a built-in CLI tool called 'mlx-hub-cli', that not only accepts command line arguments but also supports an Interactive Mode, directly from the terminal.
Features
- Scan for Models downloaded on your device, in the Hugging Face Hub cache.
- Search for MLX Models from Hugging Face Hub.
- Suggest MLX models to download.
- Download MLX models by model ID.
- Delete MLX models as needed.
- Interactive Mode for a better interface.
Installation
You can install MLX-Hub using pip:
pip install mlx-hub
This should install the mlx-hub python package from pyPI, including mlx-hub-cli and all dependencies.
Hugging Face: User Access Token
MLX-Hub uses huggingface_hub to interact with MLX models on Hugging Face. Please create and add an access token from Hugging Face to huggingface_hub.
Hugging Face Hub documentation:
To create an access token, go to you Hugging Face settings:
To add the access token to huggingface_hub:
huggingface-cli login
Quick start
Command line arguments
MLX-Hub CLI accepts the following command line argument:
usage: mlx-hub-cli [-h] [--start] [--scan] [--search phrase] [--suggest] [--download model_id] [--delete model_id]
MLX-Hub CLI
options:
-h, --help show this help message and exit
--start Start Interactive Mode
--scan Scan for downloaded models in the Hugging Face cache
--search phrase Search for MLX models using a search phrase
--suggest Suggest MLX models to download
--download model_id Download a specific model
--delete model_id Delete a specific model
Interactive Mode
Interactive mode allows you to execute various Action in a user-friendly environment.
To start the interactive mode, use the start action:
mlx-hub-cli --start
Starting interactive mode.
Available Actions:
scan Scan for downloaded models in the Hugging Face cache
search phrase Search for MLX models using a search phrase
suggest Suggest MLX models to download
download model_id Download a specific model
delete model_id Delete a specific model
exit Exit Interactive Mode
help Show this help message
Enter Action > scan
1 downloaded models:
mlx-community/TinyDolphin-2.8-1.1b-4bit-mlx
Enter Action > exit
Goodbye!
In interactive mode, the following actions are available:
help: Show the help message with available actions.scan: Scan for downloaded MLX models.suggest: Suggest MLX models to download.search <phrase>: Search for MLX models using a search phrase.download <model_id>: Download a specific model.delete <model_id>: Delete a specific model.exit: Exit the interactive mode.
To exit the interactive mode, use the exit action:
Enter Action > exit
Goodbye!
Actions
Scan
The scan action scans the Hugging Face cache directory and lists all the MLX models that are currently downloaded on your device.
Example:
mlx-hub-cli --search bert
Search
The search action searches for MLX models on the Hugging Face Hub using a specified search phrase.
The search phrase should be substrings that will be contained in the model id of the model.
Example:
> mlx-hub-cli --search bert
3 models found:
mlx-community/bert-base-uncased-mlx
mlx-community/bert-large-uncased-mlx
mlx-community/bert-base-multilingual-uncased
Use quotes around the search phrase if it contains multiple substrings
mlx-hub-cli --search "whisper v2"
3 models found:
mlx-community/whisper-large-v2-mlx
mlx-community/whisper-large-v2-mlx-8bit
mlx-community/whisper-large-v2-mlx-4bit
In Interactive Mode, you don't need the quotes
mlx-hub-cli --start
Starting interactive mode.
Available Actions:
scan Scan for downloaded models in the Hugging Face cache
search phrase Search for MLX models using a search phrase
suggest Suggest MLX models to download
download model_id Download a specific model
delete model_id Delete a specific model
exit Exit Interactive Mode
help Show this help message
Enter Action > search whisper v2
3 models found:
mlx-community/whisper-large-v2-mlx
mlx-community/whisper-large-v2-mlx-8bit
mlx-community/whisper-large-v2-mlx-4bit
Suggest
The suggest action suggests MLX models to download. It reads from a predefined list of suggested models.
Download
The download action downloads a specific MLX model by its model ID.
Example:
mlx-hub-cli --download mlx-community/bert-base-uncased-mlx
Delete
The delete action deletes a specific MLX model by its model ID.
Example:
mlx-hub-cli --delete mlx-community/bert-base-uncased-mlx
Acknowledgements
Thanks to:
- Apple's machine learning research team @ml-explore for MLX
- The Hugging Face team @huggingface for huggingface_hub
- The MLX Community on Hugging Face
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file mlx_hub-1.0.0.tar.gz.
File metadata
- Download URL: mlx_hub-1.0.0.tar.gz
- Upload date:
- Size: 9.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.12.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c9bbc579899b73c8bc01c5560aacc19f33e48fe311c109548c6a3893125cdab0
|
|
| MD5 |
72483eb0d6740dd80420bf6e431c6cee
|
|
| BLAKE2b-256 |
bb3e0a9c9f64bfc316ada963145bc34a4e695af4b10baf24ff1beb41d787ac18
|
File details
Details for the file mlx_hub-1.0.0-py3-none-any.whl.
File metadata
- Download URL: mlx_hub-1.0.0-py3-none-any.whl
- Upload date:
- Size: 8.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.12.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b4834046d7fbeefe5076695bb3609e1c5769d6d8a93acab435309c3b487525f8
|
|
| MD5 |
e5ce82a6b7f382d85d1dffbe5773b064
|
|
| BLAKE2b-256 |
c825329fd91b397a397f7c3ffe0fda8d826645bc729abfddd628edd888638860
|