A set of tools for managing Ollama language models with both GUI and CLI interfaces. This toolkit allows you to list, export, import, and delete Ollama models.
- List Models: View all installed Ollama models with their sizes and locations
- Export Models: Export models to portable tar.gz archives
- Import Models: Import models from tar.gz archives
- Delete Models: Remove models to free up disk space
- Multiple Interfaces: Choose between a GUI (PySide6) or CLI interface
- Python 3.7+
- Ollama installed (https://ollama.com)
- For GUI: PySide6 (
pip install PySide6)
-
Clone this repository:
git clone https://github.com/404FoundingFather/ollama-model-manager.git cd ollama-model-manager -
Install required dependencies:
pip install -r requirements.txt
The command-line interface (ollama_cli.py) provides a simple way to manage Ollama models from the terminal.
python ollama_cli.py [-h] [--verbose] {list,export,import,delete} ...
--verbose, -v: Enable verbose output with additional debugging information
List all available Ollama models:
python ollama_cli.py listOutput as JSON:
python ollama_cli.py list --jsonExport a model to a tar.gz archive:
python ollama_cli.py export <model_name> <parameter_size> <output_path>Example:
python ollama_cli.py export mistral 7b ./mistral-7b.tar.gzOptions:
--force, -f: Overwrite output file if it exists
Import a model from a tar.gz archive:
python ollama_cli.py import <archive_path>Example:
python ollama_cli.py import ./mistral-7b.tar.gzOptions:
--name <custom_name>: Set a custom name for the imported model (format: name:param_size)
Example with custom name:
python ollama_cli.py import ./mistral-7b.tar.gz --name "my-mistral:7b"Delete a model:
python ollama_cli.py delete <model_name> <parameter_size>Example:
python ollama_cli.py delete mistral 7bOptions:
--force, -f: Skip confirmation prompt
The GUI application (ollama_side6.py) provides a user-friendly interface for managing models:
python ollama_side6.py- Model List: Browse all installed models with their details
- Export Tab: Export models to a specified location
- Import Tab: Import models from archives
- Delete Option: Remove models with confirmation
- Progress Indication: Visual feedback during operations
The original Tkinter-based application (ollama_gui.py) is also included:
python ollama_gui.py# Export all your models (run this for each model)
python ollama_cli.py list # First, see what's available
python ollama_cli.py export mistral 7b ./backups/mistral-7b.tar.gz# On source machine
python ollama_cli.py export mistral 7b ./mistral-7b.tar.gz
# Transfer the file to the target machine, then:
python ollama_cli.py import ./mistral-7b.tar.gz# List models to find large ones
python ollama_cli.py list
# Delete models you no longer need
python ollama_cli.py delete large-model 65bThe tools interact with Ollama's model storage structure:
- Models are stored in
~/.ollama/models/ - Manifests are in
~/.ollama/models/manifests/registry.ollama.ai/library/<model>/<param> - Blob files referenced in manifests are in
~/.ollama/models/blobs/
-
"No models found": Make sure Ollama is installed and you've downloaded at least one model with
ollama pull. -
Import failures: Ensure the archive is a valid model export. The archive should contain a manifest file and all referenced blobs.
-
Permission errors: Ensure you have write access to the Ollama directories.
Run the commands with the --verbose or -v flag for more detailed output:
python ollama_cli.py -v list- Ollama for the amazing tool that makes local LLMs accessible
- The PySide6/Qt team for the GUI framework