google: support Live Avatar video output for Gemini 3.8 Live (avatar_config, VIDEO modality)
Los mantenedores suelen responder en 1 día
Evaluación
- Dificultad
- 5/5
- Tiempo estimado
- Más de una semana
- Aptitud para principiantes
- 22/100
- Tipo de issue
- Nueva funcionalidad
- Claridad
- Bastante claro
- Estado de actividad
- Activo
- Stack tecnológico
- gcp, python
- Área
- ai, audio-video-rtc
Línea de trabajo
Start with the Google realtime plugin's RealtimeModel, _build_connect_config, and _handle_server_content, which currently send every inline_data part to audio_ch as PCM. The design is still open: the maintainers asked whether avatar support belongs in a plugin-level AvatarSession or in core generations, and whether it should be Vertex-only. Settle those questions in #7843 before writing code. Done would mean MP4 fragments are demuxed and routed by mime type, with unit tests covering decode, routing and interrupt flush.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
Feature Type
Would make my life easier
Feature Description
Gemini 3.8 Live on Vertex AI (Gemini Enterprise Agent Platform) went GA with Live Avatar on 2026-09-24. With response_modalities=["VIDEO"] and an avatar_config in the setup message, the model returns a lip-synced 24 FPS talking-head stream along with its speech. google-genai already ships the types (types.AvatarConfig, types.CustomizedAvatar, LiveConnectConfig.avatar_config).
livekit-plugins-google can't use it today:
RealtimeModelhas noavatar_configoption, and_build_connect_confignever sets it._handle_server_contenttreats everypart.inline_dataas 24 kHz PCM and pushes it toaudio_ch. In avatar mode,inline_dataholds fragmented MP4 (H.264 video plus AAC-LC audio), so the agent plays noise.
Proposed shape, following the in-process avatar plugins (bithuman, which uses QueueAudioOutput + AvatarRunner + a VideoGenerator):
from livekit.plugins import google
llm = google.realtime.RealtimeModel(
model="gemini-3.8-live",
vertexai=True,
voice="Puck",
avatar=google.realtime.LiveAvatarOptions(avatar_name="Ben"),
)
session = AgentSession(llm=llm)
avatar = google.realtime.AvatarSession()
await avatar.start(session, room=ctx.room)
await session.start(agent=MyAgent(), room=ctx.room)
RealtimeModel(avatar=...)setsavatar_configand theVIDEOmodality, and routesinline_databymime_type. MP4 fragments are demuxed with PyAV, whichlivekit-agentsalready depends on. Decoded audio still goes throughaudio_ch, so transcription, interruption, truncation, and metrics behave as they do today. Decoded video frames go to a per-generation video queue.AvatarSession.start()installs aQueueAudioOutputassession.output.audioand runs anAvatarRunnerwith aVideoGenerator. The generator pairs each audio frame it receives with the video frames for the same media time, and the runner publishes both tracks throughrtc.AVSynchronizer.clear_buffer()on interruption drops the queued video.- No changes to
livekit-agentscore.
Questions for maintainers before we open a PR:
- Is the
AvatarSessionin the Google plugin the shape you want, or would you rather add a generic video path toRealtimeModelgenerations in core? - Should avatar mode be Vertex-only? Google documents it for Agent Platform, but
google-genaialso mapsavatar_configon the Gemini API path. We'd raise a clear error when the API doesn't support it, rather than guess.
We're willing to implement it, add unit tests that feed recorded MP4 fragments (decode, routing, interrupt flush), and add an example under examples/.
Workarounds / Alternatives
- Subclassing
RealtimeSessionand overriding the private_build_connect_configand_handle_server_contentmethods. That breaks on any refactor of those methods. - A third-party avatar vendor (Tavus, Hedra, and others) fed by the agent's audio. That adds a second vendor and more latency, when the model already renders the avatar.
What the stream looks like
We ran two probe sessions against gemini-3.8-live on Vertex (us-central1, google-genai 2.31.0, avatar "Ben", voice "Puck"):
- Every
inline_datapart isvideo/mp4. No separate PCM is sent. Audio is only inside the MP4. - One init segment (
ftyp+moov) per session, thenmoof/mdatfragments: about 24 video fragments per second (one frame each) and about 24 AAC fragments per second, in separate fragments. - Video: H.264, 704x1280, 24 FPS, about 8.2 Mbps at default
video_bitrate_bps. Audio: AAC-LC, 24 kHz mono, 128 kbps. - The stream is continuous and server-paced in real time for the whole session. While the model is listening it sends idle frames with silent audio, and there is no new init segment per turn.
- Interruption is handled by the server. Barging in mid-sentence produced
interruptedandturn_completeabout 1 s after speech start. The speech stopped in the stream, and the video continued as idle frames. - Output and input transcription work in
VIDEOmode.usage_metadata.response_tokens_detailsreports aVIDEOmodality (about 6,200 tokens per second of speech, matching the published rate).
Because the stream is continuous rather than per generation, the generator has to emit the server's idle frames between generations and play speech frames in step with the audio that AgentSession plays. We'd like your view on keeping that sync inside the plugin's VideoGenerator.
Additional Context
- Docs: https://docs.cloud.google.com/gemini-enterprise-agent-platform/models/live-api/configure-live-avatars
- GA announcement: https://cloud.google.com/blog/products/ai-machine-learning/gemini-3-8-live-with-live-avatar-is-now-generally-available
- Related: #3237 (interrupt errors with avatar + Gemini realtime)
- Lenguaje dominante
- Python
- Estrellas
- 14.6k
- Forks
- 3.9k
- Merge medio
- 3 d 1 h
- PR fusionados (30 d)
- 173
Preparar el entorno
Este proyecto no incluye contenedor de desarrollo, Dockerfile ni guía de contribución, así que la configuración corre por tu cuenta: empieza por su README y consulta nuestra guía para la primera contribución para los pasos generales.
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de livekit/agents
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
Los mantenedores suelen responder en 1 día
-
Assistant markup is stripped from chat history when expressive mode is offPosiblemente ocupada @ShivamSharma43 la tomó hace 8 días. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
Los mantenedores suelen responder en 1 día
-
docs: openai.LLM vs openai.responses.LLM for HTTP OpenAI-compat hostsQuizá libre de nuevo @AbarnaaSree la tomó hace 47 días y no hay ningún pull request abierto. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
livekit/agents#7022 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
Dificultad 4/5 3-5 días Aptitud para principiantes 25/100
Los mantenedores suelen responder en 1 día
-
DuplexRealtimeAdapter: transcript fragment for audio that is never sent anchors the next burst, shifting transcripts by one utterancePosiblemente ocupada @dyyfk la tomó hoy. Abierto
Dificultad 4/5 3-5 días Aptitud para principiantes 45/100
Los mantenedores suelen responder en 1 día
Todos los issues de livekit/agents
Issues similares
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
huggingface/sentence-transformers#4186 ·
Los mantenedores suelen responder en 5 días
-
documentation good first issue
Dificultad 2/5 Medio día Aptitud para principiantes 72/100
sujithputta02/Esapay#13 ·
-
bot-triaged module: correctness (silent) module: mps module: NaNs and Infs triage review
Dificultad 2/5 Medio día Aptitud para principiantes 62/100
Los mantenedores suelen responder en 1 día
-
README: CI link/badge checkAbierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 62/100
SCIInstitute/SCIRun#2842 ·
Los mantenedores suelen responder en 3 días
-
bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 70/100
Los mantenedores suelen responder en 1 día