midstream
MidStream is a powerful platform that makes AI conversations smarter and more responsive. Instead of waiting for an AI to finish speaking before understanding w
What is midstream?
MidStream is a powerful platform that makes AI conversations smarter and more responsive. Instead of waiting for an AI to finish speaking before understanding what it's saying, MidStream analyzes responses as they stream in real-time—enabling instant insights, pattern detection, and intelligent decision-making.
Overview of midstream
What it is
MidStream is a Rust workspace with WASM bindings and npm shims for real-time analysis of LLM token streams. It treats an LLM token stream as a first-class signal, enabling pattern matching, scoring, and intervention while tokens are still arriving. The workspace includes six published libraries, one binary, and three npm packages, all under a consistent feature flag policy and a hard supply-chain gate.
Key features
- Inflight analysis: Pattern-match, score, and gate LLM tokens as they arrive, not after the response completes.
- 6 published Rust libraries: Each crate ships independently on crates.io with its own changelog and MSRV gate.
- WASM-first design: Every library that doesn't touch the OS compiles to wasm32-unknown-unknown with no source forks.
- Honest benchmarks: cargo bench --workspace against real workloads, not mocks.
- Hard supply-chain gate: cargo audit + cargo deny block every PR.
- Bounded backpressure: Every async channel has a bound; no unbounded mpsc.
- Secure-by-default TLS: QUIC defaults to the platform verifier; SkipServerVerification is opt-in behind an insecure- feature flag.
Use cases
MidStream is designed for applications that need real-time analysis of LLM token streams, such as inflight safety checks, intent detection, sentiment analysis, pattern detection, and intelligent decision-making. It can be used in native, browser, and edge environments via WASM. The libraries are independently useful for tasks like sequence comparison (DTW, LCS, edit distance), ultra-low-latency scheduling, dynamical-systems analysis, LTL verification with neural reasoning, self-referential meta-learning, and QUIC multi-stream transport.
Getting started
Three entry points are available:Path A — One cratebashcargo add midstreamer-temporal-comparecargo add midstreamer-schedulercargo add midstreamer-temporal-compare midstreamer-scheduler midstreamer-attractor midstreamer-neural-solver midstreamer-strange-loop midstreamer-quicPath B — Full workspacebashgit clone https://github.com/ruvnet/midstream.gitcd midstreamcargo build --workspace --releasecargo run --release --bin midstream -- --helpcargo bench --workspacePath C — WASM / browserbashnpm install @midstream/wasm``````jsimport { TemporalCompare, Scheduler } from '@midstream/wasm';const cmp = new TemporalCompare();const distance = cmp.dtw(seriesA, seriesB);
License and pricing
The license is Apache-2.0. The pricing type is open source.
Based on the project's public README and repository metadata.