ScrapeGraphAI/Scrapegraph-ai · error · ValueError
Provider {llm_params["model_provider"]} is not supported.
Error message
Provider {llm_params["model_provider"]} is not supported.
If possible, try to use a model instance instead. What it means
Raised when _create_llm cannot determine the provider: the 'model' string in llm_params does not appear in any provider's entry of models_tokens, so the list of possible providers is empty and the fallback lookup fails. The message prints the (unset or wrong) model_provider value, which is confusing but means 'unknown model name'.
Source
Thrown at scrapegraphai/graphs/abstract_graph.py:191
"fireworks",
"clod",
"togetherai",
"xai",
"minimax",
}
if "/" in llm_params["model"]:
split_model_provider = llm_params["model"].split("/", 1)
llm_params["model_provider"] = split_model_provider[0]
llm_params["model"] = split_model_provider[1]
else:
possible_providers = [
provider
for provider, models_d in models_tokens.items()
if llm_params["model"] in models_d
]
if len(possible_providers) <= 0:
raise ValueError(
f"""Provider {llm_params["model_provider"]} is not supported.
If possible, try to use a model instance instead."""
)
llm_params["model_provider"] = possible_providers[0]
logger.info(
"Found providers %s for model %s, using %s. "
"If it was not intended please specify the model provider in the graph configuration",
possible_providers,
llm_params["model"],
llm_params["model_provider"],
)
if llm_params["model_provider"] not in known_providers:
raise ValueError(
f"""Provider {llm_params["model_provider"]} is not supported.
If possible, try to use a model instance instead."""
)
View on GitHub (pinned to 532dfffbf6)
Solutions
- Check the exact model string keys in scrapegraphai/models/models_tokens.py and use one of them verbatim.
- Upgrade scrapegraphai (uv sync / pip install -U scrapegraphai) so newly added models are recognized.
- For custom models, pass a pre-built 'model_instance' plus 'model_tokens' to bypass name-based lookup.
- Set 'model_provider' explicitly to a supported provider if the model name genuinely exists under it.
Example fix
# before
config = {'llm': {'model': 'gpt4-o', 'api_key': key}}
# after
config = {'llm': {'model': 'gpt-4o', 'model_provider': 'openai', 'api_key': key}} Defensive patterns
Strategy: validation
Validate before calling
from scrapegraphai.models.models_tokens import models_tokens
model = config['llm']['model']
known = {m for prov in models_tokens.values() for m in prov}
assert model in known, f"model '{model}' not in models_tokens; fix the name or pass model_instance" Type guard
def is_known_model(model: str) -> bool:
from scrapegraphai.models.models_tokens import models_tokens
return any(model in prov for prov in models_tokens.values()) Try / catch
try:
graph = SmartScraperGraph(prompt=p, config=config)
except ValueError as e:
if 'is not supported' in str(e):
config['llm']['model_instance'] = build_client(config['llm'])
config['llm']['model_tokens'] = 32000
graph = SmartScraperGraph(prompt=p, config=config)
else:
raise Prevention
- Copy model names verbatim from models_tokens.py.
- Pin and periodically upgrade scrapegraphai so new model names are recognized.
- For custom endpoints, standardize on model_instance + model_tokens.
When it happens
Trigger: Setting config llm {'model': 'some-unknown-or-typo'd-model'} without a valid model_provider, or with model_provider omitted so the code tries to infer the provider from models_tokens and finds no match.
Common situations: Typos in model names ('gpt-4o-mini ' with whitespace, 'claude-3.5-sonnet' vs the exact key); brand-new models released after the installed scrapegraphai version; custom/self-hosted model names that are not in the built-in token tables.
Related errors
- model_tokens not specified
- Provider {llm_params["model_provider"]} is not supported.
- Error instancing model: {e}
- Model not supported
- The langchain_together module is not installed.
AI-assisted analysis of ScrapeGraphAI/Scrapegraph-ai@532dfffbf6 (2026-08-28).
Data as JSON: /api/errors/47d5b0c62d01949f.
Report an issue: GitHub.