Rumik text-to-speech services for Pipecat
Project description
pipecat-rumik
Text-to-speech service implementations for Pipecat using Rumik's TTS APIs.
Overview
pipecat-rumik provides two Pipecat TTS services:
RumikTTSServicefor WebSocket-based synthesis in interactive voice pipelines.RumikHttpTTSServicefor HTTP request/response synthesis.
The package follows Pipecat's service conventions: constructor-level provider
configuration, runtime-configurable Settings, raw PCM audio frames, metrics,
and standard service connection events.
from pipecat_rumik import RumikHttpTTSService, RumikTTSService, RumikTTSSettings
Installation
pip install pipecat-rumik
For local development:
uv sync --extra dev
Prerequisites
Before using either service, configure access to the Rumik gateway:
export RUMIK_API_KEY=...
export RUMIK_GATEWAY_URL=...
Optional environment variables used by the smoke-test examples:
export RUMIK_MODEL=muga
export RUMIK_SPEAKER_ID=0
export RUMIK_DESCRIPTION=neutral
export RUMIK_TEMPERATURE=0.6
export RUMIK_TOPK=40
export RUMIK_MAX_NEW_TOKENS=2048
Service Selection
| Service | Transport | Recommended Use |
|---|---|---|
RumikTTSService |
WebSocket | Interactive Pipecat voice agents that need interruption-aware TTS. |
RumikHttpTTSService |
HTTP | Simpler synthesis flows where a request/response API is preferred. |
Use the WebSocket service for conversational applications. Use the HTTP service for batch-style synthesis or integration tests that do not need a persistent TTS connection.
Configuration
RumikTTSService
| Parameter | Type | Required | Description |
|---|---|---|---|
api_key |
str |
yes | Rumik API key. |
gateway_url |
str |
yes | Rumik gateway base URL. |
settings |
RumikTTSService.Settings | None |
no | Runtime-configurable TTS settings. |
sample_rate |
int | None |
no | Output sample rate. Rumik currently emits 24 kHz PCM. |
full_response_aggregation |
bool |
no | Buffer a complete LLM response before sending it to Rumik. Defaults to True. |
RumikHttpTTSService
| Parameter | Type | Required | Description |
|---|---|---|---|
api_key |
str |
yes | Rumik API key. |
gateway_url |
str |
yes | Rumik gateway base URL. |
aiohttp_session |
aiohttp.ClientSession |
yes | Caller-owned HTTP session. |
settings |
RumikHttpTTSService.Settings | None |
no | Runtime-configurable TTS settings. |
sample_rate |
int | None |
no | Output sample rate. Rumik currently emits 24 kHz PCM. |
Settings
Both services use Pipecat's service settings pattern:
settings=RumikTTSService.Settings(...)
settings=RumikHttpTTSService.Settings(...)
RumikTTSService.Settings and RumikHttpTTSService.Settings are aliases of
RumikTTSSettings.
| Setting | Type | Default | Used By | Description |
|---|---|---|---|---|
model |
str | None |
"muga" |
HTTP, WS | Rumik model identifier. |
voice |
str | None |
None |
inherited | Reserved for Pipecat provider compatibility. |
language |
Language | str | None |
None |
inherited | Reserved for Pipecat provider compatibility. |
speaker_id |
int |
0 |
WS | Rumik WebSocket speaker ID. |
description |
str | None |
"neutral" |
HTTP | Voice/style description. |
temperature |
float | None |
0.6 |
HTTP | Sampling temperature. |
topk |
int | None |
40 |
HTTP | Top-k sampling. |
max_new_tokens |
int | None |
2048 |
HTTP | Maximum generated audio tokens. |
Runtime updates use Pipecat's TTSUpdateSettingsFrame with
RumikTTSSettings.
Usage
WebSocket Service
import os
from pipecat_rumik import RumikTTSService
tts = RumikTTSService(
api_key=os.environ["RUMIK_API_KEY"],
gateway_url=os.environ["RUMIK_GATEWAY_URL"],
settings=RumikTTSService.Settings(
model="muga",
speaker_id=0,
),
)
By default, RumikTTSService uses full-response aggregation. This sends one
complete assistant response to Rumik instead of creating a separate TTS request
for every sentence.
tts = RumikTTSService(
api_key=os.environ["RUMIK_API_KEY"],
gateway_url=os.environ["RUMIK_GATEWAY_URL"],
full_response_aggregation=False,
)
HTTP Service
import os
import aiohttp
from pipecat_rumik import RumikHttpTTSService
async with aiohttp.ClientSession() as session:
tts = RumikHttpTTSService(
api_key=os.environ["RUMIK_API_KEY"],
gateway_url=os.environ["RUMIK_GATEWAY_URL"],
aiohttp_session=session,
settings=RumikHttpTTSService.Settings(
model="muga",
description="neutral",
temperature=0.6,
topk=40,
max_new_tokens=2048,
),
)
The HTTP service uses the caller-owned aiohttp.ClientSession. Create and close
the session in your application code.
Notes
- WebSocket vs HTTP: The WebSocket service is intended for interactive Pipecat conversations. The HTTP service is useful for simpler batch-style synthesis.
- Request lifecycle: The WebSocket service keeps one active synthesis request per connection so audio chunks are routed deterministically to the active Pipecat audio context.
- Interruption handling: On interruption, the WebSocket service closes the active socket and opens a fresh session before accepting the next synthesis request.
- Audio format: Rumik currently emits 24 kHz, mono, signed 16-bit PCM. The services validate provider responses against this audio contract before emitting Pipecat audio frames.
- HTTP response handling: The HTTP service validates the WAV response, removes the WAV container, and emits raw PCM frames.
Event Handlers
RumikTTSService supports Pipecat's standard service connection events:
| Event | Description |
|---|---|
on_connected |
Connected to the Rumik WebSocket service. |
on_disconnected |
Disconnected from the Rumik WebSocket service. |
on_connection_error |
WebSocket connection error occurred. |
@tts.event_handler("on_connected")
async def on_connected(service):
print("Connected to Rumik")
Examples
The repository includes manual smoke tests:
env PYTHONPATH=src uv run python examples/smoke_rumik_http.py
env PYTHONPATH=src uv run python examples/smoke_rumik_ws.py
env PYTHONPATH=src uv run python examples/smoke_rumik_ws_suite.py
The smoke tests require real Rumik credentials. Unit tests do not.
Testing
Offline checks:
uv run --locked pytest -q
uv run --locked ruff check src tests examples scripts
uv run --locked python -m compileall -q src tests examples scripts
uv build
uv run --with twine twine check dist/*
See TESTING.md for the full test checklist and RELEASE.md for TestPyPI/PyPI release steps.
License
This package is released under the MIT License. See LICENSE.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file pipecat_rumik-0.1.1.tar.gz.
File metadata
- Download URL: pipecat_rumik-0.1.1.tar.gz
- Upload date:
- Size: 21.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.11
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
4cef7da9b6dda240cad51f3afc686287fd54e9c4e61ebf0e900440b8a27182f3
|
|
| MD5 |
bed81dd7f2fd52b0f4bc3e62887a21b5
|
|
| BLAKE2b-256 |
8ea2ca983555a342e54a924f0b9595c305f65cc7021d24143131a243eedfb8a3
|
File details
Details for the file pipecat_rumik-0.1.1-py3-none-any.whl.
File metadata
- Download URL: pipecat_rumik-0.1.1-py3-none-any.whl
- Upload date:
- Size: 11.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.11
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
caf4a2ff0c56bfcdf26295f74b240bb728c6235baad99773428d23deb8c8b332
|
|
| MD5 |
d97add7bf6e0e5f2cae788e727e18291
|
|
| BLAKE2b-256 |
33b7f56975cbcd7b3590dc1cb89b5ebd2606c8a40f7b2f4c30d43cbc26f9f3e5
|