Stream AI output token by token, without reinventing the plumbing.
JinnFlux Community is an open-source toolkit and community for real-time streaming AI. It gives you composable building blocks for token streaming, SSE and WebSocket pipelines, and low-latency LLM output, so first-token-to-screen stays fast and your transport layer stays boring.
Overview #
Everything you need to move tokens from a model to a browser, predictably.
Token streaming
Normalize partial deltas from any streaming source into a single, backpressure-aware token stream your UI can trust.
SSE & WebSocket
One pipeline definition, two transports. Swap between Server-Sent Events and WebSockets without rewriting handlers.
Low latency
Chunk coalescing, flush hints, and heartbeat framing designed to keep time-to-first-token and jitter low.
Composable stages
Build pipelines from small stages — parse, transform, buffer, fan-out — that each do one thing well.
Reconnect & resume
Resumable streams with cursor replay so a dropped connection does not mean a lost generation.
Framework-agnostic
Thin adapters, no lock-in. Drop it into the server runtime and client framework you already use.
Quickstart #
Install the core package and pipe your first streamed response to the browser.
# install the core toolkit npm install @jinnflux/core # or with pnpm pnpm add @jinnflux/core
Define a streaming pipeline (server)
import { pipeline, tokens, sse } from "@jinnflux/core"; const stream = pipeline( tokens.fromSource(modelResponse), // normalize deltas tokens.coalesce({ maxMs: 16 }), // batch per frame sse.encode() // emit SSE events ); return stream.toResponse(); // a standard Response
Consume it (client)
import { consume } from "@jinnflux/client"; for await (const token of consume("/api/chat")) { output.textContent += token.text; // paint as it arrives }
sse.encode() for ws.encode() — the stages in between do not change.Core concepts #
Three ideas carry the whole toolkit.
- A stream is a sequence of deltas.
Every source — a model, a queue, a replayed log — becomes a uniform stream of typed deltas, so downstream code never special-cases a provider.
- A pipeline is a list of stages.
Stages transform the stream: parse, filter, coalesce, fan-out. They compose left to right and are individually testable.
- A transport is just the last stage.
SSE, WebSocket, or a plain async iterator — the encoding lives at the edge, so your logic stays transport-independent.
Streaming pipelines #
Small stages you snap together.
tokens.fromSource
Adapt any streaming producer into a normalized delta stream with consistent event shapes.
tokens.coalesce
Group tokens into frame-sized batches to cut render churn while keeping perceived latency low.
tokens.transform
Map, redact, or annotate tokens in flight — stop sequences, markdown fences, and more.
stream.fanOut
Deliver one generation to many subscribers, each with its own cursor and backpressure.
SSE & WebSocket #
Pick the transport that fits the deployment, not the other way around.
Server-Sent Events
Simple, HTTP-native, proxy-friendly, one-way. Ideal for chat completions and progress streams. Built-in heartbeat and Last-Event-ID resume.
WebSocket
Full-duplex when you need client-to-server signals mid-stream — interrupts, tool results, live edits. Same pipeline, duplex framing.
Low-latency output #
Techniques the toolkit applies so first tokens show up fast and stay smooth.
Frame coalescing
Batch deltas to a render budget instead of flushing every token, reducing layout thrash.
Flush hints
Force an early flush at sentence or boundary markers so meaningful chunks appear promptly.
Heartbeats
Keep idle connections and intermediaries alive without polluting the token stream.
Community #
JinnFlux is built in the open. The toolkit and its docs are developed with and for the people who use it.
Discussions
Ask questions, share pipelines, and compare transport setups with other streaming-AI builders.
Issues & RFCs
Propose stages, report edge cases, and shape the roadmap through open design notes.
Recipes
Community-maintained patterns for common frameworks and runtimes, kept in the open repo.
Contributing #
New stages, adapters, docs fixes, and recipes are all welcome.
- Fork and branch.
Grab the repo, create a feature branch, and run the test suite locally.
- Keep stages small.
One responsibility per stage, with a focused test that proves it in isolation.
- Open a PR.
Describe the change, link any discussion or RFC, and a maintainer will review in the open.
FAQ #
Common questions about the toolkit and the project.
Is JinnFlux Community free and open source?
Yes. The toolkit and documentation are open source under a permissive license, and the project is developed in public with community contributions.
Which runtimes and frameworks does it support?
The core is framework-agnostic and ships thin adapters. It targets standard web streams and async iterators, so it fits most modern server runtimes and client frameworks.
Do I have to choose SSE or WebSocket up front?
No. Pipelines are defined independently of the transport; the encoder stage at the edge decides, and you can switch later with a one-line change.
Is it tied to a specific model or provider?
No. Any streaming source can be adapted into a normalized delta stream, so the rest of your pipeline stays provider-neutral.
How do I get help?
Start with the quickstart and core concepts above, then open a discussion or issue in the community repo.