BerriAI/litellm · error · ValueError

Unsupported provider: {_custom_llm_provider}

Error message

Unsupported provider: {_custom_llm_provider}

What it means

Final guard in the rerank dispatcher: the provider fell through to the generic handler but its config resolved to the default CohereRerankConfig, proving no provider-specific rerank transformation exists — the provider name is unsupported for rerank.

Source

Thrown at litellm/rerank_api/main.py:516

                litellm_params=rerank_litellm_params,
            )
        else:
            # Generic handler for all providers that use base_llm_http_handler
            # Provider-specific logic (API key validation, URL generation, etc.)
            # is handled in the respective transformation configs

            # Check if the provider is actually supported
            # If rerank_provider_config is a default CohereRerankConfig but the provider is not Cohere or litellm_proxy,
            # it means the provider is not supported
            if (
                (
                    isinstance(rerank_provider_config, litellm.CohereRerankConfig)
                    or isinstance(rerank_provider_config, litellm.CohereRerankV2Config)
                )
                and _custom_llm_provider != "cohere"
                and _custom_llm_provider != "litellm_proxy"
            ):
                raise ValueError(f"Unsupported provider: {_custom_llm_provider}")

            response = base_llm_http_handler.rerank(
                model=model,
                custom_llm_provider=_custom_llm_provider,
                provider_config=rerank_provider_config,
                optional_rerank_params=optional_rerank_params,
                logging_obj=litellm_logging_obj,
                timeout=optional_params.timeout,
                api_key=dynamic_api_key or optional_params.api_key,
                api_base=dynamic_api_base or optional_params.api_base,
                _is_async=_is_async,
                headers=headers or litellm.headers or {},
                client=client,
                model_response=model_response,
                litellm_params=rerank_litellm_params,
            )

        # Placeholder return

View on GitHub (pinned to 77b7c6c40c)

Solutions

  1. Use a supported rerank provider (e.g., cohere, jina_ai, together_ai, infinity, hosted_vllm, deepinfra).
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at litellm/rerank_api/main.py:516 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of BerriAI/litellm@77b7c6c40c (2026-08-18). Data as JSON: /api/errors/f95ebdcf210c292e. Report an issue: GitHub.