Scan your local HF cache, create .torrent files for any model or dataset, and share or download them using the BitTorrent protocol β with a beautiful CLI and Web UI.
Everything you need to share HuggingFace models peer-to-peer.
Auto-discovers models and datasets in your ~/.cache/huggingface/hub directory. No manual configuration needed.
Generate .torrent files for any cached repository with file hashing. Share them with anyone.
Download repositories using the BitTorrent protocol (libtorrent) with real-time progress tracking.
Full-featured command-line tool and a beautiful web-based UI for visual repo browsing and management.
Built-in support for English and Chinese. Extensible locale system β just add a JSON file.
Works on Windows, macOS, and Linux. One tool everywhere.
Get up and running in seconds.
git clone https://github.com/Block233/huggingface-bittorrent.git
cd hf-torrent && pip install -e .
hf-torrent
CLI and Web UI β pick your workflow.
# List cached repos $ hf-torrent list # Scan a specific directory $ hf-torrent scan /path/to/hf/cache # Create torrent for a repo $ hf-torrent create bert-base-uncased # List saved torrents $ hf-torrent torrents # Download via torrent $ hf-torrent download bert-base-uncased
Launch with a single command and open your browser:
$ hf-torrent Web UI started at http://127.0.0.1:8400
Clean, modular Python project structure.
hf-torrent/ βββ src/ β βββ hf_torrent/ β βββ cli/ # Command-line interface β βββ core/ # Cache scanning, torrent creation, download engine β βββ i18n/ # Internationalization (en_US, zh_CN) β βββ utils/ # Path helpers β βββ web/ # FastAPI app, routes, templates, static assets β βββ routes/ # Pages, cache, torrent, download APIs β βββ static/ # CSS + JS β βββ templates/# Jinja2 templates βββ torrents/ # Generated .torrent files βββ tests/ βββ pyproject.toml