Skip to content

Conversation

@hanouticelina
Copy link
Contributor

The /preupload/ endpoint is called in chunks of 256 files when uploading to the Hub. for large uploads, this means multiple sequential API calls, making it more likely to hit rate limits. Also, thanks to @Wauplin's dashboard (private link), we can see quite a lot of 429 errors on this endpoint in the last 24h.
let's take advantage of the rate limit header parsing to introduce smart retry handling. the PR also introduces backoff retry for transient errors (5xx).

@hanouticelina hanouticelina requested a review from Wauplin December 2, 2025 17:33
@HuggingFaceDocBuilderDev

The docs for this PR live here. All of your documentation changes will be reflected on that endpoint. The docs are available until 30 days after the last update.

@Wauplin
Copy link
Contributor

Wauplin commented Dec 3, 2025

The /preupload/ endpoint is called in chunks of 256 files when uploading to the Hub. for large uploads, this means multiple sequential API calls, making it more likely to hit rate limits.

To complement on that, it is also possible in some workflows that the /preupload endpoint is called per-file. This is something we try to avoid but can't control it ourselves if users are doing it.

Anyway, agree we should mitigate HTTP 429 errors!

@hanouticelina hanouticelina merged commit d6374cd into main Dec 3, 2025
22 of 23 checks passed
@hanouticelina hanouticelina deleted the smart-retry-for-preupload branch December 3, 2025 14:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants