# HF Agents Course 404 Client Error: Not Found for url

**URL:** <https://discuss.huggingface.co/t/hf-agents-course-404-client-error-not-found-for-url/162747>\
**Category:** 🤗Hub\
**Created:** [July 12, 2025, 11:58am UTC](https://discuss.huggingface.co/t/hf-agents-course-404-client-error-not-found-for-url/162747 "2025-07-12T11:58:39Z")\
**Posts on this page:** 13\
**Page:** 1

<div class="post-metadata">

**Author:** ![TinaVesper](https://sea2.discourse-cdn.com/hellohellohello/user_avatar/discuss.huggingface.co/tinavesper/32/50991_2.png) [@TinaVesper](https://discuss.huggingface.co/u/TinaVesper)\
**Post date:** [July 12, 2025, 11:58am UTC](https://discuss.huggingface.co/t/hf-agents-course-404-client-error-not-found-for-url/162747/1 "2025-07-12T11:58:39Z")

</div>

Hey guys

I’m struggling with this error:

404 Client Error: Not Found for url: [https://router.huggingface.co/hf-inference/models/Qwen/Qwen2.5-Coder-32B-Instruct/v1/chat/completions](https://router.huggingface.co/hf-inference/models/Qwen/Qwen2.5-Coder-32B-Instruct/v1/chat/completions)

The code is taken from here:

> **[Introduction to the LlamaHub - Hugging Face Agents Course](https://huggingface.co/learn/agents-course/en/unit2/llama-index/llama-hub)**
>
> We’re on a journey to advance and democratize artificial intelligence through open source and open science.

It’s appearing with any instruct model i tried (including those with special access such as Llama models)

What’s that?

Would be grateful for any help

I saw there is maybe a problem with zero-scale or something like that, but i used popular models, I’m not sure that this is a reason

---

<div class="post-metadata">

**Author:** ![John6666](https://sea2.discourse-cdn.com/hellohellohello/user_avatar/discuss.huggingface.co/john6666/32/27664_2.png) [@John6666](https://discuss.huggingface.co/u/John6666)\
**Post date:** [July 12, 2025, 12:40pm UTC](https://discuss.huggingface.co/t/hf-agents-course-404-client-error-not-found-for-url/162747/2 "2025-07-12T12:40:21Z")

</div>

I think this is due to a large number of models whose deployment has been canceled, as well as major changes to the library used for the Inference API. I’m not familiar with the workaround for this issue on LlamaIndex, but [according to GitHub, updating the HF library should still make it work](https://github.com/run-llama/llama_index/issues/18547#issuecomment-2863776223).

### To update hf\_hub library

```auto
pip install -U huggingface_hub

```

---

<div class="post-metadata">

**Author:** ![TinaVesper](https://sea2.discourse-cdn.com/hellohellohello/user_avatar/discuss.huggingface.co/tinavesper/32/50991_2.png) [@TinaVesper](https://discuss.huggingface.co/u/TinaVesper)\
**Post date:** [July 12, 2025, 12:57pm UTC](https://discuss.huggingface.co/t/hf-agents-course-404-client-error-not-found-for-url/162747/3 "2025-07-12T12:57:00Z")

</div>

> [@John6666](#):
>
> `pip install -U huggingface_hub`

Hi, thanks for your answer!  
Unfortunately updating didn’t help, I’ve tried it

---

<div class="post-metadata">

**Author:** ![John6666](https://sea2.discourse-cdn.com/hellohellohello/user_avatar/discuss.huggingface.co/john6666/32/27664_2.png) [@John6666](https://discuss.huggingface.co/u/John6666)\
**Post date:** [July 12, 2025, 1:04pm UTC](https://discuss.huggingface.co/t/hf-agents-course-404-client-error-not-found-for-url/162747/4 "2025-07-12T13:04:28Z")

</div>

Hmm, in that case, do you need to update LlamaIndex, or has it become unusable due to further specification changes…?  
I think [the model itself is deployed via Inference Provider](https://huggingface.co/models?apps=tgi&inference_provider=all&sort=trending).

However, if you are not particularly attached to that model, it might be better to look for an alternative. More detailed information is available in the Agents course channel on Hugging Face Discord.

### Alternative API Endpoints / local models for smolagents

> [@Avoiding the usage of HfApiModel and using local model - \`smolagents\`](https://discuss.huggingface.co/t/avoiding-the-usage-of-hfapimodel-and-using-local-model-smolagents/152711):
>
> I try to learn the basics of smolagents and I got the following big problem - please help! I am getting the message that I have run out of the free tier for HfApiModel, and I need to buy the paid tier. How can I use the local model to run with my CodeAgent in smolagents?

> [@Alternative options for API endpoints](https://discuss.huggingface.co/t/alternative-options-for-api-endpoints/153276):
>
> I just posted in the Discord as well, but figured I’d post over here for those who are only checking one or the other. Hi all, I have been reading a lot of questions around what to do if the examples for use the HfApiModel fail, or you run out of credits. I was in a similar situation, and went down the path of running locally to begin with using the MLXModel class and Qwen2.5-Coder-32B, but that was leading to very long waits even with my maxed out M4 Max. So I wanted to share another solution…

---

<div class="post-metadata">

**Author:** ![TinaVesper](https://sea2.discourse-cdn.com/hellohellohello/user_avatar/discuss.huggingface.co/tinavesper/32/50991_2.png) [@TinaVesper](https://discuss.huggingface.co/u/TinaVesper)\
**Post date:** [July 12, 2025, 2:57pm UTC](https://discuss.huggingface.co/t/hf-agents-course-404-client-error-not-found-for-url/162747/5 "2025-07-12T14:57:28Z")

</div>

Everything is up-to-date

Actually I’m using some other models directly, but just want to cope with that problem. Maybe someone knows how to fix it

Thank you anyway

---

<div class="post-metadata">

**Author:** ![John6666](https://sea2.discourse-cdn.com/hellohellohello/user_avatar/discuss.huggingface.co/john6666/32/27664_2.png) [@John6666](https://discuss.huggingface.co/u/John6666)\
**Post date:** [July 12, 2025, 11:17pm UTC](https://discuss.huggingface.co/t/hf-agents-course-404-client-error-not-found-for-url/162747/6 "2025-07-12T23:17:25Z")

</div>

> [https://router.huggingface.co/hf-inference/models/Qwen/Qwen2.5-Coder-32B-Instruct/v1/chat/completions](https://router.huggingface.co/hf-inference/models/Qwen/Qwen2.5-Coder-32B-Instruct/v1/chat/completions)

> hf-inference \<= this

I see. Let me explain the situation. It is normal for this URL not to work _because this model has not been deployed with HF Inference_. [Currently, very few LLMs are deployed via HF Inference](https://huggingface.co/models?apps=tgi&inference_provider=hf-inference&sort=trending). [Most are deployed via other Inference Providers](https://huggingface.co/models?apps=tgi&inference_provider=fireworks-ai,cerebras,novita,featherless-ai,nebius,together,hyperbolic,nscale,sambanova,groq,fal-ai,cohere,replicate&sort=trending).

If LlamaIndex does not have a feature to switch the Inference Provider or set it to `="auto"`, only few models will work.

---

<div class="post-metadata">

**Author:** ![TinaVesper](https://sea2.discourse-cdn.com/hellohellohello/user_avatar/discuss.huggingface.co/tinavesper/32/50991_2.png) [@TinaVesper](https://discuss.huggingface.co/u/TinaVesper)\
**Post date:** [July 13, 2025, 5:00am UTC](https://discuss.huggingface.co/t/hf-agents-course-404-client-error-not-found-for-url/162747/7 "2025-07-13T05:00:04Z")

</div>

Yes, I think you’re right and the problem is in the framework or so. Just don’t understand why they put this example in the course.  
Actually it must be available for deploy with HF Inference, because there is a code for deploying:

```auto
import os
from huggingface_hub import InferenceClient

client = InferenceClient(
    provider="auto",
    api_key=os.environ["HF_TOKEN"],
)

completion = client.chat.completions.create(
    model="Qwen/Qwen2.5-Coder-32B-Instruct",
    messages=[
        {
            "role": "user",
            "content": "What is the capital of France?"
        }
    ],
)

print(completion.choices[0].message)

```

But maybe this is the only way to deploy it, and HuggingFaceInferenceAPI is restricted now (despite this code is in the course).

---

<div class="post-metadata">

**Author:** ![John6666](https://sea2.discourse-cdn.com/hellohellohello/user_avatar/discuss.huggingface.co/john6666/32/27664_2.png) [@John6666](https://discuss.huggingface.co/u/John6666)\
**Post date:** [July 13, 2025, 5:06am UTC](https://discuss.huggingface.co/t/hf-agents-course-404-client-error-not-found-for-url/162747/8 "2025-07-13T05:06:13Z")

</div>

> Just don’t understand why they put this example in the course.

Yeah. When the course was created, that method was available…  
If it’s just a matter of library versions or so, we can just stick with the old ones, but for the “Agents” course, we need as many examples as possible of using “external APIs,” whether provided by HF or a third party…

But AI services change a lot in just a few months. It’s difficult to keep them up to date.

> **[huggingface/agents-course](https://github.com/huggingface/agents-course/issues)**
>
> This repository contains the Hugging Face Agents Course. - huggingface/agents-course

---

<div class="post-metadata">

**Author:** ![TinaVesper](https://sea2.discourse-cdn.com/hellohellohello/user_avatar/discuss.huggingface.co/tinavesper/32/50991_2.png) [@TinaVesper](https://discuss.huggingface.co/u/TinaVesper)\
**Post date:** [July 13, 2025, 5:36am UTC](https://discuss.huggingface.co/t/hf-agents-course-404-client-error-not-found-for-url/162747/9 "2025-07-13T05:36:01Z")

</div>

Agree. But it can be easily resolved at least with linked discussions about problems&solutions on this forum for instance. Just one button on the page “Got stuck, but found a solution? Tell us more” or so. I saw the same on the other platform. Or just a little checklist, like..there are may appear some problems. Check you have Pro status to use HF Inference API, check deploy button etc etc

Without claims to authors, always there are ways to make a course better

Thanks for you help!

---

<div class="post-metadata">

**Author:** ![dzungever](https://avatars.discourse-cdn.com/v4/letter/d/46a35a/32.png) [@dzungever](https://discuss.huggingface.co/u/dzungever)\
**Post date:** [July 24, 2025, 5:36am UTC](https://discuss.huggingface.co/t/hf-agents-course-404-client-error-not-found-for-url/162747/10 "2025-07-24T05:36:18Z")

</div>

I can get HuggingFaceInferenceAPI to work by adding the provider as below.

llm = HuggingFaceInferenceAPI(  
model\_name=“Qwen/Qwen2.5-Coder-32B-Instruct”,  
temperature=0.7,  
max\_tokens=100,  
token=hf\_token,  
provider=“together”,  
)

---

<div class="post-metadata">

**Author:** ![John6666](https://sea2.discourse-cdn.com/hellohellohello/user_avatar/discuss.huggingface.co/john6666/32/27664_2.png) [@John6666](https://discuss.huggingface.co/u/John6666)\
**Post date:** [July 24, 2025, 5:45am UTC](https://discuss.huggingface.co/t/hf-agents-course-404-client-error-not-found-for-url/162747/11 "2025-07-24T05:45:29Z")

</div>

Hmm, that’s strange… I think [it’s been deployed](https://huggingface.co/models?inference_provider=together&sort=trending&search=qwen+coder)…  
Have you tried updating LangChain and `huggingface_hub`?

Edit:  
Oh. I misunderstood. Great!  
Maybe `provider="auto",` also work.

---

<div class="post-metadata">

**Author:** ![TinaVesper](https://sea2.discourse-cdn.com/hellohellohello/user_avatar/discuss.huggingface.co/tinavesper/32/50991_2.png) [@TinaVesper](https://discuss.huggingface.co/u/TinaVesper)\
**Post date:** [July 24, 2025, 6:18am UTC](https://discuss.huggingface.co/t/hf-agents-course-404-client-error-not-found-for-url/162747/12 "2025-07-24T06:18:01Z")

</div>

Yes, it works this way, thanks a lot!

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/hellohellohello/original/2X/d/de4155eb4aa4108ecb32a1389d7cc37ae69f88b7.png) [@system](https://discuss.huggingface.co/u/system)\
**Post date:** [July 24, 2025, 6:18pm UTC](https://discuss.huggingface.co/t/hf-agents-course-404-client-error-not-found-for-url/162747/13 "2025-07-24T18:18:59Z")

</div>

This topic was automatically closed 12 hours after the last reply. New replies are no longer allowed.
