Skip to content

Conversation

@KrishnaShuk
Copy link
Contributor

@KrishnaShuk KrishnaShuk commented Jan 4, 2026

Description

Implemented Deepgram STTv2 support to enable usage of the new Flux model (flux-general-en). This implementation maintains parity with the Python SDK, introducing support for turn-based transcription and preemptive generation via eagerEotThreshold.
Python Implementation : livekit/agents#3245

closes #771

Changes Made

  • Added plugins/deepgram/src/stt_v2.ts: Complete implementation of STTv2 class and SpeechStreamv2 using Deepgram's V2 WebSocket API.
  • Updated plugins/deepgram/src/index.ts: Exported STTv2 and STTv2Options.
  • Added plugins/deepgram/src/stt_v2.test.ts: Unit tests verifying streaming transcription with the Flux model.
  • Implemented TurnInfo event handling (StartOfTurn, Update, EagerEndOfTurn, EndOfTurn).
  • Added support for PREFLIGHT_TRANSCRIPT events triggered by eagerEotThreshold to enable low-latency, preemptive LLM generation.

Pre-Review Checklist

  • Build passes: All builds (lint, typecheck, tests) pass locally
  • AI-generated code reviewed: Removed unnecessary comments and ensured code quality
  • Changes explained: All changes are properly documented and justified above
  • Scope appropriate: All changes relate to the PR title, or explanations provided for why they're included
  • Video demo: A small video demo showing changes works as expected and did not break any existing functionality using Agent Playground (if applicable)

Testing

  • Automated tests added/updated (if applicable)
  • All tests pass
  • Make sure both restaurant_agent.ts and realtime_agent.ts work properly (for major changes)

Test Verification

Ran pnpm test plugins/deepgram with a valid API key.

  • stt_v2.test.ts passed (verified streaming transcription with flux-general-en).
  • stt.test.ts passed (verified no regression in existing V1 implementation).

Additional Notes

The start_time_offset is currently hardcoded to 0.0 as the base SpeechStream class in agents does not yet expose this property. This matches the current capabilities of the TypeScript SDK while enabling the new model features.

@changeset-bot
Copy link

changeset-bot bot commented Jan 4, 2026

🦋 Changeset detected

Latest commit: 997ec9d

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 16 packages
Name Type
@livekit/agents-plugin-deepgram Patch
@livekit/agents Patch
@livekit/agents-plugin-anam Patch
@livekit/agents-plugin-baseten Patch
@livekit/agents-plugin-bey Patch
@livekit/agents-plugin-cartesia Patch
@livekit/agents-plugin-elevenlabs Patch
@livekit/agents-plugin-google Patch
@livekit/agents-plugin-inworld Patch
@livekit/agents-plugin-livekit Patch
@livekit/agents-plugin-neuphonic Patch
@livekit/agents-plugin-openai Patch
@livekit/agents-plugin-resemble Patch
@livekit/agents-plugin-rime Patch
@livekit/agents-plugin-silero Patch
@livekit/agents-plugins-test Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@KrishnaShuk KrishnaShuk changed the title added deepgram flux plugin Added deepgram flux plugin Jan 4, 2026
@KrishnaShuk
Copy link
Contributor Author

PTAL @toubatbrian!

Copy link
Contributor

@toubatbrian toubatbrian left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LG! Please fix the linting issue

@KrishnaShuk
Copy link
Contributor Author

@toubatbrian done!

@toubatbrian toubatbrian merged commit b252a29 into livekit:main Jan 5, 2026
5 checks passed
@github-actions github-actions bot mentioned this pull request Jan 5, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Deepgram Flux support for STT

2 participants