FastRTC
The real-time communication library for Python that turns any function into audio and video streams over WebRTC or WebSockets.
At a Glance
Pricing
Free and open source Python library
Engagement
Available On
About FastRTC
FastRTC is a Python library that enables developers to transform any Python function into real-time audio and video streams over WebRTC or WebSockets. Built by the Gradio team, it provides a simple yet powerful interface for creating voice-enabled applications, video processing pipelines, and interactive communication tools with minimal code.
The library offers three main deployment methods: a built-in UI for testing and sharing streams, a fastphone feature for temporary phone number access, and FastAPI integration for production systems.
-
Stream Class provides the core abstraction for handling real-time communication, supporting audio, video, and combined audio-video modalities with send-receive or receive-only modes.
-
Automatic Voice Detection includes built-in pause detection and turn-taking capabilities through the ReplyOnPause handler, allowing developers to focus on response logic rather than audio processing mechanics.
-
Built-in UI launches a Gradio-powered interface with
.ui.launch()for rapid prototyping and testing of streams without building custom frontends. -
WebRTC and WebSocket Support enables mounting streams on FastAPI applications to expose endpoints for custom frontend integrations with full real-time communication capabilities.
-
Telephone Integration offers the
.fastphone()method to obtain free temporary phone numbers for calling into streams, requiring only a Hugging Face token. -
Speech-to-Text and Text-to-Speech plugins are available through optional extras (
vad,stt,tts), enabling voice-to-voice AI applications with LLM integration. -
Video Processing supports real-time video manipulation including object detection, image transformations, and webcam streaming with customizable handlers.
-
Plugin Ecosystem provides galleries for text-to-speech, speech-to-text, and turn-taking models, making it easy to swap components for different use cases.
To get started, install with pip install fastrtc and optionally add extras for voice features. Create a Stream with a handler function, then launch the UI or mount on FastAPI. The library handles WebRTC negotiation, audio chunking, and stream management automatically.

Community Discussions
Be the first to start a conversation about FastRTC
Share your experience with FastRTC, ask questions, or help others learn from your insights.
Pricing
Free Plan Available
Free and open source Python library
- Full library access
- WebRTC streaming
- WebSocket support
- Gradio UI integration
- FastAPI mounting
Capabilities
Key Features
- Real-time audio streaming over WebRTC
- Real-time video streaming over WebRTC
- WebSocket support
- Automatic voice detection and turn-taking
- Built-in Gradio UI
- FastAPI integration
- Telephone integration with temporary phone numbers
- Speech-to-text support
- Text-to-speech support
- Pause detection handlers
- Object detection support
- Customizable track constraints
- Echo cancellation configuration
- Plugin ecosystem for TTS/STT models