{"record":{"id":"396858f9b5191907","repo":"BerriAI/litellm","slug":"completion-response-error-396858","errorCode":null,"errorMessage":"completion_response[\"error\"]","messagePattern":"completion_response\\[\"error\"\\]","errorType":"http","errorClass":"OobaboogaError","httpStatus":null,"severity":"error","filePath":"litellm/llms/oobabooga/chat/transformation.py","lineNumber":58,"sourceCode":"        encoding: Any,\n        api_key: str | None = None,\n        json_mode: bool | None = None,\n    ) -> ModelResponse:\n        ## LOGGING\n        logging_obj.post_call(\n            input=messages,\n            api_key=api_key,\n            original_response=raw_response.text,\n            additional_args={\"complete_input_dict\": request_data},\n        )\n\n        ## RESPONSE OBJECT\n        try:\n            completion_response: Final = raw_response.json()\n        except Exception:\n            raise OobaboogaError(message=raw_response.text, status_code=raw_response.status_code)\n        if \"error\" in completion_response:\n            raise OobaboogaError(\n                message=completion_response[\"error\"],\n                status_code=raw_response.status_code,\n            )\n        else:\n            try:\n                model_response.choices[0].message.content = completion_response[\"choices\"][0][\"message\"][\"content\"]\n            except Exception as e:\n                raise OobaboogaError(\n                    message=str(e),\n                    status_code=raw_response.status_code,\n                )\n\n        model_response.created = int(time.time())\n        model_response.model = model\n        usage: Final = Usage(\n            prompt_tokens=completion_response[\"usage\"][\"prompt_tokens\"],\n            completion_tokens=completion_response[\"usage\"][\"completion_tokens\"],\n            total_tokens=completion_response[\"usage\"][\"total_tokens\"],","sourceCodeStart":40,"sourceCodeEnd":76,"githubUrl":"https://github.com/BerriAI/litellm/blob/77b7c6c40c0c5aa5fbcb1d6a1825ac39ca8829b8/litellm/llms/oobabooga/chat/transformation.py#L40-L76","documentation":"The parsed JSON body of an Oobabooga response contains a top-level 'error' key, meaning the backend accepted the HTTP request but reported a generation failure in-band (e.g. invalid prompt, model load failure, memory error). The handler re-raises it as OobaboogaError with the upstream status code.","triggerScenarios":"Thrown at litellm/llms/oobabooga/chat/transformation.py:58 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Handle the error field returned by oobabooga and fix the request as indicated by the message."],"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-23T08:17:48.524Z"}