{"record":{"id":"65169e04a4f3f21c","repo":"BerriAI/litellm","slug":"self-custom-llm-provider-raised-a-streaming-erro","errorCode":null,"errorMessage":"{self.custom_llm_provider} raised a streaming error - finish_reason: error, no content string given. Received Chunk={response_obj}","messagePattern":"(.+?) raised a streaming error - finish_reason: error, no content string given\\. Received Chunk=(.+?)","errorType":"exception","errorClass":"Exception","httpStatus":null,"severity":"error","filePath":"litellm/litellm_core_utils/streaming_handler.py","lineNumber":1466,"sourceCode":"                self.system_fingerprint = cached_chunk.system_fingerprint\n            if response_obj[\"is_finished\"]:\n                self.received_finish_reason = response_obj[\"finish_reason\"]\n        else:  # openai / azure chat model\n            if self.custom_llm_provider in [\n                LlmProviders.AZURE.value,\n                LlmProviders.AZURE_AI.value,\n            ]:\n                if isinstance(chunk, BaseModel) and hasattr(chunk, \"model\"):\n                    # for azure, we need to pass the model from the original chunk\n                    self.model = getattr(chunk, \"model\", self.model)\n            response_obj = self.handle_openai_chat_completion_chunk(chunk)\n            if response_obj is None:\n                return _ProviderChunkEarlyReturn(None)\n            completion_obj[\"content\"] = response_obj[\"text\"]\n            self.intermittent_finish_reason = response_obj.get(\"finish_reason\", None)\n            if response_obj[\"is_finished\"]:\n                if response_obj[\"finish_reason\"] == \"error\":\n                    raise Exception(\n                        f\"{self.custom_llm_provider} raised a streaming error - finish_reason: error, no content string given. Received Chunk={response_obj}\"\n                    )\n                self.received_finish_reason = response_obj[\"finish_reason\"]\n            if response_obj.get(\"original_chunk\", None) is not None:\n                if hasattr(response_obj[\"original_chunk\"], \"id\"):\n                    model_response = self.set_model_id(response_obj[\"original_chunk\"].id, model_response)\n                if hasattr(response_obj[\"original_chunk\"], \"system_fingerprint\"):\n                    model_response.system_fingerprint = response_obj[\"original_chunk\"].system_fingerprint\n                    self.system_fingerprint = response_obj[\"original_chunk\"].system_fingerprint\n            if response_obj[\"logprobs\"] is not None:\n                model_response.choices[0].logprobs = response_obj[\"logprobs\"]\n\n            if response_obj[\"usage\"] is not None:\n                if isinstance(response_obj[\"usage\"], dict):\n                    setattr(\n                        model_response,\n                        \"usage\",\n                        litellm.Usage(","sourceCodeStart":1448,"sourceCodeEnd":1484,"githubUrl":"https://github.com/BerriAI/litellm/blob/77b7c6c40c0c5aa5fbcb1d6a1825ac39ca8829b8/litellm/litellm_core_utils/streaming_handler.py#L1448-L1484","documentation":"Streaming error normalization: when a provider's stream raises and the parser yields no usable content, the failure is re-raised as a finish_reason='error' chunk message embedding the provider name and the received chunk, so downstream consumers see a consistent stream-failure signal.","triggerScenarios":"Thrown at litellm/litellm_core_utils/streaming_handler.py:1466 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["The provider ended the stream with finish_reason 'error' and no content; inspect the received chunk via verbose logging.","Retry the request; check provider status and quotas."],"exampleFix":null,"handlingStrategy":"try-catch","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"}