LiveKit Agents Plugins Rime

raw JSON →
1.5.7 verified Fri May 01 auth: no python

A LiveKit Agents plugin for Rime, providing text-to-speech TTS capabilities within the LiveKit realtime AI agent framework. Current version 1.5.7, requires Python >=3.10. Active development with frequent releases.

pip install livekit-plugins-rime
error ModuleNotFoundError: No module named 'livekit'
cause Missing metadata or incorrect installation of livekit-agents base package.
fix
Install livekit-agents: pip install livekit-agents
error Object of type 'coroutine' has no attribute 'data'
cause Forgetting to await or use async context manager when consuming TTS stream.
fix
Use async with tts.synthesize(text) as stream: and then iterate with async for chunk in stream:
error RuntimeError: Rime API key not provided
cause Neither `RIME_API_KEY` environment variable nor `api_key` arg was set.
fix
Set environment variable or pass api_key parameter explicitly.
breaking Version 1.0+ changed the TTS interface to async generator streams. Old synchronous `synthesize()` method removed.
fix Use `async with tts.synthesize(text) as stream` and iterate over chunks.
deprecated The `voice` parameter in RimeTTS is deprecated in favor of `voice_id`. Passing `voice` will raise a deprecation warning.
fix Replace `voice="..."` with `voice_id="..."`.
gotcha The Rime API key must be set via environment variable `RIME_API_KEY` or passed in constructor. If neither is found, the plugin fails silently.
fix Always either set `RIME_API_KEY` env var or provide `api_key` argument.

Basic usage of RimeTTS to synthesize speech, assuming API key is set in environment.

import asyncio
from livekit.plugins.rime import RimeTTS

async def main():
    tts = RimeTTS(
        api_key=os.environ.get("RIME_API_KEY", ""),
        voice_id="test-voice"
    )
    async with tts.synthesize("Hello, world!") as stream:
        async for chunk in stream:
            print(chunk.data)

asyncio.run(main())