Developer Tool

SSE Stream Viewer: Debug Streaming LLM Responses

Reassemble broken chunks, tool call deltas, tokens, and stream events. Runs in your browser. Nothing is uploaded.
Raw stream 0 lines · 0 B
Drop streaming log file here
Result Auto (Ready)
LLM Response Finish: none
Paste an SSE stream to inspect the assembled message.
# Event ID Data Payload Preview Size
No events parsed yet

No function or tool calls found in the stream.

-
Prompt Tokens
-
Completion Tokens
-
Total Tokens
0
Total Chunks
Timing & Telemetry
Time to First Token (TTFT): N/A (Requires timestamp logs)
Total Duration: N/A
Average Chunk Interval: N/A
✓ Clean Stream
No syntax errors, cut-off chunks, or tool calling anomalies detected.

How to Debug Streaming LLM Responses

Real-time generative AI applications rely heavily on Server-Sent Events (SSE) to stream response tokens back to users as they are computed. Rather than waiting 15–30 seconds for a full completion, client frontends read raw HTTP event streams chunk-by-chunk. However, parsing these streams in development and production can be notoriously difficult due to multi-part JSON fragments, fragmented tool call parameters, network splits, and subtle provider dialect nuances.

How to Use This Tool in 4 Steps

  1. Copy your stream: In Google Chrome, Microsoft Edge, or Firefox DevTools, navigate to the Network tab. Trigger your streaming LLM call, select the request, and copy the full text from the EventStream or Response view. You can also paste terminal output from curl -N or saved backend logs.
  2. Paste into the Raw Stream pane: Paste the raw chunked text or drag-and-drop your log file directly into the left editor pane. The tool will auto-detect the provider and trigger debounced reassembly.
  3. Inspect Rebuilt Artifacts: The right panel immediately extracts the continuous message text, reassembles interleaved tool call argument deltas into validated JSON, extracts token usage metrics, and identifies any stream problems.
  4. Simulate with Replay or Export: Click Replay Stream to visually watch the text stream with adjustable playback speed, or click Export to download the reassembled JSON and clean sanitized repros.

Example: Raw SSE Stream vs Reassembled Output

Notice how tool-call arguments arrive broken across multiple data packets:

// Raw Stream Input (OpenAI Delta Format) data: {"choices":[{"delta":{"tool_calls":[{"index":0,"id":"call_99","function":{"name":"get_weather","arguments":""}}]}}]} data: {"choices":[{"delta":{"tool_calls":[{"index":0,"function":{"arguments":"{\"loc"}}}]}}]} data: {"choices":[{"delta":{"tool_calls":[{"index":0,"function":{"arguments":"ation\":\"San Fra"}}}]}}]} data: {"choices":[{"delta":{"tool_calls":[{"index":0,"function":{"arguments":"ncisco, CA\"}"}}]}}]} data: [DONE]

The SSE Stream Viewer reassembles the fragmented chunks into the single cohesive tool invocation:

// Reassembled Tool Call Output { "name": "get_weather", "id": "call_99", "arguments": { "location": "San Francisco, CA" }, "status": "valid_json" }

Why Rebuilding Streamed Tool Calls Matters

Modern large language models such as OpenAI GPT-4o, Anthropic Claude 3.7 Sonnet, and Google Gemini 1.5 Pro treat structured tool invocation as sequential token generation. The LLM produces string fragments of JSON syntax. If an edge proxy trims the response, drops a packet, or truncates on maximum token limit (finish_reason: "length"), the client receives an invalid, unclosed JSON string. This tool reconstructs the arguments step-by-step, highlights the exact JSON syntax error column, and detects multi-byte UTF-8 characters split across packet boundaries.

Common Streaming Problems & Solutions

  • Incomplete Stream: Missing a closing [DONE], message_stop, or final double newline. Often caused by load balancer read timeouts or reverse proxy buffering.
  • Truncated on Token Limit: The model hit max_tokens before closing brackets. The tool marks this with a warning and flags incomplete function arguments.
  • Split UTF-8 Characters: Non-ASCII characters (such as emojis or accented characters) span multiple bytes. If an upstream chunk splits a byte sequence, raw decoders without a streaming TextDecoder throw invalid replacement characters.
  • Invalid Data Delimiters: SSE specifications require field lines formatted strictly as data: <payload>\n\n. Unbuffered lines cause client parsers to stall.

Frequently Asked Questions

What is Server-Sent Events (SSE)?
Server-Sent Events (SSE) is an HTTP standard that allows a web server to continuously push unidirectional text messages to client browsers over an open HTTP connection using MIME type text/event-stream.
Why are tool-call arguments split into pieces?
Because LLMs emit tokens progressively. Function parameters are formatted as JSON text, so the arguments are received in tiny string deltas. The recipient application must append these fragments until the finish reason is delivered.
How do I copy a stream from DevTools?
Open Chrome, Safari, or Firefox DevTools (F12 or Cmd+Option+I), navigate to the Network tab, filter by Fetch/XHR, trigger the streaming generation, click the request, and switch to the EventStream tab. Right click and copy the event stream rows.
Is my log uploaded to any server?
No. All stream parsing, dialect normalization, JSON inspection, and redaction logic run 100% locally in your browser memory using vanilla JavaScript. Nothing is uploaded or logged.
What LLM providers and formats are supported?
The viewer supports OpenAI Chat Completions, OpenAI Responses API, Anthropic Messages API (including thinking blocks), Google Gemini candidate streams (SSE and JSON array chunks), and arbitrary generic SSE streams.

Related Free Developer Tools

Explore other browser-only developer utilities built by MafLabs: