{"record":{"id":"1ab1070cff334686","repo":"BerriAI/litellm","slug":"model-keyword-not-found-and-unable-to-extract-mo","errorCode":null,"errorMessage":"'model' keyword not found and unable to extract model from endpoint. Expected format: /model/{modelId}/{action}. Got: {endpoint}","messagePattern":"'model' keyword not found and unable to extract model from endpoint\\. Expected format: /model/(.+?)/(.+?)\\. Got: (.+?)","errorType":"validation","errorClass":"ValueError","httpStatus":400,"severity":"error","filePath":"litellm/proxy/pass_through_endpoints/llm_passthrough_endpoints.py","lineNumber":680,"sourceCode":"                break\n\n        # If \"model\" keyword not found, try to extract model from the endpoint\n        # by finding the action and taking everything before it\n        if model_index is None:\n            # Find the index of the action in the endpoint parts\n            action_index = None\n            for idx, part in enumerate(endpoint_parts):\n                if part in BEDROCK_ENDPOINT_ACTIONS:\n                    action_index = idx\n                    break\n\n            if action_index is not None and action_index > 1:\n                # Join all parts before the action (excluding empty strings)\n                model_parts = [p for p in endpoint_parts[1:action_index] if p]\n                if model_parts:\n                    return \"/\".join(model_parts)\n\n            raise ValueError(\n                f\"'model' keyword not found and unable to extract model from endpoint. Expected format: /model/{{modelId}}/{{action}}. Got: {endpoint}\"\n            )\n\n        # Find the index of the action in the endpoint parts\n        action_index = None\n        for idx, part in enumerate(endpoint_parts):\n            if part in BEDROCK_ENDPOINT_ACTIONS:\n                action_index = idx\n                break\n\n        if action_index is not None and action_index > model_index + 1:\n            # Join all parts between \"model\" and the action (excluding \"model\" itself)\n            return \"/\".join(endpoint_parts[model_index + 1 : action_index])\n\n        # Fallback to taking everything after \"model\" if no action found\n        model_parts = [p for p in endpoint_parts[model_index + 1 :] if p]\n        if model_parts:\n            return \"/\".join(model_parts)","sourceCodeStart":662,"sourceCodeEnd":698,"githubUrl":"https://github.com/BerriAI/litellm/blob/77b7c6c40c0c5aa5fbcb1d6a1825ac39ca8829b8/litellm/proxy/pass_through_endpoints/llm_passthrough_endpoints.py#L662-L698","documentation":"Bedrock model-ID extraction helper failed: the endpoint path contains neither a literal 'model' path segment nor any known BEDROCK_ENDPOINT_ACTIONS segment from which the model ID could be inferred, so the path does not match the expected /model/{modelId}/{action} shape. Thrown as ValueError during URL parsing before any request is sent.","triggerScenarios":"Thrown at litellm/proxy/pass_through_endpoints/llm_passthrough_endpoints.py:680 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Format the Bedrock pass-through endpoint as /model/{modelId}/{action}, e.g. /model/anthropic.claude-v2/invoke.","URL-encode the model ID if it contains slashes (use %2F)."],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"77b7c6c40c0c5aa5fbcb1d6a1825ac39ca8829b8","analyzedAt":"2026-08-18T11:44:31.656Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}