Skip to content

Add Deepgram Flux STT service for AWS SageMaker#4143

Merged
filipi87 merged 7 commits intomainfrom
cb/sagemaker-flux
Mar 27, 2026
Merged

Add Deepgram Flux STT service for AWS SageMaker#4143
filipi87 merged 7 commits intomainfrom
cb/sagemaker-flux

Conversation

@chadbailey59
Copy link
Copy Markdown
Contributor

@chadbailey59 chadbailey59 commented Mar 25, 2026

I (well, Claude) basically combined the existing DeepgramSageMakerSTTService and DeepgramFluxService to make a DeepgramFluxSageMakerSTTService. I ran the included new example, and everything worked as it should. There weren't any existing automated tests for Deepgram Flux, and it's additionally impractical to run tests on these SageMaker services because of setup and teardown.

Summary

  • Adds DeepgramFluxSageMakerSTTService that combines SageMaker's HTTP/2 bidirectional transport (SageMakerBidiClient) with Deepgram Flux's JSON turn detection protocol
  • Supports advanced turn events: StartOfTurn, EndOfTurn, EagerEndOfTurn, TurnResumed
  • Includes mid-stream Configure support for updatable fields (keyterm, eot_threshold, eager_eot_threshold, eot_timeout_ms)
  • Adds silence watchdog to prevent dangling turns when audio stops flowing
  • Adds example bot (07c-interruptible-deepgram-flux-sagemaker.py) using Flux STT + SageMaker TTS + AWS Bedrock LLM with ExternalUserTurnStrategies

Test plan

  • Verified import resolves: from pipecat.services.deepgram.sagemaker.flux_stt import DeepgramFluxSageMakerSTTService
  • Passed ruff check and ruff format --check
  • Existing tests pass (uv run pytest tests/ -x)
  • Tested end-to-end with SageMaker Flux endpoint via Daily transport

🤖 Generated with Claude Code

Add DeepgramFluxSageMakerSTTService that combines SageMaker's HTTP/2
transport with Flux's JSON turn detection protocol (StartOfTurn,
EndOfTurn, EagerEndOfTurn, TurnResumed). Includes mid-stream Configure
support, silence watchdog, and an example bot.
@codecov
Copy link
Copy Markdown

codecov bot commented Mar 25, 2026

Codecov Report

❌ Patch coverage is 36.46724% with 223 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
src/pipecat/services/deepgram/flux/base.py 35.10% 159 Missing ⚠️
...rc/pipecat/services/deepgram/flux/sagemaker/stt.py 34.83% 58 Missing ⚠️
src/pipecat/services/deepgram/flux/stt.py 64.70% 6 Missing ⚠️
Files with missing lines Coverage Δ
src/pipecat/services/deepgram/flux/stt.py 32.85% <64.70%> (+3.03%) ⬆️
...rc/pipecat/services/deepgram/flux/sagemaker/stt.py 34.83% <34.83%> (ø)
src/pipecat/services/deepgram/flux/base.py 35.10% <35.10%> (ø)

... and 44 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

UserStartedSpeakingFrame,
UserStoppedSpeakingFrame,
)
from pipecat.processors.frame_processor import FrameDirection
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

nit: Unused import.

Copy link
Copy Markdown
Contributor

@filipi87 filipi87 left a comment

Choose a reason for hiding this comment

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

@chadbailey59 this works great.

As a suggestion, I have a follow-up PR where:

  • We create a base class, DeepgramFluxSTTBase, so we can reuse Deepgram Flux logic across both services.
  • We move flux_stt.py to deepgram/flux/sagemaker/stt.py.

Creating a base class, DeepgramFluxSTTBase, to reuse Deepgram Flux logic
@markbackman
Copy link
Copy Markdown
Contributor

@filipi87 is this ready to be merged now?

@filipi87
Copy link
Copy Markdown
Contributor

@filipi87 is this ready to be merged now?

Hi @markbackman, I think so. 👍

@filipi87 filipi87 merged commit fb1996c into main Mar 27, 2026
6 checks passed
@filipi87 filipi87 deleted the cb/sagemaker-flux branch March 27, 2026 14:27
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.

3 participants