Skip to content

In development. Expect rough edges and changes. The source code is not public yet.

Hugging Face 6 min read Announcement mediumAdept

FastRTC: The Real-Time Communication Library for Python

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.

Assumes: Python generatorsFastAPI basics

Related posts

  • Reachy Mini goes fully local

    Hugging Face mediumAdept

    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. The recommended stack is Silero VAD, Parakeet-TDT 0.6B v3 for STT, Qwen3-TTS, and Gemma 4 served by llama.cpp. The LLM can also run in-process via MLX or Transformers, or behind any Responses API server such as vLLM (≥0.21.0 for tool-call streaming), HF Inference Endpoints or OpenAI. LLM inference is the main latency bottleneck, so the guide recommends disabling thinking tokens and enabling multi-token prediction where the model supports it.

  • One-second voice-to-voice latency with Modal, Pipecat, and open models

    Modal mediumAdept

    A conversational voice bot on Modal reaches roughly one-second voice-to-voice latency. It uses Pipecat to orchestrate an STT → RAG → LLM → TTS pipeline with Parakeet-tdt-v3, Qwen3-4B-Instruct on vLLM, Kokoro TTS, and ChromaDB with all-MiniLM-L6-v2 retrieval. The main latency levers are running the stateful Pipecat bot on CPU while GPU services autoscale independently, using Pipecat's local VAD and SmartTurn to segment audio instead of streaming STT, and tuning vLLM for time-to-first-token. On the network side, the bot talks to services over WebSockets through Modal Tunnels that bypass the input plane, with a spawned FunctionCall session restoring autoscaling, and services are pinned to clustered regions near the user. Latency was measured by recording real conversations and diarizing them with Pyannote across region and tunnel configurations.

  • Blazingly fast whisper transcriptions with Inference Endpoints

    Hugging Face easyNovice

    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. It targets NVIDIA Ada Lovelace GPUs (L4, L40s) and gets its speedup from torch.compile JIT kernels, CUDA graphs that batch GPU kernel launches, and a float8 KV cache that halves cache memory versus bfloat16. Whisper Large V3, V3-Turbo and Distil-Whisper V3.5 were benchmarked for WER on 8 Open ASR Leaderboard datasets and for RTFx on 45+ minute rev16 audio using a single L4. Deployment is one click, and the endpoint is called through an OpenAI-style /audio/transcriptions HTTP API; a FastRTC demo shows real-time transcription.

  • Powerful ASR + diarization + speculative decoding with Hugging Face Inference Endpoints

    Hugging Face mediumAdept

    A custom inference handler on Hugging Face Inference Endpoints serves Whisper ASR, Pyannote speaker diarization and speculative decoding behind a single API endpoint. The handler is split into model settings, inference config and diarization utilities, with models chosen via Pydantic environment variables. Creating the endpoint through the API is needed to pass the HF token that diarization requires. A k6 benchmark on an A10 GPU shows distil-large-v3 as assistant model cutting latency on 8s audio from ~784ms to ~327ms but slowing 60s audio (3.48s to 4.15s). Speculative decoding requires batch size 1, so batching wins for long, chunked inputs.

  • How we built a realtime system for responsive voice AI in six months

    OpenAI mediumAdept

    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. The system separates a Go-based media fast path (replacing Python asyncio, with new p95 matching old p50) from application logic. It uses warm model-instance handoffs to perform context compaction without KV-cache rebuild pauses, prefills frontier-model sessions at call start, and derives discrete turns from overlapping speech via speculative and authoritative transcript views. Startup is cut to a single UDP packet through WARP, a set of backward-compatible WebRTC changes that reduces handshakes from six round trips to one, plus Instant Connect for pre-negotiated SDP. Shadow testing on production traffic showed that capacity depends on concurrent sessions and CPU-side stream handling, not just GPU throughput.

The quest for software engineering knowledge.

Look:
Layout: