{"record":{"id":"a105af3c27dfb74e","repo":"BerriAI/litellm","slug":"failed-to-decode-json-from-chunk-chunk-a105af","errorCode":null,"errorMessage":"Failed to decode JSON from chunk: {chunk}","messagePattern":"Failed to decode JSON from chunk: (.+?)","errorType":"exception","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"litellm/llms/anthropic/completion/transformation.py","lineNumber":289,"sourceCode":"            if _chunk_text is not None and isinstance(_chunk_text, str):\n                text = _chunk_text\n            finish_reason = chunk.get(\"stop_reason\") or \"\"\n            if finish_reason is not None:\n                is_finished = True\n            returned_chunk: Final = GenericStreamingChunk(\n                text=text,\n                tool_use=tool_use,\n                is_finished=is_finished,\n                finish_reason=finish_reason,\n                usage=usage,\n                index=index,\n                provider_specific_fields=provider_specific_fields,\n            )\n\n            return returned_chunk\n\n        except json.JSONDecodeError:\n            raise ValueError(f\"Failed to decode JSON from chunk: {chunk}\")\n","sourceCodeStart":271,"sourceCodeEnd":290,"githubUrl":"https://github.com/BerriAI/litellm/blob/6c2dcb801bf2b75c18f1bb24140e7cf57465cc4d/litellm/llms/anthropic/completion/transformation.py#L271-L290","documentation":"Error \"Failed to decode JSON from chunk: {chunk}\" thrown in BerriAI/litellm.","triggerScenarios":"Thrown at litellm/llms/anthropic/completion/transformation.py:289 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["The stream chunk was not valid JSON; check for proxy interference or provider issues."],"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-15T17:31:12.345Z"}