Skip to content

BUG: Default ToolCallingAgent InferenceClient examples failing #1808

@suryabdev

Description

@suryabdev

Problem
Default ToolCallingAgent InferenceClient examples failing
TLDR: The nscale provider does not support tool calling

Steps to reproduce
The following code fails with

from smolagents import ToolCallingAgent, InferenceClientModel, WebSearchTool

model = InferenceClientModel()

agent = ToolCallingAgent(tools=[WebSearchTool()], model=model)
agent.run("Could you get me the title of the page at url 'https://huggingface.co/blog'?")

with

Bad request:
{'code': '422', 'error_type': 'UNSUPPORTED_OPENAI_PARAMS', 'message': 'The following parameters are not supported for this model: tools, tool_choice', 'param': 'tools, tool_choice'}

Actual behavior and error logs
The same code was working fine yesterday, so then I thought it might be an issue with the provider. On a deeper look

# Fails
model = InferenceClientModel(provider="nscale")
# But the following works
model = InferenceClientModel(provider="together")

I took a look at the Inference documentation. I think HF Inference API automatically picks the cheapest one for usage, nscale would be selected now (Which does not support Tool calling). But together might have been selected till yesterday

Image

Expected behavior
The default parameters for InferenceClient should work

Bottom line, The default parameters will break ToolCallingAgent. Should we change the InferenceClient default to a similar model like Qwen/Qwen3-Coder-30B-A3B-Instruct?

model_id: str = "Qwen/Qwen2.5-Coder-32B-Instruct",

All Qwen3-Coder-30B-A3B-Instruct providers support ToolCalling, and the Qwen3-Coder models are better for code generation and tool calling tasks. Price is similar too
Image

Environment:
Please complete the following information:

  • OS: Linux / WSL
  • Python version: 3.12.3
  • Package version: 1.22

Full error traceback
Image


Checklist

  • I have searched the existing issues and have not found a similar bug report.
  • I have provided a minimal, reproducible example.
  • I have provided the full traceback of the error.
  • I have provided my environment details.
  • I am willing to work on this issue and submit a pull request. (optional)

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions