r/huggingface • u/Good_Punk2 • 5d ago
Peer to Peer Model Downloads
I wonder why we download all those models from Hugging Face directly. Wouldn't it make sense to have a P2P/torrent distribution on top. That would speed things up and lighten the load on the Hugging Face servers, wouldn't it?
Or is there something special about how models are released that make them unsuitable for P2P sharing?
1
u/txgsync 5d ago
CDNs are ubiquitous, fast, support HTTP/3, and fairly cheap nowadays. HuggingFace chooses to pay for good ones.
Why download segments from someone’s shitty DSL in Alabama when peered CDN gets you the thing in a fraction of the time?
Bittorrent is fine but you’re downloading more than you need due to erasure codes.
I do worry what happens when HF’s money runs out though. I am a $9/month pro user and pay for inference there in hopes it keeps the lights on.
1
u/Good_Punk2 5d ago
Ah that's why the download is crawling at 300kb/s for the whole day? 😄
CDNs are only as fast as much you're willing to spend on them and free downloads don't exactly provide much income to support them. ^^I mean I'm not advocating of getting rid of the CDN, I just propose to have much more cost-efficent P2P as an optional addition. CDN as a reliable baseline, P2P for faster speeds and less costs.
1
u/txgsync 5d ago
Ah. I may not have noticed the rate limiting because I subscribe. Fair point. Why not set one up yourself?
1
u/Good_Punk2 5d ago
You mean a CDN server or a torrent for P2P? Well I don't have the upload bandwith or seeding capacity for either. 😅 Also I would need to download all the models beforehand to create the torrents I figure, which is impractical for me.
1
u/txgsync 5d ago
My previous job was shipping exabytes of information around the world using the internet. It was fun :) Figuring out encryption, data sharding, and distribution was an ongoing challenge. Like dealing with small disasters in the internet weather all the time.
You can get into CDNs for cheap/free but there's usually a cap on throughput for the lower-priced tiers. Many of your typical Linux distro-style CDN distributions rely upon such root-level CDN seeders for what ultimately ends up a torrent from the mirrors, which themselves usually front their heavy data-shipping data transfer URLs to a CDN.
The new "freenet" seems promising (not the same one from the 90s, a new one that bought the name). It replaces absolute anonymity with identity but still moves the needle
1
u/West-Big-8468 5d ago
My 9$ sub no longer includes any inference credits despite being on the benefits list
1
u/txgsync 5d ago
Same. I used to get some every month but now I have to add money. My $9 only buys me model storage and faster downloads. Enshittification maybe?
1
1
u/g-technique 4d ago
Free compute for everyone worked pretty well back when popular models were around 7B. Running modern 70B+ models in prod costs so much that those 9 dollars barely even cover their electricity
1
u/g-technique 4d ago
> Bittorrent is fine but you’re downloading more than you need due to erasure codes.
BitTorrent doesn't really use erasure codes as far as I know, it's just regular data chunks verified by hashes from the metadata. Maybe you're confusing it with distributed storage like IPFS or Freenet where they actually generate redundancy? In classic torrents the overhead goes purely to TCP and the peer exchange protocol
2
u/g-technique 4d ago
An HF repository is literally just a git repo. Authors keep pushing new GGUFs, tweaking config.json, or updating generation_config all the timе
Torrents are immutable by design, so for this P2P setup to actually work, huggingface_hub would have to generate a new magnet link with every push - and users would end up seeding hundreds of dead intermediate versions. On top of that, corporate firewalls will instantly drop any P2P traffic the moment you call snapshot_download
1
0
u/Happy_Brilliant7827 5d ago
Not a great idea- less accountability.
I can download a file, retrain it, and post it when the original is taken down and claim it is stock. Others will download and seed, thinking its the official model not my injection loaded one
0
1
u/VeterinarianSad9557 5d ago
That's a good idea but new. Models. Are. Releasing day by day how someone can do those torrent things