From c17e61089cb6a55ab354b44566c1c4a6731328e6 Mon Sep 17 00:00:00 2001 From: Mark Backman Date: Mon, 2 Mar 2026 21:48:19 -0500 Subject: [PATCH] Add placeholder for TTFS meaturement --- src/pipecat/services/stt_latency.py | 1 + src/pipecat/services/together/stt.py | 5 +++++ 2 files changed, 6 insertions(+) diff --git a/src/pipecat/services/stt_latency.py b/src/pipecat/services/stt_latency.py index 351e041a6..5dbccc348 100644 --- a/src/pipecat/services/stt_latency.py +++ b/src/pipecat/services/stt_latency.py @@ -46,6 +46,7 @@ SAMBANOVA_TTFS_P99: float = 2.20 SARVAM_TTFS_P99: float = 1.17 SONIOX_TTFS_P99: float = 0.35 SPEECHMATICS_TTFS_P99: float = 0.74 +TOGETHER_TTFS_P99: float = 1.00 # These services run locally and should be replaced with measured values NVIDIA_TTFS_P99: float = DEFAULT_TTFS_P99 diff --git a/src/pipecat/services/together/stt.py b/src/pipecat/services/together/stt.py index 9399ac403..c1ee056f7 100644 --- a/src/pipecat/services/together/stt.py +++ b/src/pipecat/services/together/stt.py @@ -14,6 +14,7 @@ from typing import AsyncGenerator, Optional from loguru import logger from pipecat.services.settings import STTSettings +from pipecat.services.stt_latency import TOGETHER_TTFS_P99 try: from websockets.asyncio.client import connect as websocket_connect @@ -70,6 +71,7 @@ class TogetherSTTService(WebsocketSTTService): language: Language = Language.EN, sample_rate: int = 16000, base_url: str = "wss://api.together.xyz/v1", + ttfs_p99_latency: float = TOGETHER_TTFS_P99, **kwargs, ): """Initialize the Together AI STT service. @@ -80,10 +82,13 @@ class TogetherSTTService(WebsocketSTTService): language: Language of the audio input. Defaults to English. sample_rate: Audio sample rate (default: 16000). Together AI requires 16kHz input. base_url: The URL of the Together AI WebSocket API. + ttfs_p99_latency: P99 latency from speech end to final transcript in seconds. + Override for your deployment. See https://github.com/pipecat-ai/stt-benchmark **kwargs: Additional arguments passed to the parent WebsocketSTTService. """ super().__init__( sample_rate=sample_rate, + ttfs_p99_latency=ttfs_p99_latency, settings=TogetherSTTSettings( model=model, language=language,