{"record":{"id":"dd6a327c9d60cbba","repo":"BerriAI/litellm","slug":"invalid-invoke-provider-invoke-provider-for-mo","errorCode":null,"errorMessage":"Invalid invoke provider: {invoke_provider}, for model: {model}","messagePattern":"Invalid invoke provider: (.+?), for model: (.+?)","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"litellm/llms/bedrock/passthrough/transformation.py","lineNumber":200,"sourceCode":"        3. Return the model_response\n        \"\"\"\n\n        from litellm.litellm_core_utils.streaming_handler import (\n            convert_generic_chunk_to_model_response_stream,\n            generic_chunk_has_all_required_fields,\n        )\n        from litellm.llms.bedrock.chat import get_bedrock_event_stream_decoder\n        from litellm.llms.bedrock.chat.invoke_transformations.base_invoke_transformation import (\n            AmazonInvokeConfig,\n        )\n        from litellm.main import stream_chunk_builder\n        from litellm.types.utils import GenericStreamingChunk, ModelResponseStream\n\n        all_translated_chunks: Final = []\n        if \"invoke\" in endpoint:\n            invoke_provider: Final = AmazonInvokeConfig.get_bedrock_invoke_provider(model)\n            if invoke_provider is None:\n                raise ValueError(f\"Invalid invoke provider: {invoke_provider}, for model: {model}\")\n            obj = get_bedrock_event_stream_decoder(\n                invoke_provider=invoke_provider,\n                model=model,\n                sync_stream=True,\n                json_mode=False,\n            )\n        elif \"converse\" in endpoint:\n            obj = get_bedrock_event_stream_decoder(\n                invoke_provider=None,\n                model=model,\n                sync_stream=True,\n                json_mode=False,\n            )\n        else:\n            return None\n\n        for chunk in all_chunks:\n            message = json.loads(chunk)","sourceCodeStart":182,"sourceCodeEnd":218,"githubUrl":"https://github.com/BerriAI/litellm/blob/6c2dcb801bf2b75c18f1bb24140e7cf57465cc4d/litellm/llms/bedrock/passthrough/transformation.py#L182-L218","documentation":"On the streaming passthrough path for 'invoke' endpoints, AmazonInvokeConfig.get_bedrock_invoke_provider(model) is used to derive the provider from the model string. If it returns None (model string doesn't start with a known Bedrock provider prefix), litellm raises ValueError('Invalid invoke provider: None, for model: ...') because no event-stream decoder can be selected.","triggerScenarios":"Streaming from /bedrock/invoke/<model> where <model> lacks a recognized provider prefix — e.g. a bare custom model name, a provisioned-throughput ARN fragment, or a typo'd prefix like 'Anthropic.Claude...' (capitalized).","commonSituations":"Using provisioned custom names (e.g. 'my-custom-model') without provider prefix; copy-pasting model ARNs instead of the model name; case-sensitive prefix mismatches.","solutions":["Use the canonical model identifier with the correct lowercase provider prefix (e.g. 'anthropic.claude-3-haiku-20240307-v1:0').","For converse endpoints, use /bedrock/converse/<model> which resolves the provider differently (invoke_provider=None).","Check get_bedrock_invoke_provider's supported prefixes in your litellm version and match the model string to one.","Upgrade litellm if the provider is newly supported."],"exampleFix":"# before\nstream = litellm.completion(model='bedrock/invoke/MyClaude-Model', messages=msgs, stream=True)\n\n# after\nstream = litellm.completion(model='bedrock/invoke/anthropic.claude-3-haiku-20240307-v1:0', messages=msgs, stream=True)","handlingStrategy":"type-guard","validationCode":"import re\n\ndef is_invoke_streamable_model(model: str) -> bool:\n    # get_bedrock_invoke_provider matches known provider prefixes; mirror that check\n    return re.match(r\"^(amazon|anthropic|ai21|cohere|meta|mistral|stability|deepseek)\\.\", model) is not None","typeGuard":"def has_invoke_provider_prefix(model: str) -> bool:\n    return \".\" in model and model.split(\".\")[0].islower() and model.split(\".\")[0] in {\n        \"amazon\", \"anthropic\", \"ai21\", \"cohere\", \"meta\", \"mistral\", \"stability\"\n    }","tryCatchPattern":"try:\n    stream = litellm.completion(model=f\"bedrock/invoke/{model}\", messages=msgs, stream=True)\nexcept ValueError as e:\n    if \"Invalid invoke provider\" in str(e):\n        # fall back to converse route which does not need provider derivation\n        stream = litellm.completion(model=f\"bedrock/converse/{model}\", messages=msgs, stream=True)\n    else:\n        raise","preventionTips":["Use lowercase canonical provider-prefixed model IDs for invoke streaming.","Prefer converse over invoke for new integrations — it is provider-agnostic.","Unit-test model strings against the prefix list at config load time."],"tags":["bedrock","streaming","invoke","provider-config","model-resolution"],"backgroundTag":null,"analyzedSha":"6c2dcb801bf2b75c18f1bb24140e7cf57465cc4d","analyzedAt":"2026-08-15T07:12:03.035Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}