Add SLNG-hosted speech to text and text to speech, and the SLNG Context Router, to a Pipecat pipeline.
Keep your Pipecat bot where it runs and route its speech to text and text to
speech through SLNG. You can also point the language model at the SLNG Context
Router. Your transport, VAD, turn-taking, prompts, tools, and pipeline order
stay as they are.The SLNG Pipecat services stream STT and TTS over WebSocket. Use them for
interactive agents that need low latency and mid-utterance interruption.There are two ways to do it. Set up the layers in the dashboard and copy the
migration prompt for your coding agent, or make the edits yourself.
Improving an agent is à la carte. Turn on speech to text, the language model,
text to speech, or any mix of the three. Choose the models, voice, language,
and routing region you want. The dashboard builds a migration prompt from your
choices.
1
Choose Pipecat
Open the Improve my agent flow and choose Pipecat. The flow keeps
your existing bot in your own codebase and generates the changes for the
layers you select.
Choose Pipecat in the Improve my agent flow.
2
Set up Listen
Turn on speech to text and choose the model and language. Leave it off to
keep your current speech to text service.
Turn on Listen and pick a speech to text model.
3
Set up Think
Turn on the language model and choose the model. The Context Router option is
available in your selected region.
Think turned on with a language model selected.
4
Set up Speak
Turn on text to speech and choose the model and voice. Leave it off to keep
your current text to speech service.
Use the Include TTS toggle to turn text to speech on or off.
5
Copy the prompt
Click Integrate in the top right, then Copy prompt in the modal. The
dashboard generates a prompt for the platform and layers you selected. Hand
it to your coding agent. It installs the
pipecat-migration skill and applies the
changes to your bot.
Click Integrate in the top right.
Copy the generated prompt.
The screenshots show the shared dashboard controls. The prompt content is
generated for the platform you selected.
Example prompt
Your model IDs, voice, language, and routing region come from what you
picked.
# Migrate this Pipecat bot to SLNG-hosted STT/TTS and the SLNG Context RouterUse the SLNG `pipecat-migration` skill to replace speech to text and textto speech with `SlngSTTService` and `SlngTTSService` from `pipecat-slng`.Replace the LLM with Pipecat's `OpenAILLMService` pointed at the SLNG ContextRouter using `bedrock-mantle/nvidia.nemotron-nano-3-30b:latest`.## Install the skill```bashnpx skills add slng-ai/skills pipecat-migration```## Selected stack- STT: `soniox/speech-ai:rt-v5`- TTS: `slng/fish/tts:s2.1-pro`- Voice: `1258154bb41540c7b9dc0d10cd6704bf`- Language: English (`en`)- Region: Germany, via `world_part="eu-west"`- LLM: SLNG Context Router, model `bedrock-mantle/nvidia.nemotron-nano-3-30b:latest` at `https://eu-west.context-router.slng.ai/v1`## Instructions for the coding agent1. Discover the entrypoint, package manager, environment loading, and current STT, TTS, and LLM wiring before editing. Do not assume file names.2. Establish a rollback point with a clean git tree.3. Validate `SLNG_API_KEY` without printing it.4. Install `pipecat-slng` and import-probe `from pipecat_slng import SlngSTTService, SlngTTSService`.5. Replace only the STT and TTS constructors that feed `Pipeline([...])`. Keep the transport, VAD, context aggregators, and pipeline order intact.6. Point `OpenAILLMService` at the SLNG Context Router endpoint.7. Never inline API keys. Use stable agent and session identifiers in request headers, then verify one spoken turn from STT through the LLM to TTS.
Model IDs use the provider/model:variant format, and the slng/ prefix selects
an SLNG-hosted model. The examples pin requests to Germany with
world_part="eu-west". Models differ by region, so check
models by region before you pick one. For model identifiers, BYOK with provider_key,
and region routing, see the Pipecat plugin
reference.
If you would rather not use a coding agent, make the same edits directly. The
removed lines below depend on your current providers, so match them to your
code.
1
Install the plugin
Use your project’s package manager.
uv add pipecat-slng
2
Point STT and TTS at SLNG
Import the SLNG services and swap only the two constructors that feed
Pipeline([...]). Pass the API key through the environment, never as a
literal.
Keep the model, voice, language, and routing region you selected in the
dashboard. world_part="eu-west" is an example for the Germany region.
Use the region code from your dashboard prompt if it differs. Each service
takes its own world_part.
3
Point the LLM at the SLNG Context Router
Use Pipecat’s OpenAI-compatible service
against the router. Pass stable agent and session identifiers in the
headers, not random values per request.
from pipecat.services.openai import OpenAILLMServicellm = OpenAILLMService( api_key=os.environ["SLNG_API_KEY"], base_url="https://eu-west.context-router.slng.ai/v1", # keep the same region as STT and TTS settings=OpenAILLMService.Settings( model="bedrock-mantle/nvidia.nemotron-nano-3-30b:latest", ), default_headers={ "X-Slng-Agent-Id": agent_id, "X-Slng-Session-Id": session_id, },)
pipecat-slng provides STT and TTS services. The router uses Pipecat’s
OpenAILLMService.
4
Verify
Run one spoken turn through your bot’s transport and confirm that the
pipeline completes speech to text, the LLM, and text to speech. Keep the
existing pipeline order: