FastStream is an asynchronous Python framework for event-driven services that acts as a thin client for Kafka, RabbitMQ, NATS, Redis and MQTT, giving Python developers full access to native broker features alongside generated AsyncAPI documentation, in-memory tests and observability out of the box.
What it is
FastStream is an event-driven application framework written in Python and released under the Apache-2.0 licence. It occupies the same conceptual place in messaging that FastAPI occupies in HTTP: if a developer already knows FastAPI, the README argues they already know FastStream, because the same decorators, type-driven validation, dependency injection and generated documentation are pointed at Kafka, RabbitMQ, NATS, Redis and MQTT instead of at HTTP endpoints. It is catalogued here under Infrastructure & Operations / Databases, and it carries topics including asyncapi, asyncio, distributed-systems, event-driven-architecture, kafka, mqtt, nats, python, rabbitmq and redis.
The concrete problem it solves is broker boilerplate. Writing producers and consumers for message queues normally means hand-coding message parsing, consumer lifecycle management and documentation of the resulting message contracts. FastStream handles that parsing, lifecycle and documentation generation automatically, while deliberately staying a thin client: it takes the boilerplate off the developer's hands and leaves the broker itself intact, so native broker features remain reachable rather than being hidden behind an abstraction. The environment it serves is asynchronous Python running distributed, event-driven systems across five broker families.
Key capabilities
- Same-idiom development as FastAPI — decorators, type-driven validation and dependency injection applied to broker handlers rather than HTTP routes.
- First-class support for five broker families in one framework: Kafka, RabbitMQ, NATS, Redis and MQTT.
- Thin-client design that preserves full access to native broker features instead of masking them.
- Automatic AsyncAPI documentation generation from the application's message handlers.
- In-memory tests, allowing broker interactions to be exercised without a running broker.
- Observability out of the box, without separate instrumentation being wired in by the developer.
- Automatic message parsing and lifecycle handling for both producers and consumers.
Who uses it and how
- Streaming microservice teams that need producers and consumers across Kafka, RabbitMQ, NATS, Redis or MQTT and want one consistent programming model rather than one client library per broker.
- Python teams already standardised on FastAPI that want the same decorator, validation and dependency-injection style when they extend into asynchronous, event-driven services.
- Distributed-systems and event-driven-architecture projects that need AsyncAPI-format documentation to describe and govern their message contracts.
- CI and test pipelines that use the in-memory test path to verify message handling without provisioning a live broker.
Getting started
FastStream is distributed as the faststream package on PyPI, with version and supported-Python-version badges published on the project page. Documentation and getting-started material live at the project homepage, http://faststream.ag2.ai/latest/.
How it compares
The facts name no paid or proprietary products that FastStream replaces, so the fair comparison is to the tool the README itself positions it against: FastAPI. FastAPI made HTTP services declarative in Python through decorators, validation and dependency injection, and FastStream carries that same model to Kafka, RabbitMQ, NATS, Redis and MQTT. No other comparable broker framework is named in the supplied facts, so it stands largely alone against its own HTTP-shaped reference point rather than against a field of listed rivals.
When to use it — and when not to
FastStream suits teams already committed to asynchronous Python and to one or more message brokers, particularly those who want AsyncAPI documentation and in-memory tests without writing that plumbing themselves. A self-hoster still has to operate the brokers themselves — Kafka, RabbitMQ, NATS, Redis or MQTT — because FastStream is explicitly a thin client and leaves the broker intact; it is not a broker, a managed queue service or a deployment platform. Teams building only synchronous HTTP request/response services, or those unwilling to run message infrastructure, should not pick it, and anyone who needs container images, a compose file or a hosted option should note that the supplied facts name none of these: the project shows 100 open issues and its latest push is dated 2026-09-18, so active development continues but deployment guidance is not established by the facts given here.
project readme (upstream, from github) — read inline
FastStream
FastStream is an asynchronous Python framework for building event-driven applications.
If you know FastAPI, you already know FastStream: the same decorators, type-driven validation, dependency injection and generated documentation — pointed at Kafka, RabbitMQ, NATS, Redis and MQTT instead of HTTP. It takes the boilerplate off your hands and leaves your broker intact.





Features
FastStream simplifies the process of writing producers and consumers for message queues, handling all the
parsing, lifecycle and documentation generation automatically.
Making streaming microservices has never been easier. The API is small enough to onboard a teammate in an afternoon, and it never costs you access to the broker underneath — approachable and complete are not a trade-off here. Here's a look at the core features that make FastStream a go-to framework for modern, data-centric microservices.
A Spec You Never Write: a full AsyncAPI document generated from your handlers — the contract the neighbouring team keeps asking for, guaranteed to match the code, with an in-browser form for publishing test messages
Tests Without a Broker: an in-memory test client runs your subscribers and publishers with validation intact — no containers in CI, no flakes, milliseconds instead of minutes
Observable From Day One: OpenTelemetry traces, Prometheus metrics and Kubernetes probes come with the framework — a couple of middlewares instead of a few hundred lines in every service
Your Broker, In Full: FastStream is a client for your broker, not a layer above all of them — Kafka consumer groups and partitioning, RabbitMQ exchanges and DLQ, NATS JetStream and KeyValue, Redis Streams, MQTT QoS. Five first-class clients that happen to share their ergonomics.
Built-in Serialization: Leverage Pydantic or Msgspec validation capabilities to serialize and validate incoming messages
Powerful Dependency Injection System: Manage your service dependencies efficiently with FastStream's built-in DI system
Intuitive: Full-typed editor support makes your development experience smooth, catching errors before they reach runtime
Extensible: Use extensions for lifespans, custom serialization and middleware
Integrations: FastStream is fully compatible with any HTTP framework you want — including a dedicated FastAPI plugin
That is FastStream: everything a messaging service needs around your handlers, and nothing between you and your broker.
Documentation: https://faststream.ag2.ai/latest/
Table of Contents
Project History
FastStream is a package based on the ideas and experiences gained from FastKafka and Propan. By joining our forces, we picked up the best from both packages and created a unified way to write services capable of processing streamed data regardless of the underlying protocol.
Versioning Policy
FastStream has a stable public API. Only major updates may introduce breaking changes.
Prior to FastStream's 1.0 release, each minor update is considered a major and can introduce breaking changes, but these changes were communicated through two-versions deprecation warnings prior to being fully removed. So features deprecated in the 0.4 version were only removed in version 0.6.
Our team is working toward the stable 1.0 version.
Installation
FastStream works on Linux, macOS, Windows and most Unix-style operating systems.
You can install it with pip as usual:
pip install 'faststream[kafka]'
# or
pip install 'faststream[confluent]'
# or
pip install 'faststream[rabbit]'
# or
pip install 'faststream[nats]'
# or
pip install 'faststream[redis]'
# or
pip install 'faststream[mqtt]'