# pradeeptalari14/tp-gemini-2-flash-live architecture

> Architecture diagram of the GitHub repository pradeeptalari14/tp-gemini-2-flash-live, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-11). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/pradeeptalari14/tp-gemini-2-flash-live
- Repository: https://github.com/pradeeptalari14/tp-gemini-2-flash-live

## Overview

This repository presents a Gemini Live multimodal streaming gateway: audio and video are ingested, video frames are rate-limited, and media payloads are prepared for a bidirectional Gemini session. The sampled Python files implement packet metadata and payload formatting, but do not show a live WebSocket connection or connect the multiplexer to the client; that relationship is documented in the README. Grounding, tool calling, interruption handling, and Kubernetes deployment are also documented capabilities, not verified here as implemented in the sampled source.

Main entry points: [`audio_video_multiplexer.py`](https://github.com/pradeeptalari14/tp-gemini-2-flash-live/blob/main/audio_video_multiplexer.py) (AV multiplexer), [`gemini_live_stream_client.py`](https://github.com/pradeeptalari14/tp-gemini-2-flash-live/blob/main/gemini_live_stream_client.py) (Live session client), [`k8s-gemini-live-gateway.yaml`](https://github.com/pradeeptalari14/tp-gemini-2-flash-live/blob/main/k8s-gemini-live-gateway.yaml) (Kubernetes gateway deployment)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_media_ingress["Media ingress"]
  node_av_multiplexer["AV multiplexer"]
end

subgraph group_stream_session["Gemini session"]
  node_live_client["Live session client"]
  node_barge_in["Barge-in handling"]
end

subgraph group_model_services["Model services"]
  node_gemini_live["Gemini Live API"]
  node_grounding["Google Search grounding"]
  node_tool_dispatch["Tool calling"]
end

subgraph group_operations["Deployment"]
  node_kubernetes["Kubernetes gateway deployment"]
end

node_edge_device(("Edge device"))
node_speaker(("Audio playback"))
node_operator(("Operator"))

node_edge_device -->|"sends media"| node_av_multiplexer
node_av_multiplexer -->|"forwards media"| node_live_client
node_live_client -->|"streams bidirectionally"| node_gemini_live
node_gemini_live -->|"uses grounding"| node_grounding
node_gemini_live -->|"dispatches tools"| node_tool_dispatch
node_gemini_live -->|"returns audio"| node_barge_in
node_barge_in -->|"interrupts playback"| node_speaker
node_operator -->|"applies deployment"| node_kubernetes

click node_av_multiplexer "https://github.com/pradeeptalari14/tp-gemini-2-flash-live/blob/main/audio_video_multiplexer.py"
click node_live_client "https://github.com/pradeeptalari14/tp-gemini-2-flash-live/blob/main/gemini_live_stream_client.py"
click node_kubernetes "https://github.com/pradeeptalari14/tp-gemini-2-flash-live/blob/main/k8s-gemini-live-gateway.yaml"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_av_multiplexer toneBlue
class node_live_client,node_barge_in toneAmber
class node_gemini_live,node_grounding,node_tool_dispatch toneMint
class node_kubernetes toneRose
class node_edge_device,node_speaker,node_operator toneIndigo
```

## Components

### Media ingress

- [AV multiplexer](https://github.com/pradeeptalari14/tp-gemini-2-flash-live/blob/main/audio_video_multiplexer.py): `audio_video_multiplexer.py`

### Gemini session

- [Live session client](https://github.com/pradeeptalari14/tp-gemini-2-flash-live/blob/main/gemini_live_stream_client.py): `gemini_live_stream_client.py`
- **Barge-in handling**

### Model services

- **Gemini Live API**
- **Google Search grounding**
- **Tool calling**

### Deployment

- [Kubernetes gateway deployment](https://github.com/pradeeptalari14/tp-gemini-2-flash-live/blob/main/k8s-gemini-live-gateway.yaml): `k8s-gemini-live-gateway.yaml`

### Other components

- **Edge device**
- **Audio playback**
- **Operator**

## Connections

- Edge device → AV multiplexer: sends media (evidence: `README.md`)
- AV multiplexer → Live session client: forwards media (evidence: `README.md`)
- Live session client → Gemini Live API: streams bidirectionally (evidence: `README.md`)
- Gemini Live API → Google Search grounding: uses grounding (evidence: `README.md`)
- Gemini Live API → Tool calling: dispatches tools (evidence: `README.md`)
- Gemini Live API → Barge-in handling: returns audio (evidence: `README.md`)
- Barge-in handling → Audio playback: interrupts playback (evidence: `README.md`)
- Operator → Kubernetes gateway deployment: applies deployment (evidence: `README.md`)
