llm-streaming
LLM streaming response patterns. Use when implementing real-time token streaming, Server-Sent Events for AI responses, or streaming with tool calls.
npx skills add majiayu000/claude-skill-registry --skill llm-streaming --agent claude-code
Same command for any agent — swap --agent for codex, cursor, copilot.
Weekly change comes from our own snapshots, not the repository page — it measures attention, not adoption.
# LLM Streaming Deliver LLM responses in real-time for better UX. ## Basic Streaming (OpenAI) ```python from openai import OpenAI client = OpenAI() async def stream_response(prompt: str): """Stream tokens as they're generated.""" stream = client.chat.completions.create( model="gpt-4o", messages=[{"role": "user", "content": prompt}], stream=True ) for chunk in stream: if chunk.choices[0].delta.content: yield chunk.choices[0].delta.content ``` ## Streaming with Async ```python from openai import AsyncOpenAI client = AsyncOpenAI() async def async_stream(prompt: str): """Async streaming for better concurrency.""" stream = await client.chat.completions.create( model="gpt-4o", messages=[{"role": "user", "content": prompt}], stream=True ) async for chunk in stream: if chunk.choices[0].delta.content: yield chunk.choices[0].delta.content ``` ## FastAPI SSE Endpoint ```python from fastapi import FastAPI from fastapi.responses import StreamingResponse from sse_starlette.sse import EventSourceResponse app = FastAPI() @app.get("/chat/stream") async def stream_chat(prompt: str): """Server-Sent Events endpoint for streaming.""" async def generate(): async for token in async_stream(prompt): yield
- Basic Streaming (OpenAI)
- Streaming with Async
- FastAPI SSE Endpoint
- Frontend SSE Consumer
- Streaming with Tool Calls
- Backpressure Handling
- Key Decisions
- Common Mistakes
- Related Skills
- Capability Details
- token-streaming
- sse-responses
- streaming-with-tools
- partial-json-parsing
What does the llm-streaming skill do?
LLM streaming response patterns. Use when implementing real-time token streaming, Server-Sent Events for AI responses, or streaming with tool calls.
How do I install it?
Run `npx skills add majiayu000/claude-skill-registry --skill llm-streaming --agent claude-code` — it drops the skill into your project so the agent can pick it up. Swap the --agent value for codex, cursor or copilot if you use one of those.
Where does this skill come from?
From majiayu000/claude-skill-registry, a repository with 534 stars. We read it straight from the repository tree rather than a submitted listing, so what you see here is what is actually published.
Is a popular skill a good skill?
Not necessarily. Stars measure attention, not adoption — a repository can trend for a week and be abandoned. That is why we show the weekly change from our own snapshots next to the total, instead of a single flattering number.
