Skip to content

thupalo/hf_cache_gui

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

HF Cache Manager

A lightweight Gradio GUI for managing your local HuggingFace model cache.

If you work with HuggingFace models in Python, your ~/.cache/huggingface/hub directory grows over time. This tool gives you a visual way to inspect, clean up, download, and export cached models — without leaving your browser.

Features

Feature Description
List View all cached repos sorted by size, with file counts, revision counts, and timestamps
Info Drill into any repo: see revisions, individual files, sizes, and cache paths
Delete Remove repos (all revisions) directly from the cache
Download Pull new models/datasets/spaces from the Hub into your local cache
Export Copy a cached repo to another directory — as a raw folder or a .zip archive

Installation

git clone https://github.com/YOUR_USERNAME/hf_cache_gui.git
cd hf_cache_gui
python -m venv venv
source venv/bin/activate
pip install -r requirements.txt

Usage

source venv/bin/activate
python app.py

Open http://localhost:7860 in your browser.

Quick walkthrough

  1. Click Refresh to scan your HuggingFace cache.
  2. Click any row in the table (or use the dropdown) to select a model.
  3. Use Info to see detailed file-level information.
  4. Use Delete to remove a model from cache.
  5. Use Download to fetch a new repo from the Hub by its ID (e.g. google/gemma-2b).
  6. Use Export to copy or zip a cached model to any directory.

Configuration

Custom cache directory

If your HuggingFace cache is not in the default location, set the environment variable before launching:

export HF_HOME=/path/to/your/hf/cache
python app.py

HF Token (for gated/private models)

To download gated or private models, you can either:

  1. Use the UI — paste your token into the "HF Token" field in the Download section.
  2. Log in via CLI (token is cached and reused automatically):
    huggingface-cli login
  3. Set an environment variable:
    export HF_TOKEN=hf_your_token_here
    python app.py

Requirements

  • Python 3.10+
  • gradio >= 4.0
  • huggingface_hub >= 0.20.0

License

MIT

About

Gradio GUI for managing local HuggingFace model cache (list, info, delete, download, export)

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages