# Getting 429 Too Many Request

**URL:** </static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fgetting-429-too-many-request%2F171288%3E%5C
**Category:** 🤗Transformers\
**Created:** [December 7, 2025, 10:32pm UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fgetting-429-too-many-request%2F171288 "2025-12-07T22:32:37Z")\
**Posts on this page:** 1\
**Showing post:** 4

<div class="post-metadata">

**Author:** ![John6666](https://sea2.discourse-cdn.com/hellohellohello/user_avatar/discuss.huggingface.co/john6666/32/27664_2.png) [@John6666](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Fu%2FJohn6666)%5C
**Post date:** [December 8, 2025, 7:40am UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fgetting-429-too-many-request%2F171288%2F4 "2025-12-08T07:40:06Z")

</div>

Hmm… Error 429 is a common error, but it’s not often seen when loading models. Maybe it’s being loaded repeatedly from within a loop…?

* * *

You are hitting Hugging Face Hub rate limits on model file downloads.  
Upgrading to Pro does not fix your current behavior because your Ray workers are collectively sending too many `/resolve/...` requests from the same IP, so the Hub is throttling that IP/token.

Below is the background, what is actually happening, and concrete steps to unblock yourself.

* * *

## 1. What this 429 means on Hugging Face

Your stack trace shows:

- `.../huggingface_hub/file_download.py -> get_hf_file_metadata -> _request_wrapper -> hf_raise_for_status`
- Final error:  
`HfHubHTTPError: 429 Client Error: Too Many Requests for url: https://huggingface.co/Qwen/Qwen3-32B/resolve/main/config.json`

Key points:

- The URL contains `/resolve/main/...`. These are **“resolver”** endpoints used to fetch model files and metadata from the Hub.([Hugging Face](https://huggingface.co/docs/hub/en/rate-limits "Hub Rate limits"))
- Hugging Face defines rate limits per 5-minute window for different action types. For you, the relevant bucket is **Resolvers** (file downloads and metadata).([Hugging Face](https://huggingface.co/docs/hub/en/rate-limits "Hub Rate limits"))
- HTTP 429 in this context means: **too many resolver requests from your IP or token in a short time**. It is not a permission or “you must buy Pro” error. HF staff say exactly this in several threads.([Hugging Face Forums](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fhow-does-the-hub-handles-http-error-429%2F147346 "How does the hub handles http error 429?"))

Even Pro accounts have resolver limits. Pro gives a higher ceiling, but if your code is very aggressive (many workers, no cache), you can still exceed that ceiling and get 429s.

* * *

## 2. Why it’s happening in your Ray + Qwen3-32B setup

You have:

- A large model: `Qwen/Qwen3-32B` (many shards + config files)
- Ray workers: each worker running training code (`ray::_RayTrainWorker__execute.get_next`)

Typical pattern in this setup:

1. Each worker calls something like `AutoModel.from_pretrained("Qwen/Qwen3-32B")` or similar.

2. `transformers` → `huggingface_hub`:

3. When many workers do this at the same time, you get **thousands of HTTP requests in a few minutes** :

4. The Hub sees this as a high-volume client from a single IP or token. Once the 5-minute resolver quota is exceeded, it starts returning 429.

This pattern is exactly what shows up in other issues:

- Training on SlimPajama / large datasets on TPUs: many small files + many processes ⇒ 429 on downloads.([GitHub](https://github.com/huggingface/datasets/issues/7344 "HfHubHTTPError: 429 Client Error: Too Many Requests for ..."))
- Production systems hitting HEAD / metadata for every request with vLLM / HF Hub ⇒ HEAD storms ⇒ 429.([GitHub](https://github.com/huggingface/huggingface_hub/issues/3312 "Production system breaks due to HTTP 429 errors #3312"))
- Users downloading big models (DeepSeek, LLaMA, Falcon, etc.) from clusters ⇒ same 429 on `/resolve/main/config.json`.([GitHub](https://github.com/huggingface/transformers/issues/21129 "Error 429 · Issue #21129 · huggingface/transformers"))

So your code is not “wrong” in a functional sense. It is just **too chatty with the Hub** for the plan and environment you are using.

* * *

## 3. Why Pro and switching accounts did not help

You observed:

- Upgrading to Pro did not fix it.
- Switching accounts on the same machine/IP did not fix it.

This matches how HF rate limits work:

1. **Per-IP effects**  
Several HF threads and issues confirm that the Hub often enforces limits by IP or IP+token combination. If you hammer from one IP (e.g., a cloud VM or NAT gateway), switching HF accounts does not remove the IP’s request history in the current window.([Hugging Face Forums](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fhow-does-the-hub-handles-http-error-429%2F147346 "How does the hub handles http error 429?"))

2. **Anonymous vs authenticated traffic**  
If your Ray workers are not actually using your token (no `HF_TOKEN` in those processes), they are counted as **anonymous** traffic, which has much lower limits than Pro auth traffic.([Hugging Face](https://huggingface.co/docs/hub/en/rate-limits "Hub Rate limits"))

3. **Pro increases quota but does not remove limits**  
The rate limits docs are clear: each tier has higher quotas, but everyone has finite limits per 5-minute window. If your pattern is “download or metadata-check the entire big model from scratch on many workers,” you can blow through even Pro’s resolver quota.([Hugging Face](https://huggingface.co/docs/hub/en/rate-limits "Hub Rate limits"))

So Pro is necessary for sustained heavy use, but **not sufficient** if your access pattern is inefficient.

* * *

## 4. Immediate unblocking

Short term you have two constraints:

1. The **current 5-minute window**

2. Possible **longer cool-down**

You cannot override the Hub from your side. What you can do is:

- Stop the Ray job that is spamming requests.
- Allow some time for the limit window to reset.
- Before restarting, change your download pattern as in the next section so you do not immediately hit 429 again.

* * *

## 5. Concrete long-term fixes for your Ray + Qwen setup

Think in terms of **“reduce Hub requests per 5 minutes”** :

### 5.1 Make sure all workers are authenticated (no anonymous traffic)

You want all calls to use your Pro quota, not the anonymous bucket.

On every Ray node (driver + workers), ensure:

```bash
export HF_TOKEN=hf_your_token_here # read access is enough

```

or in Python before Ray starts:

```python
import os
os.environ["HF_TOKEN"] = "hf_your_token_here"

```

You can verify inside a worker:

```python
from huggingface_hub import whoami

print(whoami()) # should show your account, not None / anonymous

```

If this prints an error or anonymous info, then your Pro plan is not being used by that process.([Hugging Face](https://huggingface.co/docs/hub/en/rate-limits "Hub Rate limits"))

* * *

### 5.2 Use a shared cache and download **once** , not per worker

Goal: One download from the Hub, many reuses from disk.

1. Choose a shared directory accessible by all workers on a node or cluster, e.g.:

2. Pre-download the model **once** in a separate preparation step:

3. In your Ray training code, load **only from that local path** :

4. Ensure Ray workers **see the same path** :

This shared-cache pattern is the main technique HF itself suggests to avoid repeated downloads and rate limits in multi-node scenarios.([GitHub](https://github.com/huggingface/datasets/issues/7344 "HfHubHTTPError: 429 Client Error: Too Many Requests for ..."))

* * *

### 5.3 Serialize or cap concurrent downloads

If you cannot fully pre-download, at least avoid many parallel snapshot/download calls.

Pattern:

```python
from filelock import FileLock
from huggingface_hub import snapshot_download

lock = FileLock("/srv/hf-cache/Qwen3-32B.lock")

with lock:
    snapshot_download(
        "Qwen/Qwen3-32B",
        local_dir="/srv/hf-cache/Qwen3-32B",
        local_dir_use_symlinks=False,
    )

```

- All workers share the same lock file.
- Only the first one actually talks to the Hub; others wait and then see the local files in the cache.

This is similar in spirit to PRs that reduce filesystem calls in dataset scripts to fix 429 “Too Many Requests” errors.([Hugging Face](https://huggingface.co/datasets/bigbio/twadrl/discussions/2 "bigbio/twadrl · Fix TOO MANY REQUESTS error"))

* * *

### 5.4 Limit Ray’s model-loading pattern

Avoid doing `from_pretrained("Qwen/Qwen3-32B")` inside the inner loop of each Ray task.

Better:

- Load the model once per **long-lived worker** , then reuse it.
- Do not spawn and tear down many short-lived workers that each load the model from scratch.
- Avoid multiple calls that implicitly trigger metadata checks on the Hub (even if the weights are cached). vLLM and others have hit 429 just from repeated HEAD requests.([GitHub](https://github.com/huggingface/huggingface_hub/issues/3312 "Production system breaks due to HTTP 429 errors #3312"))

* * *

### 5.5 Upgrade `huggingface_hub` and let it handle 429s gracefully

Install a recent version:

```bash
pip install -U "huggingface_hub"

```

From version 1.2.0, the library:

- Parses the `RateLimit` headers on 429,
- Sleeps exactly until reset,
- Retries automatically.([Hugging Face](https://huggingface.co/docs/hub/en/rate-limits "Hub Rate limits"))

This does not change your quota, but it avoids hard crashes when you are only _slightly_ over. Combine this with fewer requests, and your job should run smoothly.

* * *

### 5.6 If you use mirrors or custom endpoints, treat them the same

You mentioned it feels IP-based and changing accounts does not help. That also matches reports where:

- People got 429 even when using HF mirrors or different endpoints, because the underlying CDN or mirror still saw too many requests from the same IP range.([CSDN](https://blog.csdn.net/lovechris00/article/details/146442829 "报错- huggingface download 429 (hf-mirror 也无效) 原创"))

So do not rely on mirrors alone to “work around” the issue. They still need fewer requests and caching.

* * *

### 5.7 Network / IPv6 corner cases

Some HF users on cloud environments report:

- Getting 429 on almost any call from a specific IPv6 address block, while IPv4 works better.
- Solving issues by disabling IPv6 or using a different network path.([Hugging Face Forums](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fgit-clone-often-gives-403-or-429-errors%2F144510 "Git clone often gives 403 or 429 errors - Beginners"))

This is not always needed, but if after fixing caching and concurrency you still get 429 instantly, testing from a different machine or with IPv6 disabled is a useful diagnostic.

* * *

## 6. How to confirm you are fixed

After you implement the changes:

1. Start from a clean job where:

2. Run one Ray worker and verify:

3. Scale up workers:

If everything is local, 429 should disappear completely, because no resolver calls reach the Hub.

* * *

## 7. When to contact Hugging Face support

If, **after** :

- Using `HF_TOKEN` in every process,
- Using a shared cache + `local_files_only=True`,
- Limiting concurrent downloads,
- Running a current `huggingface_hub`,

you still get 429s very early in the job, then:

- Collect example request IDs from the 429 responses if possible.
- Note your username, plan, and approximate time windows.
- Open a ticket or post on the Hub / Transformers forum.

HF staff regularly handle “I’m seeing unexpected 429s” cases and will check logs and limits on their side.([Hugging Face](https://huggingface.co/docs/hub/en/rate-limits "Hub Rate limits"))

* * *

### Short summary

- The error is a **Hub resolver rate limit (HTTP 429)** on `/resolve/main/config.json`, caused by many Ray workers hitting the same big model from the same IP.([Hugging Face](https://huggingface.co/docs/hub/en/rate-limits "Hub Rate limits"))

- Pro raises the quota but does not remove limits, and anonymous or shared-IP traffic can still be throttled.([Hugging Face](https://huggingface.co/docs/hub/en/rate-limits "Hub Rate limits"))

- To unblock and prevent recurrence:

---

_[View the full topic](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fgetting-429-too-many-request%2F171288)._
