> ## Documentation Index
> Fetch the complete documentation index at: https://docs.rime.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Prism Pipecat service reference

> Configure Prism settings, interruption rules, tool calls, startup retries, playback, and recovery in the Pipecat Rime service.

`RimeRealtimeLLMService` connects a Pipecat agent directly to Prism with your Rime API key. For installation and a complete agent, use the [Pipecat quickstart](https://docs.rime.ai/docs/prism/pipecat.md). These settings apply to the Rime service in Pipecat 1.17.0 or later. The `rime` extra installs the Rime SDK for Python `0.1.0a31` with it.

## Session behavior

Prism handles speech input, turn detection, and speech output. Use `LLMContextAggregatorPair` with the service, and add no separate speech-to-text, text-to-speech, or local VAD service.

| Feature | Behavior |
| - | - |
| Connection | The service reads `RIME_API_KEY` when you don't pass a `client`. Pass `endpoint` to use another Prism WebSocket endpoint. A `client` you pass stays yours, and the service does not close it. |
| Language and voices | English, with any of [Prism's voices](https://docs.rime.ai/docs/prism/sessions.md#choose-a-voice), such as `aurora` |
| Conversation | One service instance runs one conversation. The first context frame opens the conversation with the context's messages and starts a reply. |
| Audio | The service accepts PCM16 audio frames at any rate from 8 to 192 kHz and with 1 to 32 channels, and converts them for Prism. A frame outside those limits ends the session with an error. |
| Transports | The service works with Pipecat's standard transports. The [Pipecat quickstart](https://docs.rime.ai/docs/prism/pipecat.md) uses SmallWebRTC. Standard transports don't report what the caller heard, so the service estimates the played position. See [Choose playback behavior](#choose-playback-behavior). |
| History | After the greeting, Prism history only grows. Add messages with `LLMMessagesAppendFrame`, and set `run_llm=True` to ask for a reply. Replacing or transforming context messages, or a later `LLMRunFrame`, does not change Prism history or start a reply. |

## Settings

Set these in `RimeRealtimeLLMService.Settings` when you create the service, or change them during the call with [`LLMUpdateSettingsFrame`](#change-settings-during-a-call). Creating the service raises `ValueError` for an invalid value, such as a `speed` outside 0.85 to 1.3.

| Setting | What it does |
| - | - |
| `system_instruction` | The agent's instructions. |
| `voice` | The Prism voice. |
| `speed` | Speech speed from 0.85 to 1.3. `None` uses the server default. |
| `interrupt_on_speech` | The server interruption setting. It defaults to `True`. Pipecat's local turn strategies control Pipecat interruptions independently. |
| `interrupt_min_words`, `interrupt_phrases`, `acknowledgment_phrases` | Which speech interrupts a reply. See [Choose which speech interrupts a reply](#choose-which-speech-interrupts-a-reply). |
| `tools` | The functions Prism can call. An empty list removes all tools. |
| `tool_fillers` | Filler phrases keyed by tool name. See [Control tool calls](#control-tool-calls). |
| `truncation` | How Prism shortens the history when the conversation outgrows the context, as an SDK `Truncation` value. The [Prism SDK reference](https://docs.rime.ai/api-reference/sdk/prism.md) lists the values. |
| `response_metadata` | Labels for replies, as a mapping of strings. Prism receives them in a separate update from the other settings. |

## Choose which speech interrupts a reply

By default, any speech over a reply interrupts it. Three settings let a caller say "uh huh" or "okay" without stopping Prism.

| Setting | What it does |
| - | - |
| `interrupt_min_words` | How many words the caller must say over a reply to interrupt it, from 1 to 10. `None` uses the server default. |
| `interrupt_phrases` | Words or phrases that interrupt at once, however few words the caller says, such as "stop" or "wait". |
| `acknowledgment_phrases` | Words or phrases that don't count as words, such as "uh huh" or "okay". |

Each phrase list holds at most 100 phrases. An empty list clears it.

This service needs three words to interrupt a reply. It also interrupts at once on "stop" or "wait", and lets "uh huh" and "okay" pass:

```python theme={null}
from pipecat.services.rime.realtime.llm import RimeRealtimeLLMService

llm = RimeRealtimeLLMService(
    settings=RimeRealtimeLLMService.Settings(
        interrupt_min_words=3,
        interrupt_phrases=["stop", "wait"],
        acknowledgment_phrases=["uh huh", "okay"],
    ),
)
```

You can instead pass the same three fields in `turn_detection`, a `TurnDetection` from `rimelabs_sdk.realtime`. Set each rule in one place. The service raises `ValueError` if `turn_detection` and `settings` both set the same rule. `turn_detection` also takes the server's turn settings for the opening, such as eagerness and the end-of-turn silence floor. The [Prism SDK reference](https://docs.rime.ai/api-reference/sdk/prism.md) lists them.

## Change settings during a call

Send an `LLMUpdateSettingsFrame` with only the settings you want to change. Omitted settings keep their current values. This update replaces the acknowledgment list:

```python theme={null}
from pipecat.frames.frames import LLMUpdateSettingsFrame

await worker.queue_frame(
    LLMUpdateSettingsFrame(
        delta=RimeRealtimeLLMService.Settings(
            acknowledgment_phrases=["uh huh", "okay", "right"],
        )
    )
)
```

A new phrase list replaces the whole list. To clear a phrase list, send `[]`. An update cannot set `system_instruction`, `voice`, `speed`, `interrupt_on_speech`, `truncation`, or the three interruption settings to `None`. An update with an invalid value, or with one of those settings set to `None`, is refused. The service pushes the `ValueError` into your pipeline as an ordinary error, and the settings stay as they were.

Prism can refuse an update. The service then restores the previous settings. Send `LLMSetToolsFrame` to change only the tools.

## Control tool calls

Prism chooses when to call your functions. Pipecat runs them, and `result_callback` returns each result to Prism. Automatic or disabled tool selection is supported. Forced tool selection is unsupported.

`tool_fillers` maps a tool name to a `PrismFiller` from `rimelabs_sdk.realtime`. A filler applies to the advertised tool with that name. This filler plays while the lookup runs:

```python theme={null}
from rimelabs_sdk.realtime import PrismFiller

settings = RimeRealtimeLLMService.Settings(
    tools=[lookup_invoice],
    tool_fillers={
        "lookup_invoice": PrismFiller(type="text", text="Checking your invoice."),
    },
)
```

A tool registered with `cancel_on_interruption=False` can send intermediate results. An intermediate result is added to the history beside its call, and the call stays open until its final result. Only the final result answers the call. [Handle slow tools and long tasks](https://docs.rime.ai/docs/prism/long-running-tasks.md) covers results that arrive late.

## Configure the connection

The service retries an opening after an eligible HTTP refusal, and never replays an established conversation. These options are the defaults. They allow up to three retries after the first attempt, with at least 2 seconds between attempts, 30 seconds for one connection, and 60 seconds for all attempts and delays:

```python theme={null}
from pipecat.services.rime.realtime.llm import RimeRealtimeLLMService, RimeStartupParams

llm = RimeRealtimeLLMService(
    startup=RimeStartupParams(
        max_retries=3,
        retry_interval=2,
        attempt_timeout=30,
        total_timeout=60,
    ),
)
```

`max_retries` accepts 0 to 10. Use `timeouts` to pass an SDK `RealtimeTimeouts` for the connection, readiness, and acknowledgment limits. Pass `request_id` to request a correlation ID. `llm.session_info` returns the acknowledged session information, including the request ID.

## Choose playback behavior

The default `playback="estimated"` reports an estimated position for the latest emitted audio. Pipecat does not measure device playback or send playback-completion receipts.

With `playback="discard"`, the service drops all output audio and reports it to Prism as unplayed:

```python theme={null}
llm = RimeRealtimeLLMService(playback="discard")
```

## Read session events

The service raises two events. `on_session_updated` runs when Prism acknowledges session information. `on_rime_event` runs for each SDK event, including provider diagnostics. This handler logs the Prism version that accepted the session:

```python theme={null}
@llm.event_handler("on_session_updated")
async def on_session_updated(service, info):
    logger.info(f"Prism version {info.version}")
```

## Recover from failures

There is no automatic reconnect or replay. After an unknown or partially applied operation, start a new service instance with known valid, completed history. A write that Prism rejects does not roll back Pipecat's local context.

Input that Prism refuses without ending the session, such as an invalid value, reaches your pipeline as an ordinary error. A session failure interrupts playback and pushes a permanent error. [Errors and limits](https://docs.rime.ai/docs/prism/errors.md) explains provider errors.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.