i am using token based agent dispatch but in livek...
# ask-ai
l
i am using token based agent dispatch but in livekit playgroun it shows agent connected true but i dont hear stt, llm or tts. why is that and how to fix it?
t
Thanks for reaching out, Computer. I'm an AI assistant and I'm here to help. Give me a moment while I research this topic.
I understand how frustrating it can be to be connected but not hear STT, LLM, or TTS working properly. This usually happens when these components aren’t set up correctly during agent initialization. Let’s walk through some steps together to get this sorted out: 1. Ensure Configuration: Please double-check that valid
stt
,
llm
, and
tts
objects are explicitly passed when you initialize the agent. For example, in JavaScript:
Copy code
const agent = new voice.Agent({
  stt: new deepgram.STT(),
  llm: new openai.LLM(),
  tts: new cartesia.TTS(),
  instructions: "You are a helpful assistant."
});
1. Await Model Loading: If you’re using asynchronous model loading (like
silero.VAD.load()
), make sure to await it before passing it to the agent. 2. Check Logs: Keep an eye out for warnings such as "turnDetection is set to 'stt', but no STT model is provided," which can hint at missing components. 3. Verify Plugins: Confirm that required plugins (for example,
@livekit/agents-plugin-deepgram
) are properly imported and initialized with valid API keys. 4. Monitor Metrics: Subscribe to
metrics_collected
events to see if the STT, LLM, and TTS pipelines are being triggered as expected. If you’d like, I’m here to help you with any of these steps or answer any questions you have along the way. Sources: livekit-agents/livekit/agents/inference/__init__.py | AI Agents Framework | livekit/livekit_composite | DeepWiki | Logs, metrics, and telemetry | LiveKit Docs | examples/src/comprehensive_test.ts
l
when was token based agent dispatch was released?
t
Thanks for reaching out! While the exact release date of token-based agent dispatch in LiveKit isn’t clearly documented, I want to assure you it’s a solid feature available across many SDKs and platforms. If you’d like, I’m here to help with any details about how it works or its background—just let me know! Sources: examples/agent-dispatch/CHANGELOG.md | CHANGELOG.md | Agent dispatch | LiveKit Docs | livekit-api/CHANGELOG.md | Authentication | LiveKit Docs
l
give me a sample code to dispatch an agent using token based approach and use google cloud tts, stt and llm from google
t
I understand it can be a bit tricky, and while I couldn't find a complete sample code for token-based agent dispatch using Google Cloud TTS, STT, and LLM, I'm here to help guide you through the setup. Here's a simple outline to get you started: 1. First, generate a token with
RoomConfiguration
and
RoomAgentDispatch
to dispatch the agent. 2. Next, initialize Google Cloud TTS, STT, and LLM services within your agent configuration. If you’d like, feel free to share which parts you’re working on or where you’re stuck, and I’d be happy to offer more detailed support tailored just for you. Sources: Google AI and LiveKit | LiveKit Docs
l
but why does it show like this when run in start mode {"message": "job runner initialized", "level": "INFO", "name": "livekit.agents", "tid": 1736, "elapsed_time": 0.01, "timestamp": "2025-10-24T1133736.316023+00:00"} {"message": "job runner initialized", "level": "INFO", "name": "livekit.agents", "tid": 1736, "elapsed_time": 0.01, "timestamp": "2025-10-24T11:3{"message": "job runner initialized", "level": "INFO", "name": "livekit.agents", "tid": 1736, "elapsed_time": 0.01, "timestamp": "2025-10-24T113736.316520+00:00"} {"message": "job runner initialized", "level": "INFO", "name": "livekit.agents", "tid": 4620, "elapsed_time": 0.01, "timestamp": "2025-10-24T113736.316992+00:00"} {"message": "registered worker", "level": "INFO", "name": "livekit.agents", "id": "AW_Pnih6sx4XzUz", "url": "wss://malayalam-phbb3gx5.livekit.cloud", "region": "India South", "protocol": 16, "timestamp": "2025-10-24T113736.518756+00:00"} {"message": "worker is at full capacity, marking as unavailable", "level": "INFO", "name": "livekit.agents", "load": 0.7398, "threshold": "_WorkerEnvOption(dev_default=inf, prod_default=0.7)", "timestamp": "2025-10-24T113804.123744+00:00"} {"message": "worker is below capacity, marking as available", "level": "INFO", "name": "livekit.agents", "load": 0.6930000000000003, "threshold": "_WorkerEnvOption(dev_default=inf, prod_default=0.7)", "timestamp": "2025-10-24T113824.191326+00:00"} {"message": "worker is at full capacity, marking as unavailable", "level": "INFO", "name": "livekit.agents", "load": 0.7374000000000003, "threshold": "_WorkerEnvOption(dev_default=inf, prod_default=0.7)", "timestamp": "2025-10-24T113836.739119+00:00"} {"message": "worker is below capacity, marking as available", "level": "INFO", "name": "livekit.agents", "load": 0.6994000000000002, "threshold": "_WorkerEnvOption(dev_default=inf, prod_default=0.7)", "timestamp": "2025-10-24T113859.432764+00:00"} no agent has been connected tho
t
Thank you for reaching out! The log messages you're seeing, like "worker is at full capacity" and "worker is below capacity," are actually a normal part of how a LiveKit agent worker operates. These messages simply show that the worker is keeping an eye on its workload and letting the server know its availability, even when there aren't any active jobs at the moment. If you notice that no agent is connecting even though the worker seems available, don’t worry—this can happen for a few reasons. Here are some common causes and easy steps you can take to troubleshoot: 1. No Jobs Triggered: Double-check that rooms are being created and that the room creation requests include the agent dispatch configuration. 2. Worker Registration: Make sure the worker is properly registered with the LiveKit server. You can run
lk agent status
to see if it’s connected. 3. Agent Name or Worker Type Mismatch: Verify that the
agentName
and
workerType
exactly match what’s set in your dispatch configuration. 4. Cold Start or Scaling: If your deployment scales down to zero when idle, there might be a short delay before the worker becomes active again. 5. Job Assignment Timeout: Check that the worker is accepting jobs quickly, as any delays here might cause jobs to be reassigned or fail. To help you dig a little deeper, you can use commands like
lk agent status
and
lk agent logs
to get a clearer picture of the worker’s health and activity. Please feel free to reach out if you want me to walk you through any of these steps—I’m here to help! Sources: README.md | test/agent_test.go | Community & Support | livekit/livekit_composite | DeepWiki | Troubleshooting & Common Issues | livekit/livekit_composite | DeepWiki | Deploying to production | LiveKit Docs