Skip to main content
Keep your Pipecat bot where it runs and route its speech to text and text to speech through SLNG. You can also route the language model through 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 make the change. Copy the prompt the dashboard builds for your coding agent, or make the edits yourself.

Prerequisites

  • A running Pipecat bot with Python 3.11 or later, on pipecat-ai>=1.12.0 and pipecat-slng 0.7.
  • A project created under Improve my agent > Pipecat, and an API key from its Project Vault. Set up a project for your own code walks through it, including which of the four configurations to pick.
  • The project’s region code, such as eu-north. The key works in that region only.
Starting fresh, or want a known-good reference? The Pipecat templates are complete bots for each LLM option below, with a smoke.py that runs one spoken turn without a microphone.

Choose your LLM option

Speech runs the same way in every option. Only the language model changes:

Use a coding agent

The project builds a migration prompt from your Listen, Think, and Speak choices.
1

Copy the prompt

Click Integrate in the top right, then Copy prompt in the modal. Hand it to your coding agent. It installs the pipecat-migration skill and applies the changes to your bot.
The Integrate button in the top right of the project

Click Integrate in the top right.

The shared Integrate modal with a Copy prompt button

Copy the generated prompt.

The screenshots show the shared dashboard controls. The prompt content is generated for the platform you selected.
Your model IDs, voice, language, and region come from what you picked.

Model routes and regions

Model IDs use the provider/model:variant format, and the slng/ prefix selects an SLNG-hosted model. 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.

Edit the code yourself

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.
2

Set the environment

Set the project key and region, and a stable agent ID. OPENAI_API_KEY is for the Your LLM and inline BYOK options.
.env
3

Point STT and TTS at SLNG

Import the SLNG services and swap only the two constructors that feed Pipeline([...]). world_part pins the region, and the two external_* IDs tie each call’s speech usage to your agent and call.
Each service takes its own world_part. Keep both on the project’s region.
4

Set up the LLM

Pick the tab for your option. Both router options send the agent and session IDs in default_headers. Pipecat passes settings.extra to the OpenAI client’s create(), so the router’s own body fields go inside extra_body, with this call’s template variables. The next step builds INSTRUCTIONS and variables.
Keep Pipecat’s OpenAI service on your own key. The LLM step skips the Context Router.
pipecat-slng provides STT and TTS services. The router uses Pipecat’s OpenAILLMService.
5

Fill per-call values with template variables

Write values that change per call, such as the caller’s name, as {{name}} placeholders in the prompt. Send their values in the request body as template_variables, and the router fills them in before the model sees the prompt. The cached answer keeps the placeholders, so callers with different names can share it. Building the string yourself puts each caller’s name into the prompt, so no answer can be shared.
  • Send values that are spoken or echoed: names, a company, an appointment time.
  • Keep steering values in the prompt itself. A value that changes what the answer says, such as the reply language, is not a template variable.
  • Give every placeholder a value. A {{name}} with no value returns 422 missing_template_variables.
  • Only the router fills them. With the Your LLM option, write the values into the prompt yourself.
For the syntax, limits, and more examples, see Per-call values.
6

Build it once per call

Build the services inside bot(), which the Pipecat runner calls once per call, so each call gets its own session ID and template variables. Keep your existing pipeline order.
bot.py
7

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. With the templates, uv run python smoke.py speech_router runs one turn with no transport, and uv run python speech_router.py -t webrtc serves a page at http://localhost:7860 to talk to.

Next steps