Hacktoberfest 2026: los issues que los mantenedores marcaron para octubre, abiertos y aptos para principiantes. Explorar issues de Hacktoberfest

google: support Live Avatar video output for Gemini 3.8 Live (avatar_config, VIDEO modality)

Abierto
#7,843 1 comentario 0 reacciones 0 asignados Ver en GitHub

Los mantenedores suelen responder en 1 día

@percusser ya está trabajando en esto.

Desde el 15/10/2026.

  • #7858 de @percusser — abierto

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

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:

  1. RealtimeModel has no avatar_config option, and _build_connect_config never sets it.
  2. _handle_server_content treats every part.inline_data as 24 kHz PCM and pushes it to audio_ch. In avatar mode, inline_data holds 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=...) sets avatar_config and the VIDEO modality, and routes inline_data by mime_type. MP4 fragments are demuxed with PyAV, which livekit-agents already depends on. Decoded audio still goes through audio_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 a QueueAudioOutput as session.output.audio and runs an AvatarRunner with a VideoGenerator. The generator pairs each audio frame it receives with the video frames for the same media time, and the runner publishes both tracks through rtc.AVSynchronizer. clear_buffer() on interruption drops the queued video.
  • No changes to livekit-agents core.

Questions for maintainers before we open a PR:

  1. Is the AvatarSession in the Google plugin the shape you want, or would you rather add a generic video path to RealtimeModel generations in core?
  2. Should avatar mode be Vertex-only? Google documents it for Agent Platform, but google-genai also maps avatar_config on 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 RealtimeSession and overriding the private _build_connect_config and _handle_server_content methods. 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_data part is video/mp4. No separate PCM is sent. Audio is only inside the MP4.
  • One init segment (ftyp+moov) per session, then moof/mdat fragments: 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 interrupted and turn_complete about 1 s after speech start. The speech stopped in the stream, and the video continued as idle frames.
  • Output and input transcription work in VIDEO mode. usage_metadata.response_tokens_details reports a VIDEO modality (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
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

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de livekit/agents

Todos los issues de livekit/agents

Issues similares

Más issues de Python

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.