Favicon of FastRTC

FastRTC

A Python library connects live audio and video to your code through WebRTC or WebSockets, with voice turn taking and Gradio or FastAPI integration.

FastRTC is a Python library for developers building voice assistants, webcam AI apps, and other interactive audio or video tools. It connects live media streams to Python functions so developers can focus on how their application responds.

  • Audio and video streaming: Send and receive audio or webcam video through WebRTC or WebSockets, including combined audio and video conversations.
  • Voice turn taking: Built-in voice activity and pause detection let an assistant respond when the speaker stops, with optional text-to-speech support.
  • Browser interfaces: Use the included Gradio interface to test and share an app, or connect a custom frontend through FastAPI.
  • AI backends: Build around your own processing code, with examples covering Whisper transcription, YOLOv10 object detection, Kyutai Moshi, and cloud conversations through Gemini, OpenAI, or Claude.
  • Telephone access: Call an audio application through a temporary phone number; this feature requires a Hugging Face token and an external telephone connection.

FastRTC is free and open source under the MIT license. Its Python backend can run on your own machine or a self-hosted server, with a browser interface for audio and video. Where media goes depends on the backend you choose: integrations with Gemini, OpenAI, Anthropic, or hosted speech services send the relevant audio, video, or text to those providers and require internet access.

Similar to FastRTC