Python library for real-time communication
Top 12.0% on sourcepulse
FastRTC is a Python library designed to simplify real-time audio and video communication by enabling developers to turn any Python function into a WebRTC or WebSocket stream. It targets developers building interactive applications, voice assistants, and real-time media processing tools, offering automatic UI generation, WebRTC/WebSocket/telephone integration, and a customizable backend.
How It Works
FastRTC leverages a Stream
class that wraps user-defined Python functions, abstracting the complexities of real-time protocols like WebRTC and WebSockets. It handles media encoding/decoding, network transport, and provides optional integrations for features like pause detection, text-to-speech, and even direct telephone connectivity via temporary phone numbers. The library can automatically generate a Gradio UI for easy testing or be mounted onto a FastAPI application for custom frontends and production deployments.
Quick Start & Requirements
pip install fastrtc
pip install "fastrtc[vad, tts]"
Highlighted Details
.ui.launch()
), FastAPI integration (.mount(app)
), and direct telephone calls (.fastphone()
).Maintenance & Community
The project is associated with gradio-app
. Further community and roadmap details are not explicitly provided in the README.
Licensing & Compatibility
The README does not specify a license. Compatibility for commercial use or closed-source linking is not detailed.
Limitations & Caveats
The .fastphone()
feature requires a Hugging Face token. The README mentions "free temporary phone number," implying potential limitations or costs associated with this service. Some advanced integrations, like the Llama Code Editor, are noted as being powered by specific hardware (SambaNova systems), which may not be universally accessible.
3 days ago
1 day