Skip to content

Commit 3dfa199

Browse files
julien-cVaibhavs10WauplinpcuencaSBrandeis
authored
Document rate limits (#1944)
* unrelated * "now" is old by now cc @mishig25 * First, a few links * more links + reorder * lesssgo * Tweaks * Ah i forgot: add a line about E+ with defined IP Range cc @Pierrci @XciD * Apply suggestions from code review Co-authored-by: vb <[email protected]> Co-authored-by: Lucain <[email protected]> * Update docs/hub/rate-limits.md Co-authored-by: Pedro Cuenca <[email protected]> * add this info block * explicitly link to the Resolver endpoint cc @pcuenca @SBrandeis * Update docs/hub/rate-limits.md Co-authored-by: Simon Brandeis <[email protected]> * Update rate-limits.md * Update headers spec --------- Co-authored-by: vb <[email protected]> Co-authored-by: Lucain <[email protected]> Co-authored-by: Pedro Cuenca <[email protected]> Co-authored-by: Simon Brandeis <[email protected]>
1 parent 3dd7234 commit 3dfa199

File tree

9 files changed

+119
-9
lines changed

9 files changed

+119
-9
lines changed

docs/hub/_toctree.yml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,10 +27,12 @@
2727
title: Tokens Management
2828
- local: enterprise-hub-analytics
2929
title: Publisher Analytics
30-
- local: enterprise-hub-network-security
31-
title: Network Security
3230
- local: enterprise-hub-gating-group-collections
3331
title: Gating Group Collections
32+
- local: enterprise-hub-network-security
33+
title: Network Security
34+
- local: rate-limits
35+
title: Rate Limits
3436

3537
- local: pro
3638
title: PRO Plan

docs/hub/api.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,12 @@ You can also access the OpenAPI specification directly: [https://huggingface.co/
1717
</a>
1818
</div>
1919

20+
All API calls are subject to the HF-wide [Rate limits](./rate-limits). Upgrade your account if you need elevated, large-scale access.
21+
22+
> [!INFO]
23+
> The rest of this page is a partial list of some of our API endpoints. But note that the exhaustive reference is our [OpenAPI documentation](https://huggingface.co/spaces/huggingface/openapi).
24+
> It is much more complete and guaranteed to always be up-to-date.
25+
2026
## Repo listing API
2127

2228
The following endpoints help get information about models, datasets, and Spaces stored on the Hub.

docs/hub/billing.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,12 +26,12 @@ Private repository storage above the [included storage](./storage-limits) will b
2626
The PRO subscription unlocks essential features for serious users, including:
2727

2828
- Higher [storage capacity](./storage-limits) for public and private repositories
29-
- Higher bandwidth and API rate limits
29+
- Higher bandwidth and API [rate limits](./rate-limits)
3030
- Included credits for [Inference Providers](/docs/inference-providers/)
3131
- Higher tier for ZeroGPU Spaces usage
3232
- Ability to create ZeroGPU Spaces and use Dev Mode
3333
- Ability to publish Social Posts and Community Blogs
34-
- Leverage the Data Studio on private datasets
34+
- Leverage the [Data Studio](./datasets-viewer) on private datasets
3535
- Run and schedule serverless [CPU/ GPU Jobs](https://huggingface.co/docs/huggingface_hub/en/guides/jobs)
3636

3737
View the full list of benefits at https://huggingface.co/pro then subscribe over at https://huggingface.co/subscribe/pro

docs/hub/enterprise-hub.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,8 @@ In this section we will document the following Enterprise Hub features:
2424
- [Advanced Security](./enterprise-hub-advanced-security)
2525
- [Tokens Management](./enterprise-hub-tokens-management)
2626
- [Publisher Analytics](./enterprise-hub-analytics)
27-
- [Network Security](./enterprise-hub-network-security)
2827
- [Gating Group Collections](./enterprise-hub-gating-group-collections)
28+
- [Network Security](./enterprise-hub-network-security)
29+
- [Higher Rate limits](./rate-limits)
2930

3031
Finally, Team & Enterprise plans include 1TB of [private repository storage](./storage-limits) per seat in the subscription, i.e. if your organization has 40 members, then you have 40TB included storage for your private models and datasets.

docs/hub/index.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ The Hugging Face Hub is a platform with over 1.7M models, 400k datasets, and 600
1717
<a class="no-underline! hover:opacity-60 transform transition-colors hover:translate-x-px" href="./enterprise-hub-advanced-security">Advanced Security</a>
1818
<a class="no-underline! hover:opacity-60 transform transition-colors hover:translate-x-px" href="./enterprise-hub-tokens-management">Tokens Management</a>
1919
<a class="no-underline! hover:opacity-60 transform transition-colors hover:translate-x-px" href="./enterprise-hub-network-security">Network Security</a>
20+
<a class="no-underline! hover:opacity-60 transform transition-colors hover:translate-x-px" href="./rate-limits">Rate Limits</a>
2021
</div>
2122

2223
<div class="group flex flex-col space-y-2 rounded-xl border border-orange-100 bg-linear-to-br from-orange-50 dark:bg-none px-6 py-4 transition-colors hover:shadow-sm dark:border-orange-700">

docs/hub/pro.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,12 @@
33
The PRO subscription unlocks essential features for serious users, including:
44

55
- Higher [storage capacity](./storage-limits) for public and private repositories
6-
- Higher bandwidth and API rate limits
6+
- Higher bandwidth and API [rate limits](./rate-limits)
77
- Included credits for [Inference Providers](/docs/inference-providers/)
88
- Higher tier for [ZeroGPU Spaces](./spaces-zerogpu) usage
99
- Ability to create ZeroGPU Spaces and use [Dev Mode](./spaces-dev-mode)
1010
- Ability to publish Social Posts and Community Blogs
11-
- Leverage the Data Studio on private datasets
11+
- Leverage the [Data Studio](./datasets-viewer) on private datasets
1212
- Run and schedule serverless [CPU/ GPU Jobs](https://huggingface.co/docs/huggingface_hub/en/guides/jobs)
1313

1414
View the full list of benefits at **https://huggingface.co/pro** then subscribe over at https://huggingface.co/subscribe/pro

docs/hub/rate-limits.md

Lines changed: 100 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,100 @@
1+
# Hub Rate limits
2+
3+
To protect our platform's integrity and ensure availability to as many AI community members as possible, we enforce rate limits on all requests made to the Hugging Face Hub.
4+
5+
We define different rate limits for distinct classes of requests. We distinguish three main buckets:
6+
7+
- **Hub APIs**
8+
- e.g. model or dataset search, repo creation, user management, etc. All endpoints that belong to this bucket are documented in [Hub API Endpoints](./api).
9+
- **Resolvers**
10+
- They're all the URLs that contain a `/resolve/` segment in their path, which serve user-generated content from the Hub. Concretely, those are the URLs that are constructed by open source libraries (transformers, datasets, vLLM, llama.cpp, …) or AI applications (LM Studio, Jan, ollama, …) to download model/dataset files from HF.
11+
- Specifically, this is the ["Resolve a file" endpoint](https://huggingface.co/spaces/huggingface/openapi#tag/models/get/{namespace}/{repo}/resolve/{rev}/{path}) documented in our OpenAPI spec.
12+
- Resolve requests are heavily used by the community, and since we optimize our infrastructure to serve them with maximum efficiency, the rate limits for Resolvers are the highest.
13+
- **Pages**
14+
- All the Web pages we host on huggingface.co.
15+
- Usually Web browsing requests are made by humans, hence rate limits don't need to be as high as the above mentioned programmatic endpoints.
16+
17+
> [!TIP]
18+
> All values are defined over 5-minute windows, which allows for some level of "burstiness" from an application or developer's point of view.
19+
20+
If you, your organization, or your application need higher rate limits, we encourage you to upgrade your account to PRO, Team, or Enterprise. We prioritize support requests from PRO, Team, and Enterprise customers – see built-in limits in [Rate limit Tiers](#rate-limit-tiers).
21+
22+
## Billing dashboard
23+
24+
At any point, you can check your rate limit status on your (or your org’s) Billing page: https://huggingface.co/settings/billing
25+
26+
![dashboard for rate limits](https://cdn-uploads.huggingface.co/production/uploads/5dd96eb166059660ed1ee413/0pzQQyuVG3c9tWjCqrX9Y.png)
27+
28+
On the right side, you will see three gauges, one for each bucket of Requests.
29+
30+
Each bucket presents the number of current (last 5 minutes) requests, and the number of allowed requests based on your user account or organization plan.
31+
32+
Whenever you exceed the limit in the past 5 minutes (the view is updated in real-time), the bar will turn red.
33+
34+
Note: You can use the context switcher to easily switch between your user account and your orgs.
35+
36+
## HTTP Headers
37+
38+
Whenever you or your organization hits a rate limit, you will receive a **429** `Too Many Requests` HTTP error.
39+
40+
We implement the mechanism described in the [IETF draft (Version 9)](https://datatracker.ietf.org/doc/draft-ietf-httpapi-ratelimit-headers/) titled “RateLimit HTTP header fields for HTTP” (also known as `draft-ietf-httpapi-ratelimit-headers`).
41+
42+
The goal is to define standardized HTTP headers that servers can use to advertise quota / rate-limit policies and communicate current usage / limits to clients so that they can avoid being throttled.
43+
44+
Precisely, we implement the following headers:
45+
46+
| Header | Purpose / Meaning |
47+
| ---------------------- | --------------------------------------------------------------------------------------------------------------------------------------- |
48+
| **`RateLimit`** | The total allowed rate limit for the current window. “How many requests (of this type) you’re allowed to perform.” |
49+
| **`RateLimit-Policy`** | Carries the rate limit policy itself (e.g. “100 requests per 5 minutes”). It’s informative; shows what policy the client is subject to. |
50+
51+
A set of examples is as follows:
52+
53+
| Header | Example |
54+
| ---------------------- | ----------------------------------------------------------------------------------------------------- |
55+
| **`RateLimit`** | `"api\|pages\|resolvers";r=[remaining];t=[seconds remaining until reset]` |
56+
| **`RateLimit-Policy`** | `"fixed window";"api\|\pages\|resolvers";q=[total allowed for window];w=[window duration in seconds]` |
57+
58+
## Rate limit Tiers
59+
60+
Here are the current rate limits (in September '25) based on your plan:
61+
62+
| Plan | API | Resolvers | Pages |
63+
| ------------------------------------------------------------------------- | -------- | --------- | ------ |
64+
| Anonymous user (per IP address) | 500 \* | 3,000 \* | 100 \* |
65+
| Free user | 1,000 \* | 5,000 \* | 200 \* |
66+
| PRO user | 2,500 | 12,000 | 400 |
67+
| Team organization | 3,000 | 15,000 | 400 |
68+
| Enterprise organization | 6,000 | 30,000 | 600 |
69+
| Enterprise Plus organization | 10,000 | 50,000 | 1,000 |
70+
| Enterprise Plus organization <br> When Organization IP Ranges are defined | 100,000 | 500,000 | 10,000 |
71+
| Academia Hub organization | 2,500 | 12,000 | 400 |
72+
73+
\* Anonymous and Free users are subject to change over time depending on platform health 🤞
74+
75+
Note: For organizations, rate limits are applied individually to each member, not shared among members.
76+
77+
## What if I get rate-limited
78+
79+
First, make sure you always pass a `HF_TOKEN`, and it is passed downstream to all libraries or applications that download _stuff_ from the Hub.
80+
81+
This is the number one reason users get rate limited and is a very easy fix.
82+
83+
Despite passing `HF_TOKEN` if you are still rate limited, you can:
84+
85+
- spread out your requests over longer periods of time
86+
- replace Hub API calls with Resolver calls, whenever possible (Resolver rate limits are much higher and much more optimized).
87+
- upgrade to PRO, Team, or Enterprise.
88+
89+
## Granular user action Rate limits
90+
91+
In addition to those main classes of rate limits, we enforce limits on certain specific kinds of user actions, like:
92+
93+
- repo creation
94+
- repo commits
95+
- discussions and comments
96+
- moderation actions
97+
- etc.
98+
99+
We don't currently document the rate limits for those specific actions, given they tend to change over time more often. If you get quota errors, we encourage you to upgrade your account to PRO, Team, or Enterprise.
100+
Feel free to get in touch with us via the support team.

docs/hub/search.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Search
22

3-
You can now easily search anything on the Hub with **Full-text search**. We index model cards, dataset cards, and Spaces app.py files.
3+
You can easily search anything on the Hub with **Full-text search**. We index model cards, dataset cards, and Spaces app.py files.
44

55
Go directly to https://huggingface.co/search or, using the search bar at the top of https://huggingface.co, you can select "Try Full-text search" to help find what you seek on the Hub across models, datasets, and Spaces:
66

docs/hub/webhooks.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -242,7 +242,7 @@ This can be helpful if accessing the HTTP headers of the request is complicated
242242

243243
Each Webhook is limited to 1,000 triggers per 24 hours. You can view your usage in the Webhook settings page in the "Activity" tab.
244244

245-
If you need to increase the number of triggers for your Webhook, contact us at [email protected].
245+
If you need to increase the number of triggers for your Webhook, upgrade to PRO, Team or Enterprise and contact us at [email protected].
246246

247247
## Developing your Webhooks
248248

0 commit comments

Comments
 (0)