hf_transfer icon indicating copy to clipboard operation
hf_transfer copied to clipboard

Set throttle limit?

Open BramVanroy opened this issue 10 months ago • 5 comments

While there is no denying that HF Transfer is an awesome tool, it works a bit too well for me. I've found that it is maxing out our network, leading to slower experiences for my colleagues. Is there a way to throttle the max download speed to e.g. 200MBps with an environment variable or something? If not, it would be a great addition to the library!

BramVanroy avatar Jan 27 '25 10:01 BramVanroy

I would also like to limit the max concurrent requests since currently it will cause the server to refuse responding.

James4Ever0 avatar Feb 28 '25 10:02 James4Ever0

Or max the speed. I am also experiencing network saturation causing DNS errors because the throughput is too important for download.

AlanBlanchet avatar Nov 04 '25 13:11 AlanBlanchet

#[pyo3(signature = (url, filename, max_files, chunk_size, parallel_failures=0, max_retries=0, headers=None, callback=None))]

With max_files and chunk_size you should be able to throttle this. default is 100 files and 10MB chunk size

Narsil avatar Nov 04 '25 15:11 Narsil

Will try thanks ! I think the problem we have might not even be linked to this hf_transfer anyways... It might be because of the new hf xet backend for storing files since hf_transfer is written as deprecated on the huggingface docs.

AlanBlanchet avatar Nov 04 '25 16:11 AlanBlanchet

hf_xet uses a transfer protocol based on hf_transfer so the control should be the same, but yes please report to hf_xet if you're using it.

Narsil avatar Nov 07 '25 08:11 Narsil