Configure Models in Agent Script
By default, Agentforce uses the model selected in Setup for all agents in your org. Override your org's default model for a specific agent and for subagents within an agent.
To specify a model, use model_config. For example:
Specify any supported model. To test your model selections, use different models in different versions of your agent.
Thoroughly test your agent with your chosen model or models before deploying. Some supported models may not be suitable for your agent or agent's tools.
Use model_config to override the org-level default model for the agent.
Use model_config in a subagent to override the org-level or agent-level model for the subagent.
Some agent templates, such as Agentforce Service agent, use the Salesforce-owned EinsteinHyperClassifier model for subagent classification in the agent router. Keep that model or specify a different model in your agent router.
You can specify multiple models in the same agent. A subagent-specific model takes precedence over an agent-specific model.
Suppose that your org, agent, and subagent have these models specified:
- You've selected the Salesforce default model for your org
- The MyTestAgent agent specifies Claude Haiku 4.5
- The HandleReservation subagent specifies Gemini 3.1 Pro
In this example, Agentforce uses Gemini 3.1 Pro for the HandleReservation subagent. For all other subagents in the MyTestAgent, Agentforce uses Claude Haiku 4.5. For other agents in the same org, Agentforce uses the Salesforce default model.
The EinsteinHyperClassifier model, developed by Salesforce, is often used for subagent classification in the agent_router subagent. The advantages of using EinsteinHyperClassifier for subagent classification are:
- Significantly faster subagent classification compared to other LLMs.
- Increased classification accuracy, particularly for specialized classification constraints and negative instructions.
Limitations of using the EinsteinHyperClassifier model:
- Can't use
before_reasoningorafter_reasoning. - Can only use the tool
@utils.transition, but no other tools.