IV
ivanfioravanti/lmstudio_hf
A command-line utility to manage MLX models between your Hugging Face cache and LM Studio.
LM Studio - Hugging Face Model Manager
A command-line utility to manage MLX models between your Hugging Face cache and LM Studio. This tool makes it easy to import and manage models you've downloaded from Hugging Face into LM Studio.
Features
- Interactive model selection interface with keyboard navigation
- Automatic detection of MLX models in your Hugging Face cache
- Smart handling of model imports via symbolic links
- Support for model replacement and removal
- Terminal-based UI with scrolling for large model lists
Prerequisites
- Python 3.x
- LM Studio installed
- Hugging Face models downloaded locally
Installation
You can skip this if you are using uvx remote execution (see below).
- Clone this repository:
git clone https://github.com/ivanfioravanti/lmstudio_hf.git
cd lmstudio_hfUsage
Run the script using Python:
python lmstudio_hf.pyAlternatively, you can use uvx remote execution:
uvx git+https://github.com/ivanfioravanti/lmstudio_hfNavigation Controls
- ↑/↓ arrows: Navigate through the model list
- SPACE: Select/deselect a model
- ENTER: Confirm selection and proceed with import
- Ctrl+C: Cancel operation
How It Works
- The tool scans your Hugging Face cache directory (
~/.cache/huggingfaceby default) - Identifies MLX-compatible models (excluding specific types like Whisper, LLaVA, etc.)
- Creates symbolic links in the LM Studio models directory (
~/.cache/lm-studio/models) - Allows for easy management of existing imports
Environment Variables
HF_HOME: Optional. Set this to customize your Hugging Face cache location.
Notes
- Models are imported using symbolic links to save disk space
- Already imported models are marked in the selection interface
- Selecting an already imported model will remove it from LM Studio
Contributing
Feel free to open issues or submit pull requests for any improvements or bug fixes.