FastRTC: The Real-Time Communication Library for Python
Hugging Face
Hugging Face just dropped FastRTC, a Python library for building real-time voice and video AI apps. It handles the messy WebRTC plumbing so you don't have to.
Based on reporting by Hugging Face — read the original for the full story.
Summary, retelling and take written by AI under human oversight; images are AI-generated illustrations. How we work · Report an error
Real-time speech AI is having a moment. OpenAI and Google shipped live multimodal APIs, OpenAI even spun up a 1-800-ChatGPT hotline, Kyutai open-sourced Moshi, and ElevenLabs pulled in $180 million in Series C funding. Lots of models, lots of money, lots of hype. But actually wiring any of it into a working audio or video app in Python has remained a genuine headache, and even AI coding assistants like Cursor and Copilot tend to choke on the real-time plumbing.
Hugging Face's answer is FastRTC, a new library aimed squarely at that gap. The pitch is simple: handle voice detection, turn-taking, and the WebRTC/WebSocket layer automatically, so developers only write the part that actually matters — how the app responds to a user. A basic echo bot takes about five lines of code, wrapped in a ReplyOnPause function that listens for pauses in speech and triggers your logic. Hugging Face also bundles an instant Gradio UI for testing, which can later be mounted onto a full FastAPI app with a single stream.mount(app) call when you're ready to go to production.
The more interesting demo swaps the echo for an actual LLM pipeline. FastRTC ships built-in speech-to-text (Moonshine Base) and text-to-speech (Kokoro) models optimized for on-device CPU inference, plus hooks for any LLM API — the blog uses SambaNova's Llama 3.2 3B for speed. The result is a voice assistant loop: transcribe, send to the model, stream the reply back as audio, all in maybe twenty lines of Python. Notably, FastRTC doesn't care which model or provider you use; it's explicitly just the communication layer, leaving room for OpenAI's or Gemini's real-time APIs, or a full speech-to-speech model, to slot in instead.
There's also a genuinely fun bonus feature: call stream.fastphone() instead of launching the UI, and Hugging Face hands you a free phone number — an actual dial-in line connected to your stream, gated by a Hugging Face token with better quotas for Pro accounts. It's a small touch, but it turns a local prototype into something you can literally ring up from any phone, which says a lot about how far real-time infra has come in a year.
My take — AI-written commentary, not fact-checked reporting
This is Hugging Face doing what it does best: not building the flashiest model, but removing the friction between existing open models and people who want to actually ship something with them. The WebRTC layer has quietly been the bottleneck holding back a wave of voice-AI startups, and handing that infrastructure away for free is a bigger deal than another chatbot API. Watch for this becoming the default scaffolding under a lot of indie voice-app demos within a few months.
Read more about this at: Hugging Face