BerriAI/litellm · error · ValueError

No provider config found for model: {model}

Error message

No provider config found for model: {model}

What it means

In the Bedrock passthrough/response transformer, the model is resolved to an 'invoke/<model>' or 'converse/<model>' chat config key and looked up via ProviderConfigManager.get_provider_chat_config. If no registered provider config matches the provider/model combination, a ValueError is raised stating no provider config was found for the model.

Source

Thrown at litellm/llms/bedrock/passthrough/transformation.py:140

    ) -> Optional["CostResponseTypes"]:
        from litellm import encoding
        from litellm.types.utils import LlmProviders, ModelResponse
        from litellm.utils import ProviderConfigManager

        if "invoke" in endpoint:
            chat_config_model = "invoke/" + model
        elif "converse" in endpoint:
            chat_config_model = "converse/" + model
        else:
            return None

        provider_chat_config: Final = ProviderConfigManager.get_provider_chat_config(
            provider=LlmProviders(custom_llm_provider),
            model=chat_config_model,
        )

        if provider_chat_config is None:
            raise ValueError(f"No provider config found for model: {model}")

        litellm_model_response: Final[ModelResponse] = provider_chat_config.transform_response(
            model=model,
            messages=[{"role": "user", "content": "no-message-pass-through-endpoint"}],
            raw_response=httpx_response,
            model_response=ModelResponse(),
            logging_obj=logging_obj,
            optional_params={},
            litellm_params={},
            api_key="",
            request_data=request_data,
            encoding=encoding,
        )

        return litellm_model_response

    def _convert_raw_bytes_to_str_lines(self, raw_bytes: list[bytes]) -> list[str]:
        from botocore.eventstream import EventStreamBuffer

View on GitHub (pinned to 6c2dcb801b)

Solutions

  1. Verify the model ID's provider prefix is spelled correctly and is a supported Bedrock provider.
  2. Upgrade litellm — provider configs for new Bedrock models are added frequently.
  3. For chat models, prefer the standard bedrock/ path (litellm.completion(model='bedrock/<model>')) which handles providers more generically.
  4. If the model is not chat-oriented, use the dedicated route (embeddings/rerank/image) instead of invoke/converse passthrough.

Example fix

# before
response = litellm.completion(model='bedrock/converse/antrhopic.claude-3-sonnet-20240229-v1:0', messages=msgs)

# after
response = litellm.completion(model='bedrock/anthropic.claude-3-sonnet-20240229-v1:0', messages=msgs)
Defensive patterns

Strategy: type-guard

Validate before calling

KNOWN_BEDROCK_PREFIXES = ("amazon.", "anthropic.", "ai21.", "cohere.", "meta.", "mistral.", "stability.", "deepseek.", "writer.")

def model_has_known_provider_prefix(model: str) -> bool:
    return model.startswith(KNOWN_BEDROCK_PREFIXES) or model.startswith("apply/")

Type guard

def is_known_bedrock_model(model: str) -> bool:
    base = model.split("/")[-1]
    return any(base.startswith(p.rstrip('.')) for p in KNOWN_BEDROCK_PREFIXES)

Try / catch

try:
    litellm.completion(model=f"bedrock/converse/{model}", messages=msgs)
except ValueError as e:
    if "No provider config found" in str(e):
        raise UnsupportedModelError(f"{model}: use standard bedrock/ route or upgrade litellm") from e
    raise

Prevention

When it happens

Trigger: Using bedrock passthrough endpoints (/bedrock/invoke or /bedrock/converse) with a model whose provider prefix (e.g. meta., anthropic., amazon., ai21., mistral., cohere.) litellm cannot map to a chat config — for example a brand-new or misspelled provider prefix, or a vendor whose invoke transformation is not registered.

Common situations: New Bedrock provider launched but the installed litellm predates its invoke transformation; model string typos ('antrhopic.claude-...'); using passthrough for an unsupported modality (embedding/image models routed through the chat config path).

Related errors


AI-assisted analysis of BerriAI/litellm@6c2dcb801b (2026-08-15). Data as JSON: /api/errors/e2cb58af82269a91. Report an issue: GitHub.