Agent skill · software engineering · erichowens

llm-streaming-response-handler

Build production LLM streaming UIs with Server-Sent Events, real-time token display, cancellation, error recovery. Handles OpenAI/Anthropic/Claude streaming APIs. Use for chatbots, AI assistants,

Why this skill is useful

Provides specific implementation patterns and error handling strategies for real-time LLM streaming using SSE that the AI wouldn't reliably generate on its own.

What it needs

Requires npm installed locally. About 7k tokens when loaded. Last updated 2026-07-14. 180 stars on the source repository.

What this skill does

LLM Streaming Response Handler Expert in building production-grade streaming interfaces for LLM responses that feel instant and responsive. When to Use ✅ Use for: Chat interfaces with typing animation Real-time AI assistants Code generation with live preview Document summarization with progressive display Any UI where users expect immediate feedback from LLMs ❌ NOT for: Batch document processing (no user watching) APIs that don't support streaming WebSocket-based bidirectional chat (use Socket.IO) Simple request/response (fetch is fine) Quick Decision Tree --- Technology Selection Server-Sent Events (SSE) - Recommended Why SSE over WebSockets for LLM streaming: Simplicity: HTTP-based, works with existing infrastructure Auto-reconnect: Built-in reconnection logic Firewall-friendly: Easier than WebSockets through proxies One-way perfect: LLMs only stream server → client Timeline: 2015-2020: WebSockets for everything 2020: SSE adoption for streaming APIs 2023+: SSE standard for LLM streaming (OpenAI, Anthropic) 2024: Vercel AI SDK popularizes SSE patterns Streaming APIs Provider Streaming Method Response Format ---------- ------------------ ----------------- OpenAI SSE data: {"choices":[{"delta":{"content":"token"}}]} Anthropic SSE data: {"type":"contentblockdelta","delta":{"text":"token"}} Claude (API) SSE data: {"delta":{"text":"token"}} Vercel AI SDK SSE Normalized across providers --- Common Anti-Patterns Anti-Pattern 1: Buffering Before Display Novice thinking: "Collect all tokens, then show complete response" Problem: Defeats the entire purpose of streaming. Wrong approach: Correct approach: Timeline: Pre-2023: Many apps buffered entire response 2023+: Token-by-token display expected --- Anti-Pattern 2: No Stream Cancellation Problem: User can't stop generation, wasting tokens and money. Symptom: "Stop" button doesn't work or doesn't exist. …

How to use it

Reference it in AdaL, Claude Code, Cursor or any coding agent — nothing to install:

@skills erichowens/llm-streaming-response-handler

View the source on GitHub

Browse the @skills marketplace