{"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/77b7c6c40c0c5aa5fbcb1d6a1825ac39ca8829b8/litellm/llms/bedrock/passthrough/transformation.py#L182-L218","documentation":"When transforming a streamed passthrough response from an 'invoke' endpoint, AmazonInvokeConfig.get_bedrock_invoke_provider(model) derives the provider from the model id prefix (e.g. 'amazon.', 'anthropic.', 'meta.', 'cohere.', 'mistral.', 'ai21.'). If it returns None there is no event-stream decoder for the model, so LiteLLM raises ValueError. The message interpolates invoke_provider, which is always None here, so the useful part is the model id.","triggerScenarios":"Streaming a Bedrock invoke passthrough request whose model id lacks a recognized provider prefix: custom names like 'my-model', provisioned-throughput aliases, typos, or a provider not registered in get_bedrock_invoke_provider's list.","commonSituations":"Custom or fine-tuned model ids without the standard '<vendor>.' prefix, copy-paste of inference profile or ARN fragments instead of the model id, older litellm lacking newer providers.","solutions":["Use the canonical Bedrock model id with its provider prefix, e.g. 'amazon.nova-lite-v1:0' or 'anthropic.claude-3-5-sonnet-...'","Upgrade litellm so newly added Bedrock providers are recognized in get_bedrock_invoke_provider","Inspect get_bedrock_invoke_provider's known prefix list to confirm your provider is supported before streaming via invoke passthrough"],"exampleFix":"// before\n# custom alias without provider prefix\nlitellm.router.completion(model=\"bedrock/my-custom-alias\", ...)\n\n// after\n# canonical id with provider prefix\nlitellm.router.completion(model=\"bedrock/amazon.nova-lite-v1:0\", ...)","handlingStrategy":"validation","validationCode":"KNOWN_INVOKE_PREFIXES = (\"amazon.\", \"anthropic.\", \"meta.\", \"cohere.\", \"mistral.\", \"ai21.\", \"deepseek.\", \"writer.\")\n\ndef validate_bedrock_model_id(model: str) -> None:\n    if not model.startswith(KNOWN_INVOKE_PREFIXES):\n        raise ValueError(\n            f\"model '{model}' lacks a known Bedrock provider prefix; \"\n            \"use the canonical id like 'amazon.nova-lite-v1:0'\"\n        )","typeGuard":"def is_known_bedrock_invoke_model(model: str) -> bool:\n    \"\"\"True when the model id starts with a provider prefix get_bedrock_invoke_provider recognizes.\"\"\"\n    return model.startswith((\"amazon.\", \"anthropic.\", \"meta.\", \"cohere.\", \"mistral.\", \"ai21.\"))","tryCatchPattern":"try:\n    stream = litellm.completion(model=f\"bedrock/{model_id}\", messages=msgs, stream=True)\nexcept ValueError as e:\n    if \"Invalid invoke provider\" in str(e):\n        raise ConfigurationError(f\"unrecognized Bedrock model id: {model_id}\") from e\n    raise","preventionTips":["Store canonical Bedrock model ids (with vendor prefix) in configuration, never hand-typed aliases","Validate model ids against a known-prefix list at config load time","Cover passthrough streaming paths in integration tests with every model id you ship"],"tags":["bedrock","passthrough","streaming","model-id"],"backgroundTag":"model-not-supported","analyzedSha":"77b7c6c40c0c5aa5fbcb1d6a1825ac39ca8829b8","analyzedAt":"2026-08-18T11:44:31.656Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}