{"record":{"id":"feb4762b652a743c","repo":"BerriAI/litellm","slug":"ovhcloud-error","errorCode":null,"errorMessage":"OVHCloud Error: {}","messagePattern":"OVHCloud Error: (.+?)","errorType":"http","errorClass":"OVHCloudException","httpStatus":null,"severity":"error","filePath":"litellm/llms/ovhcloud/chat/transformation.py","lineNumber":82,"sourceCode":"        response: Final = super().transform_request(model, messages, optional_params, litellm_params, headers)\n        response.update(extra_body)\n        return response\n\n\nclass OVHCloudChatCompletionStreamingHandler(BaseModelResponseIterator):\n    \"\"\"\n    Handler for OVHCloud AI Endpoints streaming chat completion responses\n    \"\"\"\n\n    def chunk_parser(self, chunk: dict) -> ModelResponseStream:\n        \"\"\"\n        Parse individual chunks from streaming response\n        \"\"\"\n        try:\n            if \"error\" in chunk:\n                error_chunk: Final = chunk[\"error\"]\n                error_message: Final = \"OVHCloud Error: {}\".format(error_chunk.get(\"message\", \"Unknown error\"))\n                raise OVHCloudException(\n                    message=error_message,\n                    status_code=error_chunk.get(\"code\", 400),\n                    headers={\"Content-Type\": \"application/json\"},\n                )\n\n            new_choices: Final = []\n            for choice in chunk[\"choices\"]:\n                if \"delta\" in choice:\n                    delta = choice[\"delta\"]\n                    # OVHCloud field migration (deadline: 2026-05-11):\n                    # `reasoning_content` is replaced by `reasoning`.\n                    # Normalise to `reasoning_content` so downstream consumers\n                    # see a consistent key during the transition window.\n                    reasoning_new = delta.get(\"reasoning\")\n                    reasoning_legacy = delta.get(\"reasoning_content\")\n                    if reasoning_new is not None and reasoning_legacy is None:\n                        delta[\"reasoning_content\"] = reasoning_new\n                new_choices.append(choice)","sourceCodeStart":64,"sourceCodeEnd":100,"githubUrl":"https://github.com/BerriAI/litellm/blob/77b7c6c40c0c5aa5fbcb1d6a1825ac39ca8829b8/litellm/llms/ovhcloud/chat/transformation.py#L64-L100","documentation":"In streaming chat mode LiteLLM parses each SSE chunk dict from OVHCloud. If a chunk carries an 'error' key, it raises OVHCloudException using error.message and error.code (defaults: 'Unknown error' and 400) with JSON content-type headers. The stream aborts mid-consumption, so partial text may already have been yielded to the caller.","triggerScenarios":"Streaming a completion with ovhcloud/* models when OVH pushes an error event mid-stream: quota exceeded, deprecated model, prompt exceeding context length, or upstream capacity errors during generation.","commonSituations":"Token quota exhausted partway through a long stream; using a model OVH has end-of-lifed; very large prompts; endpoints overloaded at peak times.","solutions":["Read the exception message - it carries error.message from the chunk identifying the cause","Check remaining quota and the model's availability on OVH AI Endpoints","Shorten the prompt if the error references context length","Preserve and surface the partial text already streamed before the abort"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"Consume streams inside try/except OVHCloudException; on a mid-stream error, keep the already-yielded partial content and either surface it to the user with an incomplete flag or restart the request once - quota/context errors will not clear on retry, capacity errors might.","preventionTips":["Always accumulate streamed partial output so mid-stream aborts are not total losses","Monitor OVH quota before starting long streams","Match prompt size to the model's context limit before streaming"],"tags":["ovhcloud","streaming","sse","upstream-error","litellm"],"backgroundTag":"upstream-api-error","analyzedSha":"77b7c6c40c0c5aa5fbcb1d6a1825ac39ca8829b8","analyzedAt":"2026-08-18T11:44:31.656Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}