{"record":{"id":"9cc0013d853a1ba3","repo":"BerriAI/litellm","slug":"invalid-ragflow-model-format-model-expected-fo","errorCode":null,"errorMessage":"Invalid RAGFlow model format: {model}. Expected format: ragflow/chat/{{chat_id}}/{{model}} or ragflow/agent/{{agent_id}}/{{model}}","messagePattern":"Invalid RAGFlow model format: (.+?)\\. Expected format: ragflow/chat/(.+?)\\}/(.+?)\\} or ragflow/agent/(.+?)\\}/(.+?)\\}","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"litellm/llms/ragflow/chat/transformation.py","lineNumber":46,"sourceCode":"    - ragflow/agent/{agent_id}/{model_name} for agent endpoints\n    \"\"\"\n\n    def _parse_ragflow_model(self, model: str) -> tuple[str, str, str]:\n        \"\"\"\n        Parse RAGFlow model name format: ragflow/{endpoint_type}/{id}/{model_name}\n\n        Args:\n            model: Model name in format ragflow/chat/{chat_id}/{model} or ragflow/agent/{agent_id}/{model}\n\n        Returns:\n            Tuple of (endpoint_type, id, model_name)\n\n        Raises:\n            ValueError: If model format is invalid\n        \"\"\"\n        parts: Final = model.split(\"/\")\n        if len(parts) < 4:\n            raise ValueError(\n                f\"Invalid RAGFlow model format: {model}. \"\n                f\"Expected format: ragflow/chat/{{chat_id}}/{{model}} or ragflow/agent/{{agent_id}}/{{model}}\"\n            )\n\n        if parts[0] != \"ragflow\":\n            raise ValueError(f\"Invalid RAGFlow model format: {model}. Must start with 'ragflow/'\")\n\n        endpoint_type: Final = parts[1]\n        if endpoint_type not in [\"chat\", \"agent\"]:\n            raise ValueError(f\"Invalid RAGFlow endpoint type: {endpoint_type}. Must be 'chat' or 'agent'\")\n\n        entity_id: Final = parts[2]\n        model_name: Final = \"/\".join(parts[3:])  # Handle model names that might contain slashes\n\n        return endpoint_type, entity_id, model_name\n\n    def get_complete_url(\n        self,","sourceCodeStart":28,"sourceCodeEnd":64,"githubUrl":"https://github.com/BerriAI/litellm/blob/77b7c6c40c0c5aa5fbcb1d6a1825ac39ca8829b8/litellm/llms/ragflow/chat/transformation.py#L28-L64","documentation":"Model-format parser guard in the RAGFlow chat config: splitting the model string on '/' yielded fewer than 4 segments, so it cannot be the required ragflow/{chat|agent}/{id}/{model_name} form. The whole model string is echoed back for correction.","triggerScenarios":"Triggered when the RAGFlow model string does not match ragflow/chat/<chat_id>/<model> or ragflow/agent/<agent_id>/<model>.","commonSituations":"See trigger scenarios.","solutions":["Use model format ragflow/chat/{{chat_id}}/{{model}} or ragflow/agent/{{agent_id}}/{{model}}.","Check for typos or missing segments in the model string."],"exampleFix":"model=\"ragflow/chat/abc123/qwen-plus\"","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-14T05:17:10.506Z"}