litellm-rs: Skill for Claude Code

.claude/skills/streaming-architecture/SKILL.md

streaming-architecture is a skill for Claude Code from majiayu000/litellm-rs. It costs 73 tokens per session (1,904 once invoked), scanned A, original, MIT.

A guide to handling server-sent events (SSE), a format for sending a live stream of small updates over HTTP, in LiteLLM-RS. It explains how provider-specific streams from services such as OpenAI, Anthropic, and Google become one common chat-stream format.

In plain words
What is it for?
Use it when debugging live model responses, writing or changing a provider stream converter, connecting streaming through the server, or handling backpressure and oversized buffers.
Why use it?
It removes the need for the rest of the server to understand each provider’s streaming format. It also covers buffering, slow consumers, stream limits, and provider-specific conversion errors.

Skill for Claude Code

Written for Claude Code: installed under .claude/.

This is majiayu000/litellm-rs's own configuration. It tells Claude Code how to work on litellm-rs itself, so it is not a mod to install elsewhere. Copy it as a starting point and replace the rules that are about this project. Everything litellm-rs configures →

Reuse

Borrowing it

Nothing to install: this file belongs to majiayu000/litellm-rs. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.

Copy the file
curl -O https://raw.githubusercontent.com/majiayu000/litellm-rs/main/.claude/skills/streaming-architecture/SKILL.md
Clone the repo
git clone --depth 1 https://github.com/majiayu000/litellm-rs

Made for: Claude Code.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for streaming-architecture

README.md
[![agentmods](https://agentmods.dev/badge/skills/majiayu000/litellm-rs/streaming-architecture/github.svg)](https://agentmods.dev/skills/majiayu000/litellm-rs/streaming-architecture)
Your own site
<a href="https://agentmods.dev/skills/majiayu000/litellm-rs/streaming-architecture"><img src="https://agentmods.dev/badge/skills/majiayu000/litellm-rs/streaming-architecture/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for streaming-architecture

Your own site · 80×15
<a href="https://agentmods.dev/skills/majiayu000/litellm-rs/streaming-architecture"><img src="https://agentmods.dev/badge/skills/majiayu000/litellm-rs/streaming-architecture.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 73 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,904 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe. Third-party audits
  • NVIDIA SkillSpector warn 7 Sept 2026
SkillSpector: 1 finding, up to medium

These are SkillSpector’s own severities. On a checked sample its high-severity flags on skills were ~96% false positives — a documented command, a public API, a “never do X” rule — so we show them as a caution to read, not a verdict. Why →

  • medium Output Handling · line 153
    Output size or generation rate is not bounded. Unbounded output enables denial-of-service through resource exhaustion, log flooding, or context-window stuffing.
    Fix: Set explicit limits on output length, generation count, and rate. Use max_tokens and truncation to prevent unbounded output.
How audits are shown
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00073 $0.01904
Opus 5 $0.00036 $0.00952
Sonnet 5 $0.00015 $0.00381
Haiku 4.5 $0.00007 $0.00190

Measured 11d ago against content hash 9f7585a39776, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-11, from the pricing page.

Security

Grade A, and why

streaming-architecture scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 11d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

.claude/skills/streaming-architecture/SKILL.md · 202 lines

How it starts

The opening of the file, as written. The whole thing — 202 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Streaming Architecture Guide

Overview

Provider streaming lives in src/core/providers/base/sse.rs plus per-provider transformers under src/core/providers/base/sse/ (openai.rs, anthropic.rs, gemini.rs, cohere.rs, databricks.rs). The layer consumes a provider's raw SSE byte stream and yields Result<ChatChunk, ProviderError> items in an OpenAI-compatible shape, so the server routes never see provider-specific formats.

Streaming Flow

┌─────────────────────────────────────────────────────────────────┐
│                  Provider SSE byte stream                       │
│  reqwest::Response::bytes_stream()                              │
│  (OpenAI, Anthropic, Google, ...)                               │
└─────────────────────────────────────────────────────────────────┘
                              │
                              ▼
┌─────────────────────────────────────────────────────────────────┐
│                  UnifiedSSEStream<S, T>                         │
│  - polls upstream bytes, feeds UnifiedSSEParser                 │
│  - chunk_buffer: VecDeque<ChatChunk>, capped at 10_000          │
│  - Item = Result<ChatChunk, ProviderError>                      │
└─────────────────────────────────────────────────────────────────┘
                              │
                              ▼
┌─────────────────────────────────────────────────────────────────┐
│                  UnifiedSSEParser<T>                            │
│  - String line buffer (incomplete tail retained across reads)   │
│  - SSEEvent field parsing, multi-line data joining              │
│  - end-marker / finish_stream dispatch                          │
└─────────────────────────────────────────────────────────────────┘
                              │
                              ▼
┌─────────────────────────────────────────────────────────────────┐
│                  SSETransformer (per provider)                  │
│  - transform_chunk / transform_stream_chunk                     │
│  - normalizes wire format to ChatChunk                          │
└─────────────────────────────────────────────────────────────────┘
                              │
                              ▼
┌─────────────────────────────────────────────────────────────────┐
│                  Server route re-serialization                  │
│  ChatChunk -> SSE frames ("data: {...}\n\n") + final [DONE]     │
└─────────────────────────────────────────────────────────────────┘

Read the full file on GitHub · 202 lines

Files

What ships with it

5 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 11d ago First seen · 202 lines · 73 tokens per session scan A 9f7585a39776

Subscribe to this mod's changes

streaming-architecture is a skill published in the GitHub repository majiayu000/litellm-rs (112 stars, last pushed 2d ago), licensed MIT. It adds 73 tokens to every session and 1,904 once invoked, about $0.0004 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.