Show HN: Turn any Python function into a WebRTC/WebSocket stream
fastrtc.org
WebRTC and Websockets are difficult to get right. Voice detection, turn-taking, and building test UIs all require significant effort that distracts from your core application logic.
FastRTC addresses these issues by letting you convert any Python function into a realtime WebRTC/Websocket stream with minimal code. While it's built in Python, even non-Python developers can benefit through its API endpoints and ready-to-use interfaces.
Key features:
- Transform Python functions into streaming endpoints with a few lines of code
- Built-in UI for immediate testing without frontend work
- FastAPI integration for custom frontend deployment
- Built-in utilities for on-device text-to-speech and speech-to-text to get started (Moonshine/Kokoro TTS)
Example: Creating a voice assistant in under 20 lines of code link: https://fastrtc.org/#__tabbed_1_2
For JavaScript/TypeScript developers, you can easily set up a FastRTC server in Python and connect to it from your frontend application - no need to implement complex WebRTC logic on your end.
Check out the cookbook for example applications built with Gemini Realtime API, OpenAI Realtime API, ElevenLabs and open source models: https://fastrtc.org/cookbook