npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@livekit/agents-plugin-rime

v1.11.0

Published

Rime plugin for LiveKit Node Agents

Readme

Rime plugin for LiveKit Agents

The Agents Framework is designed for building realtime, programmable participants that run on servers. Use it to create conversational, multi-modal voice agents that can see, hear, and understand.

This package contains the Rime plugin, which provides high-quality text-to-speech (TTS) capabilities for voice synthesis. Refer to the documentation for information on how to use it, or browse the API reference. See the repository for more information about the framework as a whole.

WebSocket v1 streaming

WebSocket v1 requires both websocketURL and modelId at construction. The URL selects the deployment. The model sets the plugin's defaults and available options. Set RIME_API_KEY and pass both options:

import { TTS } from '@livekit/agents-plugin-rime';

const rime = new TTS({
  websocketURL: 'wss://coda.api.rime.ai/ws',
  modelId: 'coda',
  speaker: 'lyra',
});

Use modelId: 'coda' with wss://coda.api.rime.ai/ws, or modelId: 'mistv3' with wss://mist.api.rime.ai/ws. Both public endpoints use port 443.

If your configuration relied on a model in the URL path, add modelId to the constructor. The plugin does not read the model from the URL hostname or path.

Custom deployments can use any URL path. Pass the deployment URL and its model in websocketURL and modelId.

For Coda, the default speaker is lyra. Mist uses cove. Pass speaker to use another voice.

websocketProtocol defaults to binary, with the rime.v1.binary subprotocol. Set it to json for rime.v1.json and canonical protobuf JSON. Both modes use the generated definitions from @rimelabs/[email protected].

One stream uses one continuous synthesis context. Text fragments pass through a LiveKit sentence tokenizer before transmission. The default tokenizer emits one sentence at a time. A custom tokenizer must emit complete, stable sentence units.

| Stream method | Behavior | | ---------------- | ---------------------------------------------------------- | | pushText(text) | Buffer text and send complete sentences. | | flush() | Release buffered text locally. Keep the context open. | | endInput() | Send remaining text, then end. Wait for done. | | close() | Stop synthesis and send cancel when a context is active. |

Only call flush() at a complete sentence or stable clause boundary. You can send more text after a flush. No protocol flush message exists in v1. An input pause can exceed the API timeout. Connection, write, start, and final response waits remain bounded. Timeouts use milliseconds, as in other JS plugins.

Sequential streams reuse connections. Concurrent streams use separate connections. After cancellation, the adapter reuses a connection only after a valid terminal reply. Failed or contaminated connections are discarded. prewarm() opens an idle connection. await rime.close() cancels streams and closes the pools.

audioFormat accepts audio/pcm, audio/pcmu, audio/wav, audio/mpeg, audio/ogg;codecs=opus, and audio/webm;codecs=opus. Both protocols support all six formats and return mono PCM frames at the selected samplingRate. Compressed formats use the bundled LiveKit FFmpeg binary, or LIVEKIT_FFMPEG_PATH when set. The default format is audio/pcm. WebSocket v1 does not provide word timestamps.

Use timeScaleFactor for speed control. Legacy generation controls, speedAlpha, and WS3-only options are rejected in v1. Mist accepts pauseBetweenBrackets and phonemizeBetweenBrackets.

The plugin sends the API key to the configured endpoint. It trusts rime.ai and its subdomains. Set allowCustomEndpoint: true to use another trusted host. Remote endpoints must use HTTPS or WSS. Loopback IP addresses can use HTTP or WS. Provider messages, response bodies, close reasons, and transport errors are not included in returned errors. Safe status codes and provider request IDs remain available.

Existing HTTP and WS3 interfaces

Without websocketURL, the plugin retains HTTP synthesis and the legacy WS3 interface selected with useWebsocket or a WebSocket baseURL. HTTP and WS3 retain their existing speaker defaults and options. WS3 retains word timestamps. Mist v2 defaults to 22050 Hz; Coda and Mist v3 default to 24000 Hz. HTTP requests send the resolved rate explicitly.

updateOptions() applies to new streams. Existing streams keep their original options and endpoint. A v1 model change requires a different model endpoint. Changing only the URL query does not change the model. Transport mode cannot change after construction.

Tests

Run pnpm exec vitest run plugins/rime/src from the repository root after building @livekit/agents. The local tests need no API keys. The optional service test needs both RIME_API_KEY and OPENAI_API_KEY.

The audio tests generate WAV, MP3, Ogg, and WebM samples at test setup. Install a full FFmpeg build with libmp3lame and libopus on PATH to run these tests. The bundled LiveKit FFmpeg supports playback but does not include all required encoders and output formats.