Defaulting to the same model - Smolagents

I built an agent and wanted to benefit from the development of newer models. But whichever provider or model provider I use (as selected on this matrix ( Hugging Face Inference Providers · Supported Models )),

the script below always defaults to Qwen/Qwen2.5-Coder-32B-Instruct. Why?

How can I change it?

llm_engine = InferenceClientModel(
                api_key=HF_TOKEN,
                model="Qwen/Qwen3-235B-A22B-Instruct-2507" , #"openai/gpt-oss-120b" , #"moonshotai/Kimi-K2-Instruct",
                timeout=3000,
                provider="together",
                temperature=0.1
            )
        
 # Initialize agent
 agent = CodeAgent(
            model=llm_engine,
            tools=[],
            add_base_tools=False,
            name="data_agent",
            description="Runs data analysis for you.",
            max_steps=1,
        )
1 Like

This should fix it. I think the rest is correct.

llm_engine = InferenceClientModel(
                api_key=HF_TOKEN,
                #model="Qwen/Qwen3-235B-A22B-Instruct-2507" , #"openai/gpt-oss-120b" , #"moonshotai/Kimi-K2-Instruct",
                model_id="Qwen/Qwen3-235B-A22B-Instruct-2507" , #"openai/gpt-oss-120b" , #"moonshotai/Kimi-K2-Instruct",
                timeout=3000,
                provider="together",
                temperature=0.1
            )
2 Likes

Thank you! That solved it.

1 Like