Overview
SlngSTTService provides real-time speech-to-text transcription over a
persistent WebSocket connection to SLNG, a unified voice AI
gateway that routes to multiple STT providers (Deepgram, ElevenLabs, Rime,
Sarvam, and more) through a single API key. Swap the model string to switch
providers; no other code changes needed. The service emits
TranscriptionFrame and InterimTranscriptionFrame results.
Source Repository
Source code, examples, and issues for the SLNG integration
PyPI Package
The
pipecat-slng package on PyPISLNG Website
Learn about the SLNG unified voice AI gateway
SLNG Docs
Documentation for the SLNG platform
Installation
This is a community-maintained package distributed separately frompipecat-ai:
Prerequisites
SLNG Account Setup
Before using the SLNG STT service, you need:Required Environment Variables
SLNG_API_KEY: Your SLNG API key for authentication
Configuration
Authentication key for the SLNG API.
The transcription model to use. Use a
slng/... prefix for SLNG-hosted
routes, or an external route (e.g. deepgram/nova:3) proxied through SLNG.The API host (without scheme).
Audio encoding format. One of
"linear16", "mp3", or "opus".Audio sample rate in Hz. If
None, uses the pipeline sample rate.Pin requests to a specific datacenter (e.g.
ap-southeast-2, eu-north-1,
us-east-1). Sent as the X-Region-Override header.Constrain routing to a broad geographic zone (
ap, eu, or na). Sent as
the X-World-Part-Override header. If region_override is also set, it wins.Your own upstream provider API key (BYOK). Sent as the
X-Slng-Provider-Key
header so the provider bills your account directly. Only supported on external
catalog routes (no slng/ prefix); SLNG-hosted slng/... routes reject it
with a 400. See the BYOK docs.Recognition language. Defaults to
Language.EN when not given.Enable server-side VAD. Defaults to
True when not given.Stream partial (interim) transcripts. Defaults to
True when not given.Runtime-updatable settings override, merged on top of the explicit kwargs
above. See Settings below.
Settings
Runtime-configurable settings passed via thesettings constructor argument
using SlngSTTService.Settings(...). The settings dataclass extends Pipecat’s
STTSettings.
| Parameter | Type | Default | Description |
|---|---|---|---|
model | str | "slng/deepgram/nova:3-en" | The transcription model to use. |
language | Language | Language.EN | Language for speech recognition. |
enable_vad | bool | True | Whether to enable server-side VAD. |
enable_partials | bool | True | Whether to receive partial (interim) transcripts. |
When the provider surfaces a confidence score, transcripts below 0.5 are
dropped. Changing
language mid-session reconnects the WebSocket to re-run
the init handshake. See the source
repository for the authoritative,
up-to-date list.