🚀 Features
Streamable HTTP Protocol Specification (v1.0)
- ✅ Standardized wire format (
application/x-bfast-stream) for continuous binary streaming.
- ✅ Little-Endian length-prefixed framing with End-of-Stream (
FRAME_EOS) signaling.
- ✅ Zero-copy tensor streaming and dynamic dictionary delta updates (
FRAME_DICT_DELTA).
High-Performance Rust Streaming Core
- ✅ State-machine based stream decoder (
BFastStreamDecoder) handling network packet fragmentation in $O(1)$.
- ✅ Binary stream encoder (
BFastStreamEncoder) with optional LZ4 frame compression and DoS protection (max_frame_size).
FastAPI & Web Framework Integration
- ✅
BFastStreamingResponse supporting streaming synchronous and asynchronous generators (Generator, AsyncGenerator).
- ✅ Native chunked transfer over HTTP/1.1 and streaming DATA frames over HTTP/2 and HTTP/3.
Model Context Protocol (MCP) Integration
- ✅ Seamless integration with Model Context Protocol (MCP) Streamable HTTP transport.
- ✅ Helpers:
wrap_mcp_tool_output, stream_mcp_tool_results, stream_mcp_async_tool_results, and content negotiation via is_bfast_stream_requested.
TypeScript Client Streaming (bfast-client)
- ✅
BFastStreamDecoder supporting partial byte-chunk accumulation and framing.
- ✅
readBFastStream and decodeReadableStream for Web ReadableStream (fetch) and Node.js streams.
📦 Installation
# Python
pip install bfast-py==1.4.0
# or
uv add bfast-py
# TypeScript
npm install bfast-client@1.4.0
🔗 Links