{"record":{"id":"556747d3e412725a","repo":"BerriAI/litellm","slug":"bedrock-invoke-httpx-unknown-provider-provider","errorCode":null,"errorMessage":"Bedrock Invoke HTTPX: Unknown provider={provider}, model={model}. Try calling via converse route - `bedrock/converse/<model>`.","messagePattern":"Bedrock Invoke HTTPX: Unknown provider=(.+?), model=(.+?)\\. Try calling via converse route - `bedrock/converse/<model>`\\.","errorType":"http","errorClass":"BedrockError","httpStatus":404,"severity":"error","filePath":"litellm/llms/bedrock/chat/invoke_transformations/base_invoke_transformation.py","lineNumber":269,"sourceCode":"        elif provider == \"twelvelabs\":\n            return litellm.AmazonTwelveLabsPegasusConfig().transform_request(\n                model=model,\n                messages=messages,\n                optional_params=optional_params,\n                litellm_params=litellm_params,\n                headers=headers,\n            )\n        elif provider == \"openai\":\n            # OpenAI imported models use OpenAI Chat Completions format\n            return litellm.AmazonBedrockOpenAIConfig().transform_request(\n                model=model,\n                messages=messages,\n                optional_params=optional_params,\n                litellm_params=litellm_params,\n                headers=headers,\n            )\n        else:\n            raise BedrockError(\n                status_code=404,\n                message=f\"Bedrock Invoke HTTPX: Unknown provider={provider}, model={model}. Try calling via converse route - `bedrock/converse/<model>`.\",\n            )\n\n        return request_data\n\n    def transform_response(\n        self,\n        model: str,\n        raw_response: httpx.Response,\n        model_response: ModelResponse,\n        logging_obj: LiteLLMLoggingObj,\n        request_data: dict,\n        messages: list[AllMessageValues],\n        optional_params: dict,\n        litellm_params: dict,\n        encoding: Any,\n        api_key: str | None = None,","sourceCodeStart":251,"sourceCodeEnd":287,"githubUrl":"https://github.com/BerriAI/litellm/blob/6c2dcb801bf2b75c18f1bb24140e7cf57465cc4d/litellm/llms/bedrock/chat/invoke_transformations/base_invoke_transformation.py#L251-L287","documentation":"Raised by BaseAmazonInvokeConfig.transform_request when the provider segment parsed from the model string (bedrock/<provider>.<model>) does not match any known Invoke-API transformation (anthropic, cohere, ai21, meta/llama, mistral, amazon, openai, deepseek_r1, twelvelabs). It is a BedrockError 404 with a message that suggests using the Converse route instead.","triggerScenarios":"Using a model string like bedrock/myvendor.custom-model-v1 or bedrock/<unrecognized>.<model> through the legacy invoke path, including new providers (e.g. newly launched Bedrock models) not yet mapped in the installed litellm version.","commonSituations":"AWS launches a new provider/model before litellm adds the invoke transformer, typo in the model string provider segment, or attempting bedrock/openai.* without the openai mapping in older versions.","solutions":["Switch the model string to bedrock/converse/<model> as the message suggests - Converse handles all providers uniformly.","Upgrade litellm to a version that maps the new provider.","Fix typos in the provider segment of the model ID (e.g. bedrock/meta.llama3-..., bedrock/cohere.command-...).","For imported OpenAI models on Bedrock use the bedrock/openai.* naming supported by recent litellm."],"exampleFix":"# before\nresp = litellm.completion(model=\"bedrock/<newprovider>.<new-model>\", messages=msgs)\n\n# after\nresp = litellm.completion(model=\"bedrock/converse/<newprovider>.<new-model>\", messages=msgs)","handlingStrategy":"validation","validationCode":"KNOWN_PROVIDERS = {\"anthropic\", \"cohere\", \"ai21\", \"meta\", \"llama\", \"mistral\", \"amazon\", \"openai\", \"deepseek_r1\", \"twelvelabs\"}\ndef normalize_bedrock_model(model: str) -> str:\n    provider = model.split(\"/\", 1)[-1].split(\".\", 1)[0]\n    if provider not in KNOWN_PROVIDERS:\n        return f\"bedrock/converse/{model.split('/', 1)[1]}\"  # unknown to invoke -> converse\n    return model","typeGuard":"def is_invoke_supported(model: str) -> bool:\n    try:\n        provider = model.split(\"/\", 1)[1].split(\".\", 1)[0]\n    except IndexError:\n        return False\n    return provider in {\"anthropic\", \"cohere\", \"ai21\", \"meta\", \"llama\", \"mistral\", \"amazon\", \"openai\", \"deepseek_r1\", \"twelvelabs\"}","tryCatchPattern":"from litellm.exceptions import BedrockError\ntry:\n    resp = litellm.completion(model=model, messages=msgs)\nexcept BedrockError as e:\n    if e.status_code == 404 and \"Unknown provider\" in str(e):\n        resp = litellm.completion(model=model.replace(\"bedrock/\", \"bedrock/converse/\", 1), messages=msgs)\n    else:\n        raise","preventionTips":["Default to the bedrock/converse/ prefix for all new models.","Maintain a validated model catalog in your app and reject unknown model strings early."],"tags":["aws","bedrock","provider-mapping","converse","model-id"],"backgroundTag":null,"analyzedSha":"6c2dcb801bf2b75c18f1bb24140e7cf57465cc4d","analyzedAt":"2026-08-15T07:12:03.035Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}