{"record":{"id":"63d3ed55bbabc40f","repo":"BerriAI/litellm","slug":"invalid-model-format-expected-format-model-agen","errorCode":null,"errorMessage":"Invalid model format. Expected format: 'model=agent/AGENT_ID/ALIAS_ID'","messagePattern":"Invalid model format\\. Expected format: 'model=agent/AGENT_ID/ALIAS_ID'","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"litellm/llms/bedrock/chat/invoke_agent/transformation.py","lineNumber":139,"sourceCode":"            optional_params=optional_params,\n            request_data=request_data,\n            api_base=api_base,\n            model=model,\n            stream=stream,\n            fake_stream=fake_stream,\n            api_key=api_key,\n        )\n\n    def _get_agent_id_and_alias_id(self, model: str) -> tuple[str, str]:\n        \"\"\"\n        model = \"agent/L1RT58GYRW/MFPSBCXYTW\"\n        agent_id = \"L1RT58GYRW\"\n        agent_alias_id = \"MFPSBCXYTW\"\n        \"\"\"\n        # Split the model string by '/' and extract components\n        parts: Final = model.split(\"/\")\n        if len(parts) != 3 or parts[0] != \"agent\":\n            raise ValueError(\"Invalid model format. Expected format: 'model=agent/AGENT_ID/ALIAS_ID'\")\n\n        return parts[1], parts[2]  # Return (agent_id, agent_alias_id)\n\n    def _get_session_id(self, optional_params: dict) -> str:\n        \"\"\" \"\"\"\n        return optional_params.get(\"sessionID\", None) or str(uuid.uuid4())\n\n    def transform_request(\n        self,\n        model: str,\n        messages: list[AllMessageValues],\n        optional_params: dict,\n        litellm_params: dict,\n        headers: dict,\n    ) -> dict:\n        # use the last message content as the query\n        query: Final[str] = convert_content_list_to_str(messages[-1])\n        return {","sourceCodeStart":121,"sourceCodeEnd":157,"githubUrl":"https://github.com/BerriAI/litellm/blob/6c2dcb801bf2b75c18f1bb24140e7cf57465cc4d/litellm/llms/bedrock/chat/invoke_agent/transformation.py#L121-L157","documentation":"Error \"Invalid model format. Expected format: 'model=agent/AGENT_ID/ALIAS_ID'\" thrown in BerriAI/litellm.","triggerScenarios":"Thrown at litellm/llms/bedrock/chat/invoke_agent/transformation.py:139 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Use model format 'agent/AGENT_ID/ALIAS_ID'."],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"6c2dcb801bf2b75c18f1bb24140e7cf57465cc4d","analyzedAt":"2026-08-15T07:12:03.035Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}