AWorld icon indicating copy to clipboard operation
AWorld copied to clipboard

Model-name provider detection only knows retired Claude ids, so claude-sonnet-4-6 is routed to OpenAI

Open emreyoleridev opened this issue 6 days ago • 0 comments

LLMModel._identify_provider() falls back to matching model_name against MODEL_NAMES in aworld/models/llm.py when neither llm_provider nor a known base_url is set. The Anthropic entry only lists three model ids:

"anthropic": [
    "claude-3-5-sonnet-20241022",
    "claude-3-5-sonnet-20240620",
    "claude-3-opus-20240229",
],

All three are retired (Claude 3.5 Sonnet on 2025-10-28, Claude 3 Opus on 2026-01-05, see Anthropic's model deprecations). Any current id, such as claude-sonnet-4-6 or claude-opus-4-7, matches nothing, so the provider silently falls back to "openai" and the request goes to the OpenAI client with a Claude model name.

To reproduce (read from the source, no API call needed):

from aworld.models.llm import LLMModel
m = object.__new__(LLMModel)
m._identify_provider(model_name="claude-3-5-sonnet-20241022")  # "anthropic"
m._identify_provider(model_name="claude-sonnet-4-6")           # "openai"

Since the list is already matched with startswith, using the "claude-" prefix would cover every current and future Claude id. Setting llm_provider="anthropic" explicitly is the workaround today.

emreyoleridev avatar Nov 30 '26 05:11 emreyoleridev