TauricResearch/TradingAgents · error · ValueError
Unsupported LLM provider: {provider}
Error message
Unsupported LLM provider: {provider} What it means
ValueError raised by create_llm_client (tradingagents/llm_clients/factory.py) when the configured provider string matches none of the known providers (openai, azure/openai-azure, bedrock, deepseek/other OpenAI-compatible names) and fails the is_openai_compatible check. It means the provider name in your LLM config is unrecognized.
Source
Thrown at tradingagents/llm_clients/factory.py:54
return AnthropicClient(model, base_url, **kwargs)
if provider_lower == "google":
from .google_client import GoogleClient
return GoogleClient(model, base_url, **kwargs)
if provider_lower == "azure":
from .azure_client import AzureOpenAIClient
return AzureOpenAIClient(model, base_url, **kwargs)
if provider_lower == "bedrock":
from .bedrock_client import BedrockClient
return BedrockClient(model, base_url, **kwargs)
from .openai_client import OpenAIClient, is_openai_compatible
if is_openai_compatible(provider_lower):
return OpenAIClient(model, base_url, provider=provider_lower, **kwargs)
raise ValueError(f"Unsupported LLM provider: {provider}")
View on GitHub (pinned to a33fd4c0f1)
Solutions
- Use a supported provider string: 'openai', 'azure', 'bedrock', or an OpenAI-compatible name recognized by is_openai_compatible (e.g. 'deepseek', 'openai-compatible' base URLs).
- If the vendor is OpenAI-API-compatible, point provider at the openai path and set base_url to the vendor endpoint.
- Upgrade the package — new providers are added over time — and check factory.py for the current accepted list.
Example fix
# before config['llm_provider_quick'] = 'gcp' # after config['llm_provider_quick'] = 'openai' config['quick_think_llm_base_url'] = 'https://your-openai-compatible-endpoint/v1'
Defensive patterns
Strategy: validation
Validate before calling
SUPPORTED_PROVIDERS = {'openai', 'azure', 'bedrock'} | {
# plus whatever is_openai_compatible accepts; check factory.py for your version
}
def is_supported_provider(provider: str) -> bool:
p = provider.strip().lower()
return p in SUPPORTED_PROVIDERS or p.replace('-', '').replace('_', '') in SUPPORTED_PROVIDERS Try / catch
from tradingagents.llm_clients.factory import create_llm_client
try:
client = create_llm_client(model, base_url, provider=provider)
except ValueError:
client = create_llm_client(model, vendor_base_url, provider='openai') # OpenAI-compatible fallback Prevention
- Validate provider strings against factory.py's accepted list at config load time.
- For OpenAI-compatible vendors, use provider='openai' plus base_url instead of inventing provider names.
- Re-check supported providers after each package upgrade.
When it happens
Trigger: Setting the quick-think/deep-think LLM provider in DEFAULT_CONFIG (or TradingAgentsGraph config) to a string like 'myprovider', 'google', or 'Azure' variants that don't match factory branches. The lowercased value falls through every branch and the final raise fires.
Common situations: Typos in provider names ('open_ai', 'awzure'); assuming a provider is supported because langchain supports it; missing integration for a vendor added after your package version.
Related errors
- expected a boolean ({'/'.join(_BOOL_TRUE + _BOOL_FALSE)}), g
- Invalid value for {env_var}: {exc}
- unknown analyst key: {analyst_key}
- at least one analyst must be selected
- llm_max_retries must be an integer, not a boolean: {value!r}
AI-assisted analysis of TauricResearch/TradingAgents@a33fd4c0f1 (2026-08-14).
Data as JSON: /api/errors/d087f8b7b658ea4d.
Report an issue: GitHub.