Modal functions now support the WebSocket protocol, enabling real-time, bidirectional data transfer between clients and servers. This feature allows for persistent connections, reducing latency and facilitating real-time updates for applications. It integrates seamlessly with existing Modal functions, supporting libraries like FastAPI and automatically scaling based on input volume. Use cases include real-time streaming responses for audio and text generation, status updates on long-running task. This post demonstrates building a low-latency voice AI chatbot using Pipecat and open models, leveraging Modal's ability to autoscale independent GPU and CPU services for STT, LLM, and TTS inference, and integrating with WebSockets for real-time communication.
All Modal trails