FastRTC: The Real-Time Communication Library for Python

Published February 25, 2025
Update on GitHub

In the last few months, many new real-time speech models have been released and entire companies have been founded around both open and closed source models. To name a few milestones:

  • OpenAI and Google released their live multimodal APIs for ChatGPT and Gemini. OpenAI even went so far as to release a 1-800-ChatGPT phone number!
  • Kyutai released Moshi, a fully open-source audio-to-audio LLM. Alibaba released Qwen2-Audio and Fixie.ai released Ultravox - two open-source LLMs that natively understand audio.
  • ElevenLabs raised $180m in their Series C.

Despite the explosion on the model and funding side, it's still difficult to build real-time AI applications that stream audio and video, especially in Python.

  • ML engineers may not have experience with the technologies needed to build real-time applications, such as WebRTC.
  • Even code assistant tools like Cursor and Copilot struggle to write Python code that supports real-time audio/video applications. I know from experience!

That's why we're excited to announce FastRTC, the real-time communication library for Python. The library is designed to make it super easy to build real-time audio and video AI applications entirely in Python!

In this blog post, we'll walk through the basics of FastRTC by building real-time audio applications. At the end, you'll understand the core features of FastRTC:

  • 🗣️ Automatic Voice Detection and Turn Taking built-in, so you only need to worry about the logic for responding to the user.
  • 💻 Automatic UI - Built-in WebRTC-enabled Gradio UI for testing (or deploying to production!).
  • 📞 Call via Phone - Use fastphone() to get a FREE phone number to call into your audio stream (HF Token required. Increased limits for PRO accounts).
  • ⚡️ WebRTC and Websocket support.
  • 💪 Customizable - You can mount the stream to any FastAPI app so you can serve a custom UI or deploy beyond Gradio.
  • 🧰 Lots of utilities for text-to-speech, speech-to-text, stop word detection to get you started.

Let's dive in.

Getting Started

We'll start by building the "hello world" of real-time audio: echoing back what the user says. In FastRTC, this is as simple as:

from fastrtc import Stream, ReplyOnPause
import numpy as np

def echo(audio: tuple[int, np.ndarray]) -> tuple[int, np.ndarray]:
    yield audio

stream = Stream(ReplyOnPause(echo), modality="audio", mode="send-receive")
stream.ui.launch()

Let's break it down:

  • The ReplyOnPause will handle the voice detection and turn taking for you. You just have to worry about the logic for responding to the user. Any generator that returns a tuple of audio, (represented as (sample_rate, audio_data)) will work.
  • The Stream class will build a Gradio UI for you to quickly test out your stream. Once you have finished prototyping, you can deploy your Stream as a production-ready FastAPI app in a single line of code - stream.mount(app). Where app is a FastAPI app.

Here it is in action:

Leveling-Up: LLM Voice Chat

The next level is to use an LLM to respond to the user. FastRTC comes with built-in speech-to-text and text-to-speech capabilities, so working with LLMs is really easy. Let's change our echo function accordingly:

import os

from fastrtc import (ReplyOnPause, Stream, get_stt_model, get_tts_model)
from openai import OpenAI

sambanova_client = OpenAI(
    api_key=os.getenv("SAMBANOVA_API_KEY"), base_url="https://api.sambanova.ai/v1"
)
stt_model = get_stt_model()
tts_model = get_tts_model()

def echo(audio):
    prompt = stt_model.stt(audio)
    response = sambanova_client.chat.completions.create(
        model="Meta-Llama-3.2-3B-Instruct",
        messages=[{"role": "user", "content": prompt}],
        max_tokens=200,
    )
    prompt = response.choices[0].message.content
    for audio_chunk in tts_model.stream_tts_sync(prompt):
        yield audio_chunk

stream = Stream(ReplyOnPause(echo), modality="audio", mode="send-receive")
stream.ui.launch()

We're using the SambaNova API since it's fast. The get_stt_model() will fetch Moonshine Base and get_tts_model() will fetch Kokoro from the Hub, both of which have been further optimized for on-device CPU inference. But you can use any LLM/text-to-speech/speech-to-text API or even a speech-to-speech model. Bring the tools you love - FastRTC just handles the real-time communication layer.

Bonus: Call via Phone

If instead of stream.ui.launch(), you call stream.fastphone(), you'll get a free phone number to call into your stream. Note, a Hugging Face token is required. Increased limits for PRO accounts.

You'll see something like this in your terminal:

INFO:	  Your FastPhone is now live! Call +1 877-713-4471 and use code 530574 to connect to your stream.
INFO:	  You have 30:00 minutes remaining in your quota (Resetting on 2025-03-23)

You can then call the number and it will connect you to your stream!

Next Steps

  • Read the docs to learn more about the basics of FastRTC.
  • The best way to start building is by checking out the cookbook. Find out how to integrate with popular LLM providers (including OpenAI and Gemini's real-time APIs), integrate your stream with a FastAPI app and do a custom deployment, return additional data from your handler, do video processing, and more!
  • ⭐️ Star the repo and file bug and issue requests!
  • Follow the FastRTC Org on HuggingFace for updates and check out deployed examples!

Thank you for checking out FastRTC!

Community

\n\n*This podcast is generated via [ngxson/kokoro-podcast-generator](https://huggingface.co/spaces/ngxson/kokoro-podcast-generator), using [DeepSeek-R1](https://huggingface.co/deepseek-ai/DeepSeek-R1) and [Kokoro-TTS](https://huggingface.co/hexgrad/Kokoro-82M).*","html":"

📻 🎙️ Hey, I generated an AI podcast about this blog post, check it out!

\n

\n

This podcast is generated via ngxson/kokoro-podcast-generator, using DeepSeek-R1 and Kokoro-TTS.

\n","updatedAt":"2025-02-26T15:59:00.788Z","author":{"_id":"63ca214abedad7e2bf1d1517","avatarUrl":"https://cdn-avatars.huggingface.co/v1/production/uploads/1674191139776-noauth.png","fullname":"Xuan-Son Nguyen","name":"ngxson","type":"user","isPro":false,"isHf":true,"isMod":false,"followerCount":158}},"numEdits":0,"identifiedLanguage":{"language":"en","probability":0.6514900922775269},"editors":["ngxson"],"editorAvatarUrls":["https://cdn-avatars.huggingface.co/v1/production/uploads/1674191139776-noauth.png"],"reactions":[],"isReport":false}},{"id":"67bfdc8663fe3d8c3d7d3b9a","author":{"_id":"6438a7ceb2ea24b52eba68d5","avatarUrl":"/avatars/ce0de9e4ceb51f2aa4a5db12d17a6128.svg","fullname":"Albert Yu","name":"MRU4913","type":"user","isPro":false,"isHf":false,"isMod":false,"followerCount":2},"createdAt":"2025-02-27T03:31:18.000Z","type":"comment","data":{"edited":true,"hidden":false,"latest":{"raw":"Thx to all all. Great work!!!\n\nI have a question for concurrency when use tts_model and stt_model. How does each type of model handle multiple requests at the same time. (e.g. batching technique ? cpu-only threading ....) @freddyaboulton ","html":"

Thx to all all. Great work!!!

\n

I have a question for concurrency when use tts_model and stt_model. How does each type of model handle multiple requests at the same time. (e.g. batching technique ? cpu-only threading ....) \n\n@freddyaboulton\n\t

\n","updatedAt":"2025-02-28T01:56:05.730Z","author":{"_id":"6438a7ceb2ea24b52eba68d5","avatarUrl":"/avatars/ce0de9e4ceb51f2aa4a5db12d17a6128.svg","fullname":"Albert Yu","name":"MRU4913","type":"user","isPro":false,"isHf":false,"isMod":false,"followerCount":2}},"numEdits":1,"identifiedLanguage":{"language":"en","probability":0.8762436509132385},"editors":["MRU4913"],"editorAvatarUrls":["/avatars/ce0de9e4ceb51f2aa4a5db12d17a6128.svg"],"reactions":[{"reaction":"👀","users":["triaNova"],"count":1}],"isReport":false},"replies":[{"id":"67c4b368579f8be669795de9","author":{"_id":"626a9bfa03e2e2796f24ca11","avatarUrl":"https://cdn-avatars.huggingface.co/v1/production/uploads/1654278567459-626a9bfa03e2e2796f24ca11.jpeg","fullname":"Freddy Boulton","name":"freddyaboulton","type":"user","isPro":true,"isHf":true,"isMod":false,"followerCount":239},"createdAt":"2025-03-02T19:37:12.000Z","type":"comment","data":{"edited":false,"hidden":false,"latest":{"raw":"Hi @MRU4913 ! Each stream is an independent event in the event loop. But you can limit how many streams run concurrently very easily. There is a parameter in the Stream class","html":"

Hi \n\n@MRU4913\n\t ! Each stream is an independent event in the event loop. But you can limit how many streams run concurrently very easily. There is a parameter in the Stream class

\n","updatedAt":"2025-03-02T19:37:12.018Z","author":{"_id":"626a9bfa03e2e2796f24ca11","avatarUrl":"https://cdn-avatars.huggingface.co/v1/production/uploads/1654278567459-626a9bfa03e2e2796f24ca11.jpeg","fullname":"Freddy Boulton","name":"freddyaboulton","type":"user","isPro":true,"isHf":true,"isMod":false,"followerCount":239}},"numEdits":0,"identifiedLanguage":{"language":"en","probability":0.9272749423980713},"editors":["freddyaboulton"],"editorAvatarUrls":["https://cdn-avatars.huggingface.co/v1/production/uploads/1654278567459-626a9bfa03e2e2796f24ca11.jpeg"],"reactions":[],"isReport":false,"parentCommentId":"67bfdc8663fe3d8c3d7d3b9a"}},{"id":"67c549a09d1640f4ad8cfcb3","author":{"_id":"6438a7ceb2ea24b52eba68d5","avatarUrl":"/avatars/ce0de9e4ceb51f2aa4a5db12d17a6128.svg","fullname":"Albert Yu","name":"MRU4913","type":"user","isPro":false,"isHf":false,"isMod":false,"followerCount":2},"createdAt":"2025-03-03T06:18:08.000Z","type":"comment","data":{"edited":false,"hidden":false,"latest":{"raw":"Thank you for reply. I mean batching techniques, like dynamic batching ,static batching on GPU processors. For example , whisper stt run multple concurrent prompt in parallel on GPU.","html":"

Thank you for reply. I mean batching techniques, like dynamic batching ,static batching on GPU processors. For example , whisper stt run multple concurrent prompt in parallel on GPU.

\n","updatedAt":"2025-03-03T06:18:08.919Z","author":{"_id":"6438a7ceb2ea24b52eba68d5","avatarUrl":"/avatars/ce0de9e4ceb51f2aa4a5db12d17a6128.svg","fullname":"Albert Yu","name":"MRU4913","type":"user","isPro":false,"isHf":false,"isMod":false,"followerCount":2}},"numEdits":0,"identifiedLanguage":{"language":"en","probability":0.767853856086731},"editors":["MRU4913"],"editorAvatarUrls":["/avatars/ce0de9e4ceb51f2aa4a5db12d17a6128.svg"],"reactions":[],"isReport":false,"parentCommentId":"67bfdc8663fe3d8c3d7d3b9a"}},{"id":"67c5508a8029a45a33ff3741","author":{"_id":"626a9bfa03e2e2796f24ca11","avatarUrl":"https://cdn-avatars.huggingface.co/v1/production/uploads/1654278567459-626a9bfa03e2e2796f24ca11.jpeg","fullname":"Freddy Boulton","name":"freddyaboulton","type":"user","isPro":true,"isHf":true,"isMod":false,"followerCount":239},"createdAt":"2025-03-03T06:47:38.000Z","type":"comment","data":{"edited":false,"hidden":false,"latest":{"raw":"I don’t think we’d build this kind of batching into the library itself. But it would be possible for the developer to create an API that does the batching and then use that from the fastrtc stream itself.","html":"

I don’t think we’d build this kind of batching into the library itself. But it would be possible for the developer to create an API that does the batching and then use that from the fastrtc stream itself.

\n","updatedAt":"2025-03-03T06:47:38.635Z","author":{"_id":"626a9bfa03e2e2796f24ca11","avatarUrl":"https://cdn-avatars.huggingface.co/v1/production/uploads/1654278567459-626a9bfa03e2e2796f24ca11.jpeg","fullname":"Freddy Boulton","name":"freddyaboulton","type":"user","isPro":true,"isHf":true,"isMod":false,"followerCount":239}},"numEdits":0,"identifiedLanguage":{"language":"en","probability":0.9531156420707703},"editors":["freddyaboulton"],"editorAvatarUrls":["https://cdn-avatars.huggingface.co/v1/production/uploads/1654278567459-626a9bfa03e2e2796f24ca11.jpeg"],"reactions":[],"isReport":false,"parentCommentId":"67bfdc8663fe3d8c3d7d3b9a"}},{"id":"67c57787e7e54d28ef192a2f","author":{"_id":"6438a7ceb2ea24b52eba68d5","avatarUrl":"/avatars/ce0de9e4ceb51f2aa4a5db12d17a6128.svg","fullname":"Albert Yu","name":"MRU4913","type":"user","isPro":false,"isHf":false,"isMod":false,"followerCount":2},"createdAt":"2025-03-03T09:33:59.000Z","type":"comment","data":{"edited":false,"hidden":false,"latest":{"raw":"Yea, that's my question. I've read the docs and it says fastrtc supports concurrency. That's got me curious about the batching/others technique on the GPU when it processes multiple request at the same time. ","html":"

Yea, that's my question. I've read the docs and it says fastrtc supports concurrency. That's got me curious about the batching/others technique on the GPU when it processes multiple request at the same time.

\n","updatedAt":"2025-03-03T09:33:59.240Z","author":{"_id":"6438a7ceb2ea24b52eba68d5","avatarUrl":"/avatars/ce0de9e4ceb51f2aa4a5db12d17a6128.svg","fullname":"Albert Yu","name":"MRU4913","type":"user","isPro":false,"isHf":false,"isMod":false,"followerCount":2}},"numEdits":0,"identifiedLanguage":{"language":"en","probability":0.9620747566223145},"editors":["MRU4913"],"editorAvatarUrls":["/avatars/ce0de9e4ceb51f2aa4a5db12d17a6128.svg"],"reactions":[],"isReport":false,"parentCommentId":"67bfdc8663fe3d8c3d7d3b9a"}},{"id":"67c5f22aabd5c87c26eb1243","author":{"_id":"626a9bfa03e2e2796f24ca11","avatarUrl":"https://cdn-avatars.huggingface.co/v1/production/uploads/1654278567459-626a9bfa03e2e2796f24ca11.jpeg","fullname":"Freddy Boulton","name":"freddyaboulton","type":"user","isPro":true,"isHf":true,"isMod":false,"followerCount":239},"createdAt":"2025-03-03T18:17:14.000Z","type":"comment","data":{"edited":false,"hidden":false,"latest":{"raw":"Yes the docs refer to stream concurrency. We haven't built anything for hardware concurrency but it should be possible for developers to handle this themselves like I said before. Happy to add a demo for this in the repo! Let me know how I can help.","html":"

Yes the docs refer to stream concurrency. We haven't built anything for hardware concurrency but it should be possible for developers to handle this themselves like I said before. Happy to add a demo for this in the repo! Let me know how I can help.

\n","updatedAt":"2025-03-03T18:17:14.287Z","author":{"_id":"626a9bfa03e2e2796f24ca11","avatarUrl":"https://cdn-avatars.huggingface.co/v1/production/uploads/1654278567459-626a9bfa03e2e2796f24ca11.jpeg","fullname":"Freddy Boulton","name":"freddyaboulton","type":"user","isPro":true,"isHf":true,"isMod":false,"followerCount":239}},"numEdits":0,"identifiedLanguage":{"language":"en","probability":0.971263587474823},"editors":["freddyaboulton"],"editorAvatarUrls":["https://cdn-avatars.huggingface.co/v1/production/uploads/1654278567459-626a9bfa03e2e2796f24ca11.jpeg"],"reactions":[],"isReport":false,"parentCommentId":"67bfdc8663fe3d8c3d7d3b9a"}},{"id":"67c6724405e1a71d25e58d4a","author":{"_id":"6438a7ceb2ea24b52eba68d5","avatarUrl":"/avatars/ce0de9e4ceb51f2aa4a5db12d17a6128.svg","fullname":"Albert Yu","name":"MRU4913","type":"user","isPro":false,"isHf":false,"isMod":false,"followerCount":2},"createdAt":"2025-03-04T03:23:48.000Z","type":"comment","data":{"edited":false,"hidden":false,"latest":{"raw":"Thank you ~\n","html":"

Thank you ~

\n","updatedAt":"2025-03-04T03:23:48.832Z","author":{"_id":"6438a7ceb2ea24b52eba68d5","avatarUrl":"/avatars/ce0de9e4ceb51f2aa4a5db12d17a6128.svg","fullname":"Albert Yu","name":"MRU4913","type":"user","isPro":false,"isHf":false,"isMod":false,"followerCount":2}},"numEdits":0,"identifiedLanguage":{"language":"en","probability":0.47045645117759705},"editors":["MRU4913"],"editorAvatarUrls":["/avatars/ce0de9e4ceb51f2aa4a5db12d17a6128.svg"],"reactions":[],"isReport":false,"parentCommentId":"67bfdc8663fe3d8c3d7d3b9a"}}]},{"id":"67c139412b161bbc4abfd747","author":{"_id":"65823de94653431901ca9523","avatarUrl":"/avatars/4efd22c3a23bc34a1865533878f0e7b4.svg","fullname":"Nirav Madhani","name":"Nirav-Madhani","type":"user","isPro":false,"isHf":false,"isMod":false,"followerCount":1},"createdAt":"2025-02-28T04:19:13.000Z","type":"comment","data":{"edited":true,"hidden":false,"latest":{"raw":"`Taking a while to connect. Are you on a VPN?` Anyone else stuck with this error (I am not using VPN)? This only happens on Gemini examples","html":"

Taking a while to connect. Are you on a VPN? Anyone else stuck with this error (I am not using VPN)? This only happens on Gemini examples

\n","updatedAt":"2025-02-28T04:20:21.308Z","author":{"_id":"65823de94653431901ca9523","avatarUrl":"/avatars/4efd22c3a23bc34a1865533878f0e7b4.svg","fullname":"Nirav Madhani","name":"Nirav-Madhani","type":"user","isPro":false,"isHf":false,"isMod":false,"followerCount":1}},"numEdits":1,"identifiedLanguage":{"language":"en","probability":0.8316398859024048},"editors":["Nirav-Madhani"],"editorAvatarUrls":["/avatars/4efd22c3a23bc34a1865533878f0e7b4.svg"],"reactions":[],"isReport":false},"replies":[{"id":"67c4b38b929c97b1e2760673","author":{"_id":"626a9bfa03e2e2796f24ca11","avatarUrl":"https://cdn-avatars.huggingface.co/v1/production/uploads/1654278567459-626a9bfa03e2e2796f24ca11.jpeg","fullname":"Freddy Boulton","name":"freddyaboulton","type":"user","isPro":true,"isHf":true,"isMod":false,"followerCount":239},"createdAt":"2025-03-02T19:37:47.000Z","type":"comment","data":{"edited":false,"hidden":false,"latest":{"raw":"Hi @Nirav-Madhani - I am not sure. Let me see. Feel free to clone and run locally in the meantime.","html":"

Hi \n\n@Nirav-Madhani\n\t - I am not sure. Let me see. Feel free to clone and run locally in the meantime.

\n","updatedAt":"2025-03-02T19:37:47.643Z","author":{"_id":"626a9bfa03e2e2796f24ca11","avatarUrl":"https://cdn-avatars.huggingface.co/v1/production/uploads/1654278567459-626a9bfa03e2e2796f24ca11.jpeg","fullname":"Freddy Boulton","name":"freddyaboulton","type":"user","isPro":true,"isHf":true,"isMod":false,"followerCount":239}},"numEdits":0,"identifiedLanguage":{"language":"en","probability":0.9418753981590271},"editors":["freddyaboulton"],"editorAvatarUrls":["https://cdn-avatars.huggingface.co/v1/production/uploads/1654278567459-626a9bfa03e2e2796f24ca11.jpeg"],"reactions":[{"reaction":"👍","users":["Nirav-Madhani"],"count":1}],"isReport":false,"parentCommentId":"67c139412b161bbc4abfd747"}}]},{"id":"67c5396e35c65ea5c1b6b38f","author":{"_id":"67ae4f998e7be74680e2f5df","avatarUrl":"https://cdn-avatars.huggingface.co/v1/production/uploads/no-auth/tfIjlL4vkq_x78kaJqAr1.png","fullname":"ML","name":"MechanicCoder","type":"user","isPro":false,"isHf":false,"isMod":false},"createdAt":"2025-03-03T05:09:02.000Z","type":"comment","data":{"edited":false,"hidden":false,"latest":{"raw":"Would be very cool if you can also add a example with Azure OpenAI-API","html":"

Would be very cool if you can also add a example with Azure OpenAI-API

\n","updatedAt":"2025-03-03T05:09:02.490Z","author":{"_id":"67ae4f998e7be74680e2f5df","avatarUrl":"https://cdn-avatars.huggingface.co/v1/production/uploads/no-auth/tfIjlL4vkq_x78kaJqAr1.png","fullname":"ML","name":"MechanicCoder","type":"user","isPro":false,"isHf":false,"isMod":false}},"numEdits":0,"identifiedLanguage":{"language":"en","probability":0.9273416996002197},"editors":["MechanicCoder"],"editorAvatarUrls":["https://cdn-avatars.huggingface.co/v1/production/uploads/no-auth/tfIjlL4vkq_x78kaJqAr1.png"],"reactions":[],"isReport":false}},{"id":"67c54f5517ff2ccbf95b9e1f","author":{"_id":"626a9bfa03e2e2796f24ca11","avatarUrl":"https://cdn-avatars.huggingface.co/v1/production/uploads/1654278567459-626a9bfa03e2e2796f24ca11.jpeg","fullname":"Freddy Boulton","name":"freddyaboulton","type":"user","isPro":true,"isHf":true,"isMod":false,"followerCount":239},"createdAt":"2025-03-03T06:42:29.000Z","type":"comment","data":{"edited":false,"hidden":false,"latest":{"raw":"Hi @MechanicCoder - please feel free to add an example here if you’d like. It should be straightforward- take the example in this blog post and replace the LLM with the api call for the LLM on Azure you like. ","html":"

Hi \n\n@MechanicCoder\n\t - please feel free to add an example here if you’d like. It should be straightforward- take the example in this blog post and replace the LLM with the api call for the LLM on Azure you like.

\n","updatedAt":"2025-03-03T06:42:29.579Z","author":{"_id":"626a9bfa03e2e2796f24ca11","avatarUrl":"https://cdn-avatars.huggingface.co/v1/production/uploads/1654278567459-626a9bfa03e2e2796f24ca11.jpeg","fullname":"Freddy Boulton","name":"freddyaboulton","type":"user","isPro":true,"isHf":true,"isMod":false,"followerCount":239}},"numEdits":0,"identifiedLanguage":{"language":"en","probability":0.8000738024711609},"editors":["freddyaboulton"],"editorAvatarUrls":["https://cdn-avatars.huggingface.co/v1/production/uploads/1654278567459-626a9bfa03e2e2796f24ca11.jpeg"],"reactions":[],"isReport":false},"replies":[{"id":"67d276477669418056c1db7c","author":{"_id":"67ae4f998e7be74680e2f5df","avatarUrl":"https://cdn-avatars.huggingface.co/v1/production/uploads/no-auth/tfIjlL4vkq_x78kaJqAr1.png","fullname":"ML","name":"MechanicCoder","type":"user","isPro":false,"isHf":false,"isMod":false},"createdAt":"2025-03-13T06:08:07.000Z","type":"comment","data":{"edited":false,"hidden":false,"latest":{"raw":"Hey, have a working example...should I send you a repo link?","html":"

Hey, have a working example...should I send you a repo link?

\n","updatedAt":"2025-03-13T06:08:07.347Z","author":{"_id":"67ae4f998e7be74680e2f5df","avatarUrl":"https://cdn-avatars.huggingface.co/v1/production/uploads/no-auth/tfIjlL4vkq_x78kaJqAr1.png","fullname":"ML","name":"MechanicCoder","type":"user","isPro":false,"isHf":false,"isMod":false}},"numEdits":0,"identifiedLanguage":{"language":"en","probability":0.9484807848930359},"editors":["MechanicCoder"],"editorAvatarUrls":["https://cdn-avatars.huggingface.co/v1/production/uploads/no-auth/tfIjlL4vkq_x78kaJqAr1.png"],"reactions":[],"isReport":false,"parentCommentId":"67c54f5517ff2ccbf95b9e1f"}},{"id":"67d31da32942bc3138c0921c","author":{"_id":"626a9bfa03e2e2796f24ca11","avatarUrl":"https://cdn-avatars.huggingface.co/v1/production/uploads/1654278567459-626a9bfa03e2e2796f24ca11.jpeg","fullname":"Freddy Boulton","name":"freddyaboulton","type":"user","isPro":true,"isHf":true,"isMod":false,"followerCount":239},"createdAt":"2025-03-13T18:02:11.000Z","type":"comment","data":{"edited":false,"hidden":false,"latest":{"raw":"Yes, please open a PR that adds an entry for your demo! \nhttps://github.com/freddyaboulton/fastrtc/blob/main/docs/cookbook.md\n","html":"

Yes, please open a PR that adds an entry for your demo!
https://github.com/freddyaboulton/fastrtc/blob/main/docs/cookbook.md

\n","updatedAt":"2025-03-13T18:02:11.578Z","author":{"_id":"626a9bfa03e2e2796f24ca11","avatarUrl":"https://cdn-avatars.huggingface.co/v1/production/uploads/1654278567459-626a9bfa03e2e2796f24ca11.jpeg","fullname":"Freddy Boulton","name":"freddyaboulton","type":"user","isPro":true,"isHf":true,"isMod":false,"followerCount":239}},"numEdits":0,"identifiedLanguage":{"language":"en","probability":0.6691098213195801},"editors":["freddyaboulton"],"editorAvatarUrls":["https://cdn-avatars.huggingface.co/v1/production/uploads/1654278567459-626a9bfa03e2e2796f24ca11.jpeg"],"reactions":[],"isReport":false,"parentCommentId":"67c54f5517ff2ccbf95b9e1f"}}]},{"id":"67ceaed3446c69e0ef18d84d","author":{"_id":"66b2d2c258babfaeb782c221","avatarUrl":"/avatars/ad970cafaa8ea2d0b1bbbbc77f5d199a.svg","fullname":"MonkeyIn","name":"monkeyin92","type":"user","isPro":false,"isHf":false,"isMod":false},"createdAt":"2025-03-10T09:20:19.000Z","type":"comment","data":{"edited":false,"hidden":false,"latest":{"raw":"Can I connect something like FreeSWITCH and have its RTC directly parsed by fastRTC?","html":"

Can I connect something like FreeSWITCH and have its RTC directly parsed by fastRTC?

\n","updatedAt":"2025-03-10T09:20:19.475Z","author":{"_id":"66b2d2c258babfaeb782c221","avatarUrl":"/avatars/ad970cafaa8ea2d0b1bbbbc77f5d199a.svg","fullname":"MonkeyIn","name":"monkeyin92","type":"user","isPro":false,"isHf":false,"isMod":false}},"numEdits":0,"identifiedLanguage":{"language":"en","probability":0.9620184302330017},"editors":["monkeyin92"],"editorAvatarUrls":["/avatars/ad970cafaa8ea2d0b1bbbbc77f5d199a.svg"],"reactions":[],"isReport":false},"replies":[{"id":"67cf13cdd3ba7e1e80aa7249","author":{"_id":"626a9bfa03e2e2796f24ca11","avatarUrl":"https://cdn-avatars.huggingface.co/v1/production/uploads/1654278567459-626a9bfa03e2e2796f24ca11.jpeg","fullname":"Freddy Boulton","name":"freddyaboulton","type":"user","isPro":true,"isHf":true,"isMod":false,"followerCount":239},"createdAt":"2025-03-10T16:31:09.000Z","type":"comment","data":{"edited":true,"hidden":false,"latest":{"raw":"I have not tried this myself but I think so. The FastRTC server is completely open so you can integrate with any telephony/webrtc client. \n\nPlease open a PR to add a guide on how to do this: https://github.com/freddyaboulton/fastrtc/blob/main/docs/userguide/audio.md\n\nAlso feel free to join the HF discord and ask questions in the fastrtc-channels: https://discord.gg/TSWU7HyaYu","html":"

I have not tried this myself but I think so. The FastRTC server is completely open so you can integrate with any telephony/webrtc client.

\n

Please open a PR to add a guide on how to do this: https://github.com/freddyaboulton/fastrtc/blob/main/docs/userguide/audio.md

\n

Also feel free to join the HF discord and ask questions in the fastrtc-channels: https://discord.gg/TSWU7HyaYu

\n","updatedAt":"2025-03-10T16:31:18.014Z","author":{"_id":"626a9bfa03e2e2796f24ca11","avatarUrl":"https://cdn-avatars.huggingface.co/v1/production/uploads/1654278567459-626a9bfa03e2e2796f24ca11.jpeg","fullname":"Freddy Boulton","name":"freddyaboulton","type":"user","isPro":true,"isHf":true,"isMod":false,"followerCount":239}},"numEdits":1,"identifiedLanguage":{"language":"en","probability":0.789003849029541},"editors":["freddyaboulton"],"editorAvatarUrls":["https://cdn-avatars.huggingface.co/v1/production/uploads/1654278567459-626a9bfa03e2e2796f24ca11.jpeg"],"reactions":[],"isReport":false,"parentCommentId":"67ceaed3446c69e0ef18d84d"}}]}],"status":"open","isReport":false,"pinned":false,"locked":false,"collection":"canonical_blogs"},"contextAuthors":["freddyaboulton","abidlabs"],"primaryEmailConfirmed":false,"discussionRole":0,"acceptLanguages":["en","*"],"withThread":true,"cardDisplay":false}">

Wow.

Can fastphone() accept an Indian phone number?

·
Article author

We're working on getting a whatsapp number

This is amazing!

📻 🎙️ Hey, I generated an AI podcast about this blog post, check it out!

This podcast is generated via ngxson/kokoro-podcast-generator, using DeepSeek-R1 and Kokoro-TTS.

Thx to all all. Great work!!!

I have a question for concurrency when use tts_model and stt_model. How does each type of model handle multiple requests at the same time. (e.g. batching technique ? cpu-only threading ....) @freddyaboulton

·
Article author

Hi @MRU4913 ! Each stream is an independent event in the event loop. But you can limit how many streams run concurrently very easily. There is a parameter in the Stream class

Taking a while to connect. Are you on a VPN? Anyone else stuck with this error (I am not using VPN)? This only happens on Gemini examples

·
Article author

Hi @Nirav-Madhani - I am not sure. Let me see. Feel free to clone and run locally in the meantime.

Would be very cool if you can also add a example with Azure OpenAI-API

Article author

Hi @MechanicCoder - please feel free to add an example here if you’d like. It should be straightforward- take the example in this blog post and replace the LLM with the api call for the LLM on Azure you like.

·

Hey, have a working example...should I send you a repo link?

Can I connect something like FreeSWITCH and have its RTC directly parsed by fastRTC?

·

I have not tried this myself but I think so. The FastRTC server is completely open so you can integrate with any telephony/webrtc client.

Please open a PR to add a guide on how to do this: https://github.com/freddyaboulton/fastrtc/blob/main/docs/userguide/audio.md

Also feel free to join the HF discord and ask questions in the fastrtc-channels: https://discord.gg/TSWU7HyaYu

Your need to confirm your account before you can post a new comment.

Sign up or log in to comment