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 after provider resolution when llm_params['model_provider'] is not in the hardcoded known_providers set (openai, azure_openai, google_genai, ...). This is a strict allow-list check: even if the model name resolved, an unrecognized provider string aborts LLM creation.

Source

Thrown at scrapegraphai/graphs/abstract_graph.py:205

                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."""
            )

        if llm_params.get("model_tokens", None) is None:
            try:
                self.model_token = models_tokens[llm_params["model_provider"]][
                    llm_params["model"]
                ]
            except KeyError:
                logger.warning(
                    "Max input tokens for model %s/%s not found, "
                    "please specify the model_tokens parameter in the llm section of the graph configuration. "
                    "Using default token size: 8192",
                    llm_params["model_provider"],
                    llm_params["model"],
                )
                self.model_token = 8192

View on GitHub (pinned to 532dfffbf6)

Solutions

  1. Verify the exact provider strings in the known_providers set in scrapegraphai/graphs/abstract_graph.py for your version and use one of them.
  2. Upgrade scrapegraphai to a release that supports your provider.
  3. Pass a pre-built 'model_instance' + 'model_tokens' to skip provider dispatch entirely.

Example fix

# before
config = {'llm': {'model': 'mixtral', 'model_provider': 'together'}}

# after
config = {'llm': {'model': 'mixtral-8x7B-instruct-v0.1', 'model_provider': 'togetherai'}}
Defensive patterns

Strategy: validation

Validate before calling

KNOWN = {'openai', 'azure_openai', 'google_genai', 'groq', 'anthropic', 'oneai', 'mistralai', 'hugging_face', 'deepseek', 'ernie', 'bedrock', 'nvidia', 'togetherai', 'xai'}
prov = config['llm'].get('model_provider')
if prov and prov not in KNOWN:
    raise SystemExit(f"unsupported model_provider '{prov}'; see abstract_graph.py known_providers for your version")

Type guard

def is_supported_provider(cfg: dict) -> bool:
    prov = cfg.get('llm', {}).get('model_provider')
    return prov is None or prov in KNOWN_PROVIDERS

Try / catch

try:
    graph = SmartScraperGraph(prompt=p, config=config)
except ValueError as e:
    if 'is not supported' in str(e):
        raise SystemExit('Switch to model_instance + model_tokens, or a known provider string') from e
    raise

Prevention

When it happens

Trigger: Passing model_provider values like 'together', 'groq-de', 'open_router', or a provider added in a newer version than the one installed; or the inference in the preceding block picking a provider key not present in known_providers.

Common situations: Version drift (provider added upstream but not in the installed release); misspelled provider strings; using an integration that requires a model_instance instead of a named provider.

Related errors


AI-assisted analysis of ScrapeGraphAI/Scrapegraph-ai@532dfffbf6 (2026-08-28). Data as JSON: /api/errors/5a83a1de329fb791. Report an issue: GitHub.