Skip to main content
pipecat-slng adds speech to text (STT) and text to speech (TTS) services for Pipecat. It routes your pipeline through the SLNG gateway, so any streaming model on the platform works behind one API key. Swap the model string to switch provider; no other code changes. This page is the plugin reference. For a walkthrough that sets up your models in the dashboard and applies the change, see the Pipecat integration guide.
Tested with Pipecat v1.8.0. world_part requires pipecat-slng 0.6.0 or later. Upgrading from an earlier release? See Move from base_url.

Prerequisites

Install

Quickstart

Each service reads your key via api_key and needs a world_part, the region that handles its requests. Create an STT and a TTS service and add them to your pipeline:
Both services stream over WebSocket, with low latency and mid-utterance interruption. Common runtime knobs are top-level keyword arguments (language, speed, enable_partials). For richer overrides, pass SlngSTTSettings(...) or SlngTTSSettings(...) to settings=.
A cascade pipeline (STT → LLM → TTS) using SLNG for speech and OpenAI for the language model. The full version, including the Daily transport, lives in examples/bot.py.
bot.py

Model identifiers

Models follow provider/model:variant, with a -lang suffix where the model exposes per-language variants. Prefix with slng/ for an SLNG-hosted instance; a bare identifier is the external passthrough route, required for BYOK.
The full list is the model catalog. Not every model accepts every option (for example speed on TTS); check the Unified TTS reference before tuning.

STT reference

SlngSTTService streams speech to text over WebSocket, connecting to wss://{region}.api.slng.ai/v1/bridges/unmute/stt/{model}. Partial transcripts below 0.5 confidence are dropped before reaching your pipeline. Final transcripts are always kept. Language is imported from pipecat.transcriptions.language.

TTS reference

SlngTTSService streams text to speech over WebSocket, connecting to wss://{region}.api.slng.ai/v1/bridges/unmute/tts/{model}. Changing voice, speed, or language mid-session reconnects the WebSocket to re-run the init handshake. Pick a voice from the text to speech catalog.

Region routing

world_part picks the region that handles a service’s requests. The service connects to {region}.api.slng.ai, and requests are not routed between regions. Each service takes its own world_part, so STT and TTS can run in different regions. Pass the region code as a string or as a WorldPart value. This example runs Soniox STT and Fish TTS in Germany:
Models differ by region. See Regions and base URLs for every region code and models by region for the speech models each region serves.

Move from base_url

Releases before 0.6.0 picked the region with base_url. Remove base_url and pass world_part instead. base_url still works if its host matches world_part, but it logs a DeprecationWarning:
0.6.0 also removes these:
  • region_override and world_part_override. Use world_part.
  • enable_vad on SlngSTTService. The service no longer sends it, and it never changed transcription. Delete the argument.
  • SlngHttpTTSService. Use the streaming SlngTTSService.
STT no longer sends language="en" by default. Pass language=Language.EN if you relied on that default on a multilingual model.

Bring your own key (BYOK)

Pass provider_key to bill an upstream provider directly on your own contract; both services forward it as the X-Slng-Provider-Key header, and the SLNG cache still applies on top. See Bring your own key.
BYOK works on external routes only (no slng/ prefix). SLNG-hosted routes reject the header with an HTTP 400. Since 0.4.0, WebSocket connect-rejection errors include the server’s response body, so a misrouted request reports the reason.

Next steps