agreeable-forest-33528
12/11/2025, 7:50 AMtall-airline-16756
12/11/2025, 7:50 AMtall-airline-16756
12/11/2025, 7:51 AMGOOGLE_APPLICATION_CREDENTIALS env var at runtime to point to a credentials file path the plugin reads.
• Mount credential JSON as a secret (e.g., with --secret-mount) so the plugin reads /etc/secret/<file> at startup or when updated.
• Inject credentials directly into plugin config (pass the JSON or credentials_info-style object) and have the plugin load them programmatically.
• For Gemini/LLM plugins, set vertexai=True and provide `project`/`location` dynamically alongside one of the above credential methods.
Which deployment are you using (local agent, LiveKit Cloud, or Kubernetes)? I can provide the exact config or code snippet for that environment.
Sources: Google Cloud STT plugin guide | LiveKit Docs | Gemini TTS plugin guide | LiveKit Docs | Gemini Live API plugin | LiveKit docs | Secrets management | LiveKit docs | Egress output types | LiveKit docsagreeable-forest-33528
12/11/2025, 7:52 AMtall-airline-16756
12/11/2025, 7:52 AMcredentials_info isn't a universal parameter across all plugins. It appears in some Google Cloud plugin configs (for example certain STT integrations) as a way to pass service-account JSON directly, but not every plugin exposes that exact name.
To help precisely:
• Which plugin are you using (Gemini/LLM, Vertex/LLM wrapper, STT, etc.)?
• Where are you running it (local agent, LiveKit Cloud, Kubernetes)?
Once you tell me that, I’ll show the exact config or a short code snippet for passing credentials (env var, secret mount, or direct JSON injection) for your environment.agreeable-forest-33528
12/11/2025, 7:53 AMtall-airline-16756
12/11/2025, 7:54 AMcredentials_info dict for Vertex AI in this plugin. Use one of these supported methods to load credentials dynamically:
• Set GOOGLE_APPLICATION_CREDENTIALS to the JSON key file path the agent can read:
export GOOGLE_APPLICATION_CREDENTIALS=/path/to/service-account.json
• Mount the key as a file secret (recommended on LiveKit Cloud) and point the env var to the mounted path:
a. Upload/mount the file (e.g., via lk agent update-secrets --secret-mount ./service-account-key.json).
b. Inside the agent container set:
GOOGLE_APPLICATION_CREDENTIALS=/etc/secret/service-account-key.json
• Ensure you set vertexai=True and pass `project`/`location` in your plugin config if needed:
llm = google.LLM(
model="gemini-2.0-flash-exp",
vertexai=True,
project="my-gcp-project",
location="us-central1",
)
If you tell me where you’re deploying (local agent, LiveKit Cloud, or Kubernetes) I’ll provide the exact command/config snippet for that environment.
Sources: Google Gemini LLM plugin guide | LiveKit Docs | Secrets management | LiveKit docs | Google Cloud STT plugin guide | LiveKit Docs | Google Cloud TTS integration guide | LiveKit Docs | Gemini Live API plugin | LiveKit docsagreeable-forest-33528
12/11/2025, 7:55 AMtall-airline-16756
12/11/2025, 7:55 AMGOOGLE_APPLICATION_CREDENTIALS pointing to a service-account JSON file, or
• a file-mounted secret (recommended on LiveKit Cloud) and set GOOGLE_APPLICATION_CREDENTIALS to the mounted path.
If you tell me where you’re deploying (local agent, LiveKit Cloud, or Kubernetes), I’ll give the exact command or config snippet for that environment.agreeable-forest-33528
12/11/2025, 2:22 PMtall-airline-16756
12/11/2025, 2:22 PMagreeable-forest-33528
12/11/2025, 2:37 PMtall-airline-16756
12/11/2025, 2:37 PMagreeable-forest-33528
12/11/2025, 2:37 PMtall-airline-16756
12/11/2025, 2:38 PMfrom livekit.agents import AgentSession
from livekit.plugins import google
from google.genai.types import Modality
session = AgentSession(
llm=google.realtime.RealtimeModel(
model="gemini-2.5-flash-native-audio-preview-09-2025",
modalities=[Modality.TEXT], # text-only output from realtime model
instructions="You are a helpful realtime assistant."
),
# LiveKit Inference TTS identifier for Cartesia voice
tts="cartesia/sonic-3:VOICE_ID"
)
# start the session / attach to room per your application flow
session.start()
Node.js (Gemini Live → Cartesia TTS)
import { AgentSession } from "@livekit/agents";
import * as google from "@livekit/agents-plugin-google";
import { Modality } from "@google/genai-types";
const session = new AgentSession({
llm: new google.realtime.RealtimeModel({
model: "gemini-2.5-flash-native-audio-preview-09-2025",
modalities: [Modality.TEXT], // text-only output
instructions: "You are a helpful realtime assistant."
}),
tts: "cartesia/sonic-3:VOICE_ID"
});
// start the session / attach to room per your application flow
await session.start();
Notes
• Replace VOICE_ID with the Cartesia voice ID you want.
• Using text-only modality routes Gemini’s understanding to a separate TTS so you control voice, latency, and SSML.
• For Gemini Live authentication:
◦ Use Vertex service account via GOOGLE_APPLICATION_CREDENTIALS (file mount) for Vertex AI, or the Gemini API key method if using Gemini API — tell me which and I’ll provide exact env var/secret commands.
• If you want inline code that forwards realtime transcripts to the TTS call or an example with audio playback wiring into LiveKit room output, tell me which TTS provider (Cartesia, Google Cloud TTS, ElevenLabs, etc.) and your deployment (local / LiveKit Cloud / Kubernetes) and I’ll return a runnable snippet with auth and secret-mount details. Sources: Gemini Live API plugin | LiveKit docs | Realtime model plugins | LiveKit Docstall-airline-16756
12/11/2025, 2:47 PMRealtimeModel)
• The code/snippet that feeds audio or other input into the session (how you start the session, any calls to session.start(), agent.say(), or manual frame injection)
• Which auth method you’re using (Gemini API key via GOOGLE_API_KEY or Vertex service account via GOOGLE_APPLICATION_CREDENTIALS)
• Deployment (local, LiveKit Cloud, or Kubernetes) and whether you’re using a separate STT/VAD layer
Quick checks you can run now:
• Ensure RealtimeModel is receiving only audio frames (16-bit PCM, expected sample rate/mono). Don’t pass text or JSON into the audio stream.
• If using text-only modality + external TTS, set modalities=[Modality.TEXT] so Gemini doesn’t expect audio output.
• Turn on debug logging to inspect outgoing WS frames:
import logging
logging.basicConfig(level=logging.DEBUG)
• Confirm you are not calling agent.say() or otherwise injecting text into the audio path when using the realtime audio mode.
Send the snippets above and I’ll point out the exact line causing the invalid frame payload and a precise fix.
Sources: Gemini TTS plugin guide | LiveKit Docs | Gemini Live API plugin | LiveKit docs | Google Gemini LLM plugin guide | LiveKit Docs | Google Cloud STT plugin guide | LiveKit Docs | Google Cloud TTS integration guide | LiveKit Docstall-airline-16756
12/11/2025, 3:07 PMsession.start() or equivalent). 3) The code that publishes or forwards audio into the session (client publish / MediaStreamTrack wiring or any manual frame injection). 4) Your auth method env vars (do you set GOOGLE_API_KEY or GOOGLE_APPLICATION_CREDENTIALS?). 5) Deployment (local, LiveKit Cloud, Kubernetes) and whether you enabled transcription/VAD.
Quick checks to run now:
• Ensure only audio frames are sent to the realtime audio path (no text, JSON, or control messages).
• If the client publishes via browser, confirm the published track is a valid MediaStreamTrack and not empty/silent.
• Turn on debug logging to inspect frames:
import logging
logging.basicConfig(level=logging.DEBUG)
Send the snippets above and I’ll point out the exact line causing the invalid frame payload and the precise fix.
Sources: Gemini Live API plugin | LiveKit docs | Google Gemini LLM plugin guide | LiveKit Docs | Gemini TTS plugin guide | LiveKit Docs | Realtime model plugins | LiveKit Docs | Understanding "silence detected on local audio track" warningtall-airline-16756
12/11/2025, 3:27 PMsession.start() or equivalent)
• How audio is published/forwarded (client publish, MediaStreamTrack wiring, or manual frame injection)
• Auth env vars (GOOGLE_API_KEY vs GOOGLE_APPLICATION_CREDENTIALS) and deployment (local / LiveKit Cloud / K8s)
If you prefer, paste just the smallest failing snippet and I’ll point to the exact line to fix.