Skip to content

Conversation

@adithyaxx
Copy link
Contributor

Issue

Deepgram's Python SDK produces slow TTS outputs with ~2.1s average TTFB.

Solution

Switch to direct HTTP POST requests, reducing average TTFB to ~0.8s (more than 2x faster).

@codecov
Copy link

codecov bot commented Sep 23, 2025

Codecov Report

❌ Patch coverage is 0% with 23 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
src/pipecat/services/deepgram/tts.py 0.00% 23 Missing ⚠️
Files with missing lines Coverage Δ
src/pipecat/services/deepgram/tts.py 0.00% <0.00%> (ø)
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@aconchillo
Copy link
Contributor

aconchillo commented Sep 23, 2025

Issue

Deepgram's Python SDK produces slow TTS outputs with ~2.1s average TTFB.

Solution

Switch to direct HTTP POST requests, reducing average TTFB to ~0.8s (more than 2x faster).

Wow! I don't think we'll have time to take a look at this before the upcoming release, but very interesting. I'm wondering if we are doing something wrong in our current code.

@adithyaxx
Copy link
Contributor Author

@aconchillo I feel the current implementation is correct since it follows Deepgram's documentation. However, comparing it to direct API calls shows a difference in TTFB, suggesting the additional delays are coming from Deepgram's Python SDK itself. This finding came from comparing the implementation in World’s Fastest Talking AI: Deepgram + Groq with Pipecat's implementation.

@markbackman
Copy link
Contributor

Awesome find! I implemented a version that I think is ready for production here:
#2943

If you want to take the changes from #2943 and make them here, that would be great. Alternatively, we could just close this PR, but I want you to be able to take credit for this one, if you'd like.

@markbackman
Copy link
Contributor

@adithyaxx we've taken this change but added a new DeepgramHttpTTSService class. I'm closing this PR since the new PR now have a fair amount of changes. Again, thanks so much for bringing this up!

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