Unlocking Real-Time Communication: Cloudflare and Hugging Face Join Forces for FastRTC Developers
In an exciting development for AI developers, Cloudflare has partnered with Hugging Face to provide instant access to enterprise-grade WebRTC infrastructure through FastRTC. This collaboration empowers developers to create robust, low-latency audio and video applications with ease, all while utilizing a Hugging Face token. To showcase the potential of this integration, check out a voice chat application built with Meta’s cutting-edge Llama 4 model!
Meeting a Gap in the Toolbox of AI Developers
As conversational AI becomes an essential interface for various tools, products, and services, the need for real-time communication infrastructure grows significantly. Hugging Face has developed FastRTC to address this need, enabling AI developers to build low-latency audio and video streams with minimal Python code. FastRTC abstracts the complexities of WebRTC—the gold standard for real-time communication—making it accessible to developers of all skill levels.
One major challenge faced by WebRTC-powered applications is the requirement for specialized TURN servers. These servers ensure reliable connections across different network environments, but setting them up can be daunting. Enter Cloudflare, which has established a global network of TURN servers across more than 335 locations worldwide. This partnership ensures that developers can create fast and reliable WebRTC applications with seamless global connectivity.
Free Access with Your Hugging Face Account
FastRTC developers can enjoy free access to the service with a valid Hugging Face Access Token. Each month, developers can stream up to 10GB of data for FREE without needing to provide a credit card. Once the monthly limit is reached, developers have the option to transition to their Cloudflare account for increased capacity. This user-friendly approach allows developers to experiment and innovate without financial barriers.
Why This Matters for AI Developers
This partnership is particularly beneficial for AI developers working on:
- Voice Assistants: Needed for reliable and low-latency audio streaming, enabling smoother interactions.
- Video Analysis Applications: These applications require the ability to process camera feeds in real-time for effective analysis.
- Multimodal AI Applications: Combining audio, video, and text to create richer user experiences.
The collaboration allows developers to focus on their core application logic using FastRTC while eliminating the headaches of building and maintaining TURN infrastructure. With Cloudflare’s managed service, developers can ensure global scalability and reliability, delivering exceptional user experiences without the overhead of infrastructure management.
Getting Started
To take advantage of this integration, developers should ensure they are using FastRTC version 0.0.20 or above. Here’s how to get started:
- Obtain a Hugging Face token with read access (get one here).
- Install or upgrade FastRTC by running:
pip install --upgrade 'fastrtc[vad]'. - Configure your Stream to utilize the Cloudflare TURN network as detailed below:
from fastrtc import ReplyOnPause, Stream, get_cloudflare_turn_credentials
import os
os.environ["HF_TOKEN"] = ""
def echo(audio):
yield audio
stream = Stream(ReplyOnPause(echo), rtc_config=get_cloudflare_turn_credentials)
stream.ui.launch()
To launch your script, simply run python in your command line.
For more examples, explore the Hugging Face Collection and the FastRTC Cookbook.
What’s Next?
If you have questions or feedback, feel free to reach out through GitHub or Hugging Face. Stay updated with the latest announcements by following Hugging Face on their platform.

