Pirate Face Hub
Plug and play torrent downloads for Hugging Face models. Add one package. Change nothing else.
uv run --with pirateface python your_script.py
or install it once and forget about it:
pip install pirateface
That's the whole setup. No code changes, no config, no new API. Your script still calls transformers or
huggingface_hub like it always did, and the files now come from Pirate Face
seeders over BitTorrent:
from transformers import AutoModelForCausalLM
model = AutoModelForCausalLM.from_pretrained("org/model") # unchanged, now from the swarm
The same goes for anything that downloads through huggingface_hub: diffusers, sentence-transformers,
hf_hub_download, snapshot_download and the hf download CLI.
Every file is checked against Hugging Face's own fingerprint (SHA-256 for large files, git SHA-1 for the rest) before it goes into the normal Hugging Face cache. If Pirate Face doesn't have the model, a peer is missing, or a check fails, that file comes from Hugging Face as usual. Uninstall it and your code runs exactly as before.
There's also a small CLI:
pf download org/model [--revision REV]
How it hooks in
The package installs pirateface.pth, which Python runs at startup. It does nothing until something
imports huggingface_hub, then fetches each file's bytes from the swarm. Hugging Face still answers
which commit and fingerprint to expect, and every file from the swarm is checked against it. If Pirate
Face has no torrent, or no peer sends the file list within 30 s, the file comes from Hugging Face as usual.
Cache layout, symlinks and locks stay with huggingface_hub.
Settings
| Variable | Default | |
|---|---|---|
PF_DISABLE |
off | Turn the hook off |
PF_QUIET |
off | Print nothing |
PF_NO_RESCUE |
off | Don't ask Pirate Face to add models it doesn't have yet |
PF_DEBUG |
off | Print libtorrent's log |
PF_CACHE |
~/.cache/pirateface |
Where torrent data and file lists are kept |
PF_API |
https://pirateface.co |
Pirate Face server |
PF_LISTEN |
any free port | libtorrent listen interfaces |
PF_METADATA_TIMEOUT |
30 |
Seconds to wait for a peer to send the file list |
PF_STALL_TIMEOUT |
60 |
Seconds without progress before falling back to Hugging Face |
Flags are on for any value except empty or 0.
Needs Python 3.12 or 3.13 (libtorrent has no wheels for 3.14 yet). uvx picks the newest Python it has,
so pass the version:
uvx -p 3.13 --with pirateface --from huggingface_hub hf download org/model
Development
uv run --group dev ruff check
Metadata
Release files for pirateface 0.1.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| pirateface-0.1.1.tar.gz | 21.1 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| pirateface-0.1.1-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 33.6 kB
Release files / pirateface-0.1.1.tar.gz
| Download URL | pirateface-0.1.1.tar.gz |
|---|---|
| Size | 21.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
a1f606eea79bb4e14df7f17071d73ce2caad109baf86627893993c046eb12f9b
|
|
BLAKE2b-256 checksum How to use checksums |
42aaa4e2b0bf40e760f62b9b07a707bd2cd173b2bbc364948f33da2320db35af
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.9.16 {"installer":{"name":"uv","version":"0.9.16","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
|
Release files / pirateface-0.1.1-py3-none-any.whl
| Download URL | pirateface-0.1.1-py3-none-any.whl |
|---|---|
| Size | 12.5 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
b7cda915ca1ee6f1378c2931b116a2243c1410999d7a112e99084c21680c575c
|
|
BLAKE2b-256 checksum How to use checksums |
dc2c2b1716677fe001041cf70e114a173937f4b64ff54de791039fc2577c0248
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.9.16 {"installer":{"name":"uv","version":"0.9.16","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
|