hf-hub icon indicating copy to clipboard operation
hf-hub copied to clipboard

missing hf_hub::api::tokio::ApiBuilder.with_retries()

Open nazq opened this issue 3 months ago • 1 comments

Was getting a bunch of 429s and I noticed the Builders are different between the sync and tokio variants. Adding with_retries into the tokio mod would work. But I was thinking about submitting a PR which harmonizes both modules and gives flexibility on all ExpBackOff params, then adding this to both builders.

any thoughts/concerns ?

Thanks

nazq avatar Sep 23 '25 20:09 nazq

We shouldn't need this tooling for the sync variant, because you should be issuing single calls per file in sync therefore the 429 are entirely on the end user to fix.

For tokio, because of the high setting, and the fact that in general we multiplex the download over multiple connections, we need to exponential backoff because we issue so many connections, that the backend tends to have transient issues (not 429). So it's quite different from the 429 you're describing.

Narsil avatar Sep 28 '25 20:09 Narsil