-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Description
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
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?
smolagents/src/smolagents/models.py
Line 1401 in f042c0c
| 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

Environment:
Please complete the following information:
- OS: Linux / WSL
- Python version: 3.12.3
- Package version: 1.22
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)
