BerriAI/litellm · error · ValueError
Chat provider: Invalid text delta
Error message
Chat provider: Invalid text delta {parsed_chunk} What it means
While translating Responses-API stream events into chat-completion chunks, a 'response.output_text.delta' event carried a delta the parser could not turn into a ModelResponseStream — the parsed chunk is echoed so the malformed payload can be identified.
Solutions
- Inspect the logged chunk; the provider emitted a text delta in an unexpected format.
- Update litellm; if the issue persists, report the chunk shape so the transformation can handle it.
Defensive patterns
Strategy: validation
When it happens
Trigger: Thrown at litellm/completion_extras/litellm_responses_transformation/transformation.py:1383 when the library encounters an invalid state.
Common situations: See trigger scenarios.
AI-assisted analysis of BerriAI/litellm@77b7c6c40c (2026-08-18).
Data as JSON: /api/errors/874fa668484d5a97.
Report an issue: GitHub.
Appendix: source
Thrown at litellm/completion_extras/litellm_responses_transformation/transformation.py:1383
)
]
)
elif event_type == "response.output_text.delta":
# Content part added to output
content_part = parsed_chunk.get("delta", None)
if content_part is not None:
return ModelResponseStream(
choices=[
StreamingChoices(
index=0,
delta=Delta(content=content_part),
finish_reason=None,
)
]
)
else:
raise ValueError(f"Chat provider: Invalid text delta {parsed_chunk}")
elif event_type == "response.reasoning_summary_text.delta":
content_part = parsed_chunk.get("delta", None)
if content_part:
return ModelResponseStream(
choices=[
StreamingChoices(
index=cast(int, parsed_chunk.get("summary_index")),
delta=Delta(reasoning_content=content_part),
)
]
)
elif event_type == "response.completed":
# Response is fully complete - now we can signal is_finished=True
# This ensures we don't prematurely end the stream before tool_calls arrive
# Check if response contains function_call items in output
# to determine correct finish_reason
response_data: Final = parsed_chunk.get("response", {})View on GitHub (pinned to 77b7c6c40c)