llm runtime_error ai_generated true

UnicodeDecodeError: incomplete multi-byte sequence in stream

ID: llm/streaming-token-decode-error

Also available as: JSON · Markdown
82%Fix Rate
86%Confidence
3Evidence
2023-01-01First Seen

Version Compatibility

VersionStatusIntroducedDeprecatedNotes
any active

Root Cause

Streaming response has incomplete unicode characters at chunk boundaries.

generic

Workarounds

  1. 90% success Buffer chunks and decode only complete utf-8 sequences
  2. 88% success Use SSE parser that handles chunked encoding correctly

Dead Ends

Common approaches that don't work:

  1. Decode each chunk independently 82% fail

    Split multi-byte chars produce errors

  2. Use ascii encoding only 78% fail

    Loses non-ASCII content