# Running my first agent : "Invalid username or password"

**URL:** </static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Frunning-my-first-agent-invalid-username-or-password%2F152896%3E%5C
**Category:** Course\
**Created:** [April 29, 2025, 5:10pm UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Frunning-my-first-agent-invalid-username-or-password%2F152896 "2025-04-29T17:10:02Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Philepote](https://sea2.discourse-cdn.com/hellohellohello/user_avatar/discuss.huggingface.co/philepote/32/46531_2.png) [@Philepote](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Fu%2FPhilepote)%5C
**Post date:** [April 29, 2025, 5:10pm UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Frunning-my-first-agent-invalid-username-or-password%2F152896%2F1 "2025-04-29T17:10:02Z")

</div>

Hi. I’m a total newbie trying to “create my first agent using smolagents” (unit 1 of the curse). I created my toll in the app.py file, and can’t try running it, because of this error. Since I’m connectd to HF and could run Llama before, I don’t know what I’m supposed to do. Thanks for any help !

Error in generating model output:  
401 Client Error: Unauthorized for url:  
[/static-proxy?url=https%3A%2F%2Frouter.huggingface.co%2Fhf-inference%2Fmodels%2FQwen%2FQwen2.5-Coder-32B-Instruc%5D(https%3A%2F%2Frouter.huggingface.co%2Fhf-inference%2Fmodels%2FQwen%2FQwen2.5-Coder-32B-Instruc)  
t/v1/chat/completions (Request ID:  
Root=1-680fe549-24961bec7aaaeab27c26e4e1;e83a37db-03d8-4209-aa1e-a71e4259acef)

Invalid username or password.  
[Step 1: Duration 0.07 seconds]  
Traceback (most recent call last):  
File “/usr/local/lib/python3.10/site-packages/gradio/queueing.py”, line 715, in process\_events  
response = await route\_utils.call\_process\_api(  
File “/usr/local/lib/python3.10/site-packages/gradio/route\_utils.py”, line 322, in call\_process\_api  
output = await app.get\_blocks().process\_api(  
File “/usr/local/lib/python3.10/site-packages/gradio/blocks.py”, line 2137, in process\_api  
result = await self.call\_function(  
File “/usr/local/lib/python3.10/site-packages/gradio/blocks.py”, line 1675, in call\_function  
prediction = await utils.async\_iteration(iterator)  
File “/usr/local/lib/python3.10/site-packages/gradio/utils.py”, line 735, in async\_iteration  
return await anext(iterator)  
File “/usr/local/lib/python3.10/site-packages/gradio/utils.py”, line 729, in **anext**  
return await anyio.to\_thread.run\_sync(  
File “/usr/local/lib/python3.10/site-packages/anyio/to\_thread.py”, line 56, in run\_sync  
return await get\_async\_backend().run\_sync\_in\_worker\_thread(  
File “/usr/local/lib/python3.10/site-packages/anyio/\_backends/\_asyncio.py”, line 2470, in run\_sync\_in\_worker\_thread  
return await future  
File “/usr/local/lib/python3.10/site-packages/anyio/\_backends/\_asyncio.py”, line 967, in run  
result = context.run(func, \*args)  
File “/usr/local/lib/python3.10/site-packages/gradio/utils.py”, line 712, in run\_sync\_iterator\_async  
return next(iterator)  
File “/usr/local/lib/python3.10/site-packages/gradio/utils.py”, line 873, in gen\_wrapper  
response = next(iterator)  
File “/home/user/app/Gradio\_UI.py”, line 197, in interact\_with\_agent  
for msg in stream\_to\_gradio(self.agent, task=prompt, reset\_agent\_memory=False):  
File “/home/user/app/Gradio\_UI.py”, line 145, in stream\_to\_gradio  
total\_input\_tokens += agent.model.last\_input\_token\_count  
TypeError: unsupported operand type(s) for +=: ‘int’ and ‘NoneType’

---

<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:** [April 30, 2025, 1:47am UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Frunning-my-first-agent-invalid-username-or-password%2F152896%2F2 "2025-04-30T01:47:33Z")

</div>

I think it’s safe to assume that the Inference API isn’t working properly at the moment, including Qwen 32B Coder…

> [@Agent wont respond](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fagent-wont-respond%2F142128)%3A
>
> The code provided in the course using the Qwen model build and runs fine, there are no log errors either. However when i attempt to chat with agent it never responds. The only advice given was to change the model…which I did but still no answer. Really want to proceed with the course but i cant till i can get this agent responding. Any help would be appreciated. Thank you

> [@Chapter 2 questions](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fchapter-2-questions%2F6799)%3A
>
> Use this topic for any question about [Chapter 2](https://huggingface.co/course/chapter2) of the course.

---

<div class="post-metadata">

**Author:** ![Philepote](https://sea2.discourse-cdn.com/hellohellohello/user_avatar/discuss.huggingface.co/philepote/32/46531_2.png) [@Philepote](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Fu%2FPhilepote)%5C
**Post date:** [May 2, 2025, 1:14pm UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Frunning-my-first-agent-invalid-username-or-password%2F152896%2F3 "2025-05-02T13:14:25Z")

</div>

Thanks.  
It’s still not working. As a newbie, I don’t know what I’m supposed to to. Wait ? Try another LLM ? Stop trying ?

---

<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:** [May 2, 2025, 7:18pm UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Frunning-my-first-agent-invalid-username-or-password%2F152896%2F4 "2025-05-02T19:18:23Z")

</div>

I think there is a possibility that it will improve over time, but it will likely take several weeks or more. In the HF Discord course-specific question channel, it seems that methods for using other services are being introduced.

Additionally, if you have a powerful GPU, there is an option to use a small LLM locally.

> [@Avoiding the usage of HfApiModel and using local model - \`smolagents\`](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Favoiding-the-usage-of-hfapimodel-and-using-local-model-smolagents%2F152711)%3A
>
> 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?
