Chapter 2 questions

Getting error for

from smolagents import CodeAgent, DuckDuckGoSearchTool, HfApiModel

agent = CodeAgent(tools=[DuckDuckGoSearchTool()], model=HfApiModel())

agent.run(“Search for the best music recommendations for a party at the Wayne’s mansion.”)

Error is:-
Error in generating model output:
402 Client Error: Payment Required for url:
https://router.huggingface.co/hf-inference/models/Qwen/Qwen2.5-Coder-32B-Instruct/v1/chat/completions (Request ID:
Root=1-682cabad-0506da667e1aeeb20c05e52a;833ae9c5-58d4-4761-b82f-dd65cc657537)

You have exceeded your monthly included credits for Inference Providers. Subscribe to PRO to get 20x more monthly
included credits.

1 Like