From 72803aec3f7450f3d745491dd747e1d58ef3235d Mon Sep 17 00:00:00 2001 From: royalfig Date: Fri, 5 Jun 2026 15:49:37 -0400 Subject: [PATCH 1/5] Update starter to use new turn detector model --- README.md | 2 +- package.json | 4 +--- src/main.ts | 25 +++++++++---------------- 3 files changed, 11 insertions(+), 20 deletions(-) diff --git a/README.md b/README.md index 4f828e1..08d33af 100644 --- a/README.md +++ b/README.md @@ -94,7 +94,7 @@ lk app env -w -d .env.local ## Run the agent -Before your first run, you must download certain models such as [Silero VAD](https://docs.livekit.io/agents/logic/turns/vad/) and the [LiveKit turn detector](https://docs.livekit.io/agents/logic/turns/turn-detector/): +The [LiveKit turn detector](https://docs.livekit.io/agents/logic/turns/turn-detector/) and its VAD are now built into the Agents SDK, so no model download is required before your first run. If you add a plugin that ships its own model weights (any `@livekit/agents-plugin-*` package), download them with: ```console pnpm run download-files diff --git a/package.json b/package.json index fd7af93..b2a771c 100644 --- a/package.json +++ b/package.json @@ -34,9 +34,7 @@ "vitest": "^4.1.4" }, "dependencies": { - "@livekit/agents": "^1.4.3", - "@livekit/agents-plugin-livekit": "^1.4.3", - "@livekit/agents-plugin-silero": "^1.4.3", + "@livekit/agents": "^1.5.0", "@livekit/plugins-ai-coustics": "^0.2.14", "dotenv": "^17.4.1", "zod": "^3.25.76" diff --git a/src/main.ts b/src/main.ts index a6df755..4096936 100644 --- a/src/main.ts +++ b/src/main.ts @@ -1,6 +1,4 @@ import { ServerOptions, cli, defineAgent, inference, voice } from '@livekit/agents'; -import * as livekit from '@livekit/agents-plugin-livekit'; -import * as silero from '@livekit/agents-plugin-silero'; import { audioEnhancement } from '@livekit/plugins-ai-coustics'; import dotenv from 'dotenv'; import { fileURLToPath } from 'node:url'; @@ -11,14 +9,7 @@ import { Agent } from './agent'; // when running locally or self-hosting your agent server. dotenv.config({ path: '.env.local' }); -interface ProcessUserData { - vad: silero.VAD; -} - -export default defineAgent({ - prewarm: async (proc) => { - proc.userData.vad = await silero.VAD.load(); - }, +export default defineAgent({ entry: async (ctx) => { // Set up a voice AI pipeline using OpenAI, Cartesia, Deepgram, and the LiveKit turn detector const session = new voice.AgentSession({ @@ -36,13 +27,15 @@ export default defineAgent({ voice: '9626c31c-bec5-4cca-baa8-f8ba9e84c8bc', }), - // VAD and turn detection are used to determine when the user is speaking and when the agent should respond - // See more at https://docs.livekit.io/agents/build/turns - turnDetection: new livekit.turnDetector.MultilingualModel(), - vad: ctx.proc.userData.vad, - voiceOptions: { + // Turn detection determines when the user is speaking and when the agent should respond. + // The LiveKit audio turn detector is a multimodal model that encodes the user's audio + // directly to predict end of turn. It's built into the SDK (no extra plugin) and + // AgentSession supplies the required VAD automatically. + // See more at https://docs.livekit.io/agents/logic/turns/turn-detector/ + turnHandling: { + turnDetection: new inference.AudioTurnDetector(), // Allow the LLM to generate a response while waiting for the end of turn - preemptiveGeneration: true, + preemptiveGeneration: { enabled: true }, }, }); From 5608cdea396a9de4d9027ebc8389e86f507e9aef Mon Sep 17 00:00:00 2001 From: royalfig Date: Mon, 8 Jun 2026 11:40:15 -0400 Subject: [PATCH 2/5] update method name --- src/main.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main.ts b/src/main.ts index 4096936..664a6fe 100644 --- a/src/main.ts +++ b/src/main.ts @@ -33,7 +33,7 @@ export default defineAgent({ // AgentSession supplies the required VAD automatically. // See more at https://docs.livekit.io/agents/logic/turns/turn-detector/ turnHandling: { - turnDetection: new inference.AudioTurnDetector(), + turnDetection: new inference.TurnDetector(), // Allow the LLM to generate a response while waiting for the end of turn preemptiveGeneration: { enabled: true }, }, From 2dba82e7a81b24ee90ba8a8b87a28d5c8d91911c Mon Sep 17 00:00:00 2001 From: royalfig Date: Mon, 8 Jun 2026 16:01:26 -0400 Subject: [PATCH 3/5] remove unnecessary pp --- README.md | 6 ------ 1 file changed, 6 deletions(-) diff --git a/README.md b/README.md index 08d33af..7a0aeb9 100644 --- a/README.md +++ b/README.md @@ -94,12 +94,6 @@ lk app env -w -d .env.local ## Run the agent -The [LiveKit turn detector](https://docs.livekit.io/agents/logic/turns/turn-detector/) and its VAD are now built into the Agents SDK, so no model download is required before your first run. If you add a plugin that ships its own model weights (any `@livekit/agents-plugin-*` package), download them with: - -```console -pnpm run download-files -``` - To run the agent during development, use the `dev` command: ```console From b713a99b0394b03fd305635f930f2a5adef130fb Mon Sep 17 00:00:00 2001 From: royalfig Date: Thu, 18 Jun 2026 15:11:00 -0400 Subject: [PATCH 4/5] Update starter to reflect usage with new EOT model. --- Dockerfile | 6 +++--- README.md | 2 +- taskfile.yaml | 1 - 3 files changed, 4 insertions(+), 5 deletions(-) diff --git a/Dockerfile b/Dockerfile index b92bd2e..0ffa869 100644 --- a/Dockerfile +++ b/Dockerfile @@ -43,9 +43,9 @@ COPY . . # Your package.json must contain a "build" script, such as `"build": "tsc"` RUN pnpm build -# Pre-download any ML models or files the agent needs -# This ensures the container is ready to run immediately without downloading -# dependencies at runtime, which improves startup time and reliability +# Pre-download model weights for any plugins that ship them, so they're baked into +# the image instead of fetched at runtime. Plugins like the text turn detector fetch +# their weights during this step. # Your package.json must contain a "download-files" script, such as `"download-files": "pnpm run build && node dist/agent.js download-files"` RUN pnpm download-files diff --git a/README.md b/README.md index 7a0aeb9..5d5cc0b 100644 --- a/README.md +++ b/README.md @@ -12,7 +12,7 @@ The starter project includes: - A voice AI pipeline built on [LiveKit Inference](https://docs.livekit.io/agents/models/inference) with [models](https://docs.livekit.io/agents/models) from OpenAI, Cartesia, and Deepgram. More than 50 other model providers are supported, including [Realtime models](https://docs.livekit.io/agents/models/realtime) - Eval suite based on the LiveKit Agents [testing & evaluation framework](https://docs.livekit.io/agents/start/testing) -- [LiveKit Turn Detector](https://docs.livekit.io/agents/logic/turns/turn-detector/) for contextually-aware speaker detection, with multilingual support +- [LiveKit Turn Detector](https://docs.livekit.io/agents/logic/turns/turn-detector/), an end-of-turn model that listens to the user's audio directly, combining semantic understanding with acoustic cues for state-of-the-art accuracy across 14 languages - [Background voice cancellation](https://docs.livekit.io/transport/media/noise-cancellation/) - Deep session insights from LiveKit [Agent Observability](https://docs.livekit.io/deploy/observability/) - A Dockerfile ready for [production deployment to LiveKit Cloud](https://docs.livekit.io/deploy/agents/) diff --git a/taskfile.yaml b/taskfile.yaml index 7d6f23b..fbc6b0d 100644 --- a/taskfile.yaml +++ b/taskfile.yaml @@ -15,7 +15,6 @@ tasks: - echo '' - echo '{{ indent .INDENT "cd" }} {{ .REL_PATH }}' - echo '{{ indent .INDENT "pnpm install" }}' - - echo '{{ indent .INDENT "pnpm download-files" }}' - echo '{{ indent .INDENT "pnpm dev" }}' - echo '' - task: help_open_web_console From d47fcbb89313c325f72eaf2e852d1b6282604f81 Mon Sep 17 00:00:00 2001 From: Ryan Feigenbaum <48868107+royalfig@users.noreply.github.com> Date: Thu, 18 Jun 2026 15:37:48 -0400 Subject: [PATCH 5/5] adjust version --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index b11bd08..28dd2fd 100644 --- a/package.json +++ b/package.json @@ -33,7 +33,7 @@ "vitest": "^4.1.4" }, "dependencies": { - "@livekit/agents": "^1.5.0", + "@livekit/agents": "^1.4.7", "@livekit/plugins-ai-coustics": "^0.2.14", "dotenv": "^17.4.1", "zod": "^3.25.76"