← Back to Leaderboard
Fgradio-app

gradio-app/fastrtc

A Python framework for streaming audio and video over WebRTC and WebSocket

Engineering Health (Methodology)
A · 76/100
Maintenance Activity
● Updated 1mo ago
Latest Release
0.0.34
Commercial License Check
MIT · Commercial Friendly

Automated SPDX check for reference only — not legal advice. Disclaimer

Maintenance26/35
Fork Adoption19/25
Release Cadence11/20
License Clarity20/20
Self-Hosted
Total Stars
★ 4,642
24h Growth
+0
7d Growth
+1
Forks
441

GitHub Star History

Full-history star trajectory from GitHub official history. Switch ranges or hover any point for exact counts.

gradio-app/fastrtc Star History (2024-09-24 - 2026-12-03) ALL-TIME STAR HISTORY (2024-09 – 2026-12) +4.6k in 800d · avg +6/day 4.9k 2.5k 0 2024-09-24: ★ 12024-11-16: ★ 472025-01-04: ★ 1392025-02-22: ★ 2002025-04-12: ★ 3,3922025-05-31: ★ 3,8792025-07-19: ★ 4,0422025-09-06: ★ 4,1822025-10-25: ★ 4,2872025-12-13: ★ 4,3742026-01-31: ★ 4,4442026-03-21: ★ 4,4972026-05-09: ★ 4,5372026-06-27: ★ 4,5802026-08-15: ★ 4,6002026-10-03: ★ 4,6162026-12-03: ★ 4,642 ★ 4.6k 2024-09 2025-10 2026-12

Evidence-Backed Technical Brief

AI Deep Review

Architecture & Core Mechanics

FastRTC is a Python media framework, with the application boundary at Stream(handler=..., modality=..., mode=...). In the bidirectional examples, webcam frames go to a Python callback that returns processed frames, while an audio handler can yield chunks as (sample_rate, ndarray) tuples. ReplyOnPause wraps the audio reply handler to invoke it on a detected pause, separating turn detection from application logic.

The repository separates backend/ and frontend/, with demo/, docs/, and test/ alongside them. The Python manifest includes aiortc and aioice for WebRTC and ICE, Gradio for the built-in UI, and NumPy, librosa, and Numba in the runtime dependency set. The same Stream abstraction supports either a built-in UI via .ui.launch() or FastAPI-mounted WebRTC and WebSocket endpoints via .mount(app). Model calls and application-specific processing live in the handler rather than the transport configuration.

Key Capabilities & Differentiators

The practical range runs from echo audio and NumPy webcam transforms to real-time Whisper transcription and YOLOv10 detection on browser webcam frames. The webcam detection example passes a Gradio slider value into the frame handler as a confidence threshold, illustrating how UI parameters can affect processing without changing the media transport.

For voice, one example composes Groq-hosted Whisper transcription, Claude 3.5 Haiku, and ElevenLabs streaming TTS, turning pcm_24000 output into 24 kHz 16-bit NumPy chunks. That example streams synthesized audio back but waits for transcription and the text reply before synthesis. Other demos illustrate Gemini audio/video chat, Gemini and OpenAI real-time voice APIs, and Kyutai Moshi. These are integration examples, not evidence that their models or client SDKs ship with the base package. For audio-only testing by phone, .fastphone() can obtain a temporary number with a Hugging Face token.

Trade-offs & Limitations

Compared with integrating aiortc and FastAPI directly, FastRTC saves work where media callbacks, pause-triggered replies, and a test UI match the application. The abstraction is less compelling when a team already owns its media stack or needs tighter control of session behavior. Compared with a managed real-time communications platform, the self-hosted path gives the team control of the Python service but leaves it responsible for connectivity, authentication, and capacity planning. Test WebRTC across the actual client networks, including whether they need a relay.

Inference placement is a separate decision. Hosted APIs avoid running those models locally but introduce network dependencies, provider limits and costs, and external data handling. Local inference avoids that dependency only if the entire model path is local, and sizing then depends on model choice and concurrency. For a chained voice application, measure end-of-turn to first returned audio, not just transport latency: pause detection, transcription, text generation, and synthesis can each contribute.

Hardware & Deployment Guide

Install fastrtc on Python 3.10 or newer, or install fastrtc[vad, tts] for built-in pause detection and TTS. Gradio is constrained to >=4.0,<6.0. On Python 3.13 and later the manifest conditionally adds audioop-lts, standard-aifc, and standard-sunau. Use .ui.launch() for a quick functional check or mount the stream on a FastAPI app for a custom frontend; the serving example uses uvicorn app:app --host 0.0.0.0 --port 8000.

Self-hosting the Python service does not make cloud-backed examples offline. A restricted network deployment must separately provision local inference and model files, and validate client connectivity. Release 0.0.34 added configurable OpenAPI tags for mounted endpoints and moved some print output to logging; 0.0.33 addressed Gradio Lite compatibility for versions before 5.46.0, and 0.0.32 fixed an async client instance reuse bug.

Media handlers: Stream wraps a Python frame callback or an audio generator; the audio examples pass (sample_rate, ndarray) tuples.
Speech turn handling: ReplyOnPause invokes reply logic on a detected pause; built-in pause detection and TTS use the vad and tts extras, respectively.
Frontend integration: Launch the built-in Gradio UI with .ui.launch() or mount WebRTC and WebSocket endpoints on FastAPI with .mount(app).
Model integration: Examples span Whisper transcription, YOLOv10 webcam detection, Kyutai Moshi, and hosted Gemini and OpenAI real-time voice APIs.
Telephone testing: .fastphone() provides a free temporary number for audio-only streams and requires a Hugging Face token.
Runtime boundaries: Python 3.10+, Gradio >=4.0,<6.0, aiortc, and aioice >=0.10.1; the manifest adds audio compatibility dependencies for Python 3.13+.
Best For

Python teams that want to validate a voice agent, browser transcription, or live webcam inference in Gradio, then integrate the same media handler into a FastAPI service.

Skip If

You need a managed communications service, production telephony rather than a temporary test number, or direct control over the lower-level media stack.

Reviewed on 2026-12-02 · Grounded in GitHub README, root file tree & releasesMethodology

Quick Start & Installation

Self-Hosted
pip install fastrtc

Comparison vs. Top Voice, Vision & Video Alternatives

Full comparison →
RepositoryStars7d TrendStackLicenseCore Positioning
fastrtc ★4.6k+1JavaScriptMITA Python framework for streaming audio and video over WebRTC and WebSocket
mlx-audio8.4k+32PythonMITMLX inference SDK for local speech and audio pipelines on Apple Silicon
whisperX26.5k+677PythonBSD-2-ClauseBatched Whisper with forced alignment for word timings and optional speaker labe
RealtimeSTT10.3k+11PythonApache-2.0Local streaming speech-to-text: a Python SDK and FastAPI service for low-latency

AI Context Briefing (for Claude / Cursor / Windsurf)

Standardized architecture summary & quickstart commands ready to paste into coding agents.

Raw .md ↗
curl -sL https://repoforai.com/repo/gradio-app/fastrtc.md

Embed Star History Chart & Badges in README.md

Full-history Star History SVGs and velocity cards on GitHub Camo: drop-in replacement for OSSInsight and Star History widgets.

gradio-app/fastrtc Star History on RepoForAI

Active README embeds unlock Hot-Tier 6h Telemetry Refresh automatically (zero pay-to-rank).

Frequently Asked Questions about fastrtc

Can I reuse the same stream in a Gradio demo and an existing FastAPI service?

Put media-processing logic in a Stream handler and call stream.mount(app) on the FastAPI app. Mounting exposes WebRTC and WebSocket endpoints; your frontend still has to use the chosen transport and manage its connection. Use stream.ui.launch() to test the handler before integrating a custom client.

Do I need a GPU, and what should I load-test?

The core package declares no GPU or CUDA requirement. Start by testing transport and media processing on CPU, then size for simultaneous sessions and the work each handler performs. Local inference may require a GPU depending on the model; calling a hosted model removes local inference from the sizing equation, not the cost of running the media sessions.

Can I self-host FastRTC commercially and keep media in my environment?

FastRTC's MIT license permits commercial self-hosting, subject to preservation of the required copyright and license notices. Review dependency and model licenses separately. If you use hosted inference or temporary telephony, also review provider terms and verify where audio, video, and transcripts are processed.

When is FastRTC a better fit than building directly on aiortc?

Choose FastRTC when Python handlers, pause-triggered replies, and a ready-to-use browser UI remove work you would otherwise do with aiortc and FastAPI. Choose direct primitives if your team already owns the media stack or needs lower-level session control. Evaluate a managed real-time communications platform if outsourced connectivity and operations are the priority.

Upstream README & Documentation

This profile focuses on independent engineering analysis and live telemetry. Read the full upstream README, changelog, and examples directly on GitHub.

Maintaining gradio-app/fastrtc? Pin to Homepage + competitor /alternatives pages with a custom Cloud/Demo CTA.Feature gradio-app/fastrtc on Homepage & Alternatives ($19)
WEEKLY BREAKOUT DIGEST

Top 10 Breakout Open-Source AI Repos, Every Thursday

Signal-only digest of fast-growing AI repos, SPDX license alerts, and architecture picks. Zero spam.

Zero spam · 1-click unsubscribe · Privacy Policy

Saved in your browser · Export Markdown RFC tables or jump into /vs compare