如何用 Modal GPU 为 LiveKit Agent 接入开源权重的视频头像
- 核心提炼:Modal 分享了在自家无服务器 GPU 上运行开源权重或自定义模型、配合 LiveKit Agent 构建音视频应用的方法。
- 频道与评分:ai-products · 质量评分 52 分 · 来源 Modal 官方工程博客
情报档案
本帖由 AOB 情报系统同步至 BBS 讨论区,欢迎在下方展开技术拆解、实测反馈与延伸讨论。
Original Full Content
Full Text2,023 charsLiveKit and their Agents SDK are a popular choice for implementing WebRTC-based audio-video applications. In this article, we share how you can use open-weights models or custom ones running on Modal alongside LiveKit agents. We’ll use BitHuman’s open weights Expression Video Avatar , voiced by Qwen3-TTS , to create a clone of Modal’s GPU Enjoyer in Residence, Charles Frye . Running a LiveKit Video Avatar with Sticky Sessions A common pattern with audio-video applications is using custom models as plug-and-play components. Increasingly so, we’ve seen users power video avatars and replace proprietary model APIs with open weights models (or self-hosted proprietary models) using Modal’s serverless GPUs . LiveKit Agents already supply an avatar interface, and we’ll use their BitHuman integration which comes prepackaged as a self-hosted GPU container . The container exposes a /launch endpoint which runs the avatar and joins the LiveKit room. For low-latency HTTP communication between the endpoint and external clients, we expose the endpoint using a Modal Server . However, the endpoint returns as soon as the avatar joins, which contends with how Servers scale by in-flight requests. Recently, we released Sticky Sessions , a first-class primitive for guaranteeing strong container affinity. This allows WebSocket connections to reconnect to the same container, where a client can start one or more sessions on a Server container. I.e., we can start and end the session from the client-side, and Modal will hold that Session’s slot on the container as if there was a running request. When a participant joins a room, the LiveKit agent starts a Sticky Session, joins the room, and calls the /launch endpoint using the session token. Cold starts are hidden by GPU snapshots , where otherwise…