---
title: "FastRTC: The Real-Time Communication Library for Python"
description: "FastRTC is a Python library for building real-time audio and video AI applications over WebRTC or WebSockets without needing WebRTC expertise."
url: "https://swe.quest/articles/fastrtc-the-real-time-communication-library-for-python-e889b4f612747a64"
canonical: "https://huggingface.co/blog/fastrtc"
source: "Hugging Face"
published: "2025-02-25"
difficulty: "medium"
kind: "Announcement"
reading_minutes: 6
tags: ["speech-audio","realtime","python","llms"]
---

# FastRTC: The Real-Time Communication Library for Python

A post on [Hugging Face](https://swe.quest/sources/hugging-face.md), published 2025-02-25, 6 min read, Announcement. Original: [https://huggingface.co/blog/fastrtc](https://huggingface.co/blog/fastrtc)

## Summary

FastRTC is a Python library for building real-time audio and video AI applications over WebRTC or WebSockets without needing WebRTC expertise. A \`Stream\` wrapped around a \`ReplyOnPause\` handler provides built-in voice activity detection and turn taking, auto-generates a Gradio test UI, and can be mounted onto any FastAPI app for production. Bundled speech-to-text (Moonshine) and text-to-speech (Kokoro) models, optimized for CPU inference, let a few lines of code chain STT, an LLM and TTS into a voice chat. \`fastphone()\` exposes the stream through a free phone number with a Hugging Face token.

Written by swe.quest, not by the author.

**Difficulty:** Medium: assumes a working developer; shows how it is built or done

## Topics

- [Speech & audio](https://swe.quest/tags/speech-audio.md) (AI & ML)
- [Real-time systems](https://swe.quest/tags/realtime.md) (Backend & APIs)
- [Python](https://swe.quest/tags/python.md) (Languages)
- [LLMs](https://swe.quest/tags/llms.md) (AI & ML)

## Prerequisites

- Python generators ([easy posts on Python](https://swe.quest/tags/python.md?difficulty=easy))
- FastAPI basics

## Keywords

FastRTC, WebRTC, Gradio, FastAPI, Moonshine, Kokoro, Hugging Face, SambaNova

## Related posts

- [Reachy Mini goes fully local](https://swe.quest/articles/reachy-mini-goes-fully-local-478ea5b679c393d9.md): Hugging Face · 2026-05-27 · Medium · 10 min read · Speech & audio, Inference & serving, LLMs
  Reachy Mini's conversation app can now run entirely on local hardware using the speech-to-speech library, a cascaded VAD → STT → LLM → TTS pipeline that exposes a Realtime API-compatible /v1/realtime WebSocket.
- [One-second voice-to-voice latency with Modal, Pipecat, and open models](https://swe.quest/articles/one-second-voice-to-voice-latency-with-modal-pipecat-and-open-models-a0369eb06c4f6162.md): Modal · 2025-11-04 · Medium · 12 min read · Speech & audio, Inference & serving, Real-time systems, Performance engineering, RAG & retrieval
  A conversational voice bot on Modal reaches roughly one-second voice-to-voice latency.
- [Blazingly fast whisper transcriptions with Inference Endpoints](https://swe.quest/articles/blazingly-fast-whisper-transcriptions-with-inference-endpoints-d93b7d262c3a1210.md): Hugging Face · 2025-05-13 · Easy · 6 min read · Inference & serving, Speech & audio, Performance engineering
  Hugging Face Inference Endpoints now offers a Whisper deployment built on vLLM that delivers up to roughly 8x higher real-time factor (RTFx) than the Transformers implementation, with comparable word error rate.
- [Powerful ASR + diarization + speculative decoding with Hugging Face Inference Endpoints](https://swe.quest/articles/powerful-asr-diarization-speculative-decoding-with-hugging-face-inference-ed388c1f3bfe4f4b.md): Hugging Face · 2024-05-01 · Medium · 7 min read · Speech & audio, Inference & serving, Python
  A custom inference handler on Hugging Face Inference Endpoints serves Whisper ASR, Pyannote speaker diarization and speculative decoding behind a single API endpoint.
- [How we built a realtime system for responsive voice AI in six months](https://swe.quest/articles/how-we-built-a-realtime-system-for-responsive-voice-ai-in-six-months-00acf536a10a0c45.md): OpenAI · 2026-08-03 · Medium · 12 min read · Inference & serving, Real-time systems, Networking, Speech & audio, System design
  GPT-Live replaces turn-detector-based voice AI with a full-duplex voice model that listens and speaks simultaneously, delegating deeper reasoning and tool use to frontier models like GPT-5.5 over an asynchronous RPC path that never blocks media.

Browse: [Latest posts](https://swe.quest/index.md) · [Topics](https://swe.quest/tags.md) · [Sources](https://swe.quest/sources.md) · [Topic map](https://swe.quest/map.md) · [Site guide (llms.txt)](https://swe.quest/llms.txt)
