Agent skill · Backend & API

llm-streaming

LLM streaming response patterns. Use when implementing real-time token streaming, Server-Sent Events for AI responses, or streaming with tool calls.

majiayu000github.com/majiayu000GitHub ↗
claude-codeMIT
Install
npx skills add majiayu000/claude-skill-registry --skill llm-streaming --agent claude-code

Same command for any agent — swap --agent for codex, cursor, copilot.

Facts
Files in the skill folder: 2
SKILL.md size: 6 KB
Bundled scripts: none
Version: 1.0.0
Declared author: SkillForge
Path: skills/ai-llm/llm-streaming/SKILL.md
Open the folder on GitHub →
Where it comes from
Stars: 534
Language: HTML

Weekly change comes from our own snapshots, not the repository page — it measures attention, not adoption.

From the SKILL.md

# 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

What's inside
Steps it walks through
  1. Basic Streaming (OpenAI)
  2. Streaming with Async
  3. FastAPI SSE Endpoint
  4. Frontend SSE Consumer
  5. Streaming with Tool Calls
  6. Backpressure Handling
  7. Key Decisions
  8. Common Mistakes
  9. Related Skills
  10. Capability Details
  11. token-streaming
  12. sse-responses
  13. streaming-with-tools
  14. partial-json-parsing
Ships with 1 file
  • metadata.json
More from claude-skill-registry
All skills →
About this skill
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.

Keep going