Merge pull request #3697 from pipecat-ai/mb/soniox-rt-4

Update SonioxSTTService default model to stt-rt-v4
This commit is contained in:
Mark Backman
2026-02-10 09:24:39 -05:00
committed by GitHub
4 changed files with 12 additions and 4 deletions

View File

@@ -0,0 +1 @@
- Update `SonioxSTTService` to set `vad_force_turn_endpoint` to `True`. This setting disabled the turn detection logic available natively in Soniox. Instead, Soniox relies on a local VAD to finalize the transcript. This configuration meaningfully reduces the time to final segment for Soniox. With this setting enabled, Soniox outputs a transcript in ~250ms (median). Pipecat enables smart-turn detection by default using the `LocalSmartTurnAnalyzerV3`. To use the native turn detection logic in Soniox, just set `vad_force_turn_endpoint` to `False`.

View File

@@ -0,0 +1 @@
- Update `SonioxSTTService` default model to `stt-rt-v4`.

View File

@@ -24,7 +24,8 @@ from pipecat.runner.types import RunnerArguments
from pipecat.runner.utils import create_transport from pipecat.runner.utils import create_transport
from pipecat.services.cartesia.tts import CartesiaTTSService from pipecat.services.cartesia.tts import CartesiaTTSService
from pipecat.services.openai.llm import OpenAILLMService from pipecat.services.openai.llm import OpenAILLMService
from pipecat.services.soniox.stt import SonioxSTTService from pipecat.services.soniox.stt import SonioxInputParams, SonioxSTTService
from pipecat.transcriptions.language import Language
from pipecat.transports.base_transport import BaseTransport, TransportParams from pipecat.transports.base_transport import BaseTransport, TransportParams
from pipecat.transports.daily.transport import DailyParams from pipecat.transports.daily.transport import DailyParams
from pipecat.transports.websocket.fastapi import FastAPIWebsocketParams from pipecat.transports.websocket.fastapi import FastAPIWebsocketParams
@@ -52,6 +53,10 @@ async def run_bot(transport: BaseTransport, runner_args: RunnerArguments):
stt = SonioxSTTService( stt = SonioxSTTService(
api_key=os.getenv("SONIOX_API_KEY"), api_key=os.getenv("SONIOX_API_KEY"),
params=SonioxInputParams(
language_hints=[Language.EN],
language_hints_strict=True,
),
) )
tts = CartesiaTTSService( tts = CartesiaTTSService(

View File

@@ -93,7 +93,7 @@ class SonioxInputParams(BaseModel):
client_reference_id: Client reference ID to use for transcription. client_reference_id: Client reference ID to use for transcription.
""" """
model: str = "stt-rt-preview" model: str = "stt-rt-v4"
audio_format: Optional[str] = "pcm_s16le" audio_format: Optional[str] = "pcm_s16le"
num_channels: Optional[int] = 1 num_channels: Optional[int] = 1
@@ -152,7 +152,7 @@ class SonioxSTTService(WebsocketSTTService):
url: str = "wss://stt-rt.soniox.com/transcribe-websocket", url: str = "wss://stt-rt.soniox.com/transcribe-websocket",
sample_rate: Optional[int] = None, sample_rate: Optional[int] = None,
params: Optional[SonioxInputParams] = None, params: Optional[SonioxInputParams] = None,
vad_force_turn_endpoint: bool = False, vad_force_turn_endpoint: bool = True,
ttfs_p99_latency: Optional[float] = SONIOX_TTFS_P99, ttfs_p99_latency: Optional[float] = SONIOX_TTFS_P99,
**kwargs, **kwargs,
): ):
@@ -164,7 +164,8 @@ class SonioxSTTService(WebsocketSTTService):
sample_rate: Audio sample rate. sample_rate: Audio sample rate.
params: Additional configuration parameters, such as language hints, context and params: Additional configuration parameters, such as language hints, context and
speaker diarization. speaker diarization.
vad_force_turn_endpoint: Listen to `VADUserStoppedSpeakingFrame` to send finalize message to Soniox. If disabled, Soniox will detect the end of the speech. vad_force_turn_endpoint: Listen to `VADUserStoppedSpeakingFrame` to send finalize message to Soniox.
If disabled, Soniox will detect the end of the speech. Defaults to True.
ttfs_p99_latency: P99 latency from speech end to final transcript in seconds. 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 Override for your deployment. See https://github.com/pipecat-ai/stt-benchmark
**kwargs: Additional arguments passed to the STTService. **kwargs: Additional arguments passed to the STTService.