Skip to content

feat(rime): add coda model support; default RimeTTSService model to coda#4511

Open
MaCaki wants to merge 5 commits into
pipecat-ai:mainfrom
rimelabs:matt/rime/coda
Open

feat(rime): add coda model support; default RimeTTSService model to coda#4511
MaCaki wants to merge 5 commits into
pipecat-ai:mainfrom
rimelabs:matt/rime/coda

Conversation

@MaCaki
Copy link
Copy Markdown
Contributor

@MaCaki MaCaki commented May 17, 2026

Summary

Adds support for Rime's coda TTS model across all three Rime services in src/pipecat/services/rime/tts.py:

  • RimeTTSService (WebSocket JSON)
  • RimeHttpTTSService (HTTP chunked)
  • RimeNonJsonTTSService (deprecated raw WS — included for parity)

Coda mirrors Arcana on the wire but intentionally does not accept temperature, top_p, or repetition_penalty. The implementations skip those params for coda even when they're set on the settings object.

Official Coda Docs

Default model change for RimeTTSService

This PR also changes the default model for RimeTTSService from arcana to coda. This is a behavior change for callers that relied on the implicit default. To preserve previous behavior, pass model="arcana" explicitly (or via settings=RimeTTSService.Settings(model="arcana", ...)).

RimeHttpTTSService (default mistv2) and RimeNonJsonTTSService (deprecated, default arcana) are unchanged.

Changes

  • RimeTTSService._build_ws_params(): add a coda branch that contributes no model-specific WS query params.
  • RimeHttpTTSService.run_tts(): no code change — the existing if modelId == "arcana" WAV-format gate already correctly excludes coda, which uses audio/pcm.
  • RimeNonJsonTTSService._connect_websocket(): gate repetition_penalty / temperature / top_p on model == "arcana" so coda doesn't receive them.
  • Docstring tweaks on RimeNonJsonTTSSettings / RimeNonJsonTTSService.InputParams to label those three params as arcana only (matching RimeTTSSettings style).
  • Default model for RimeTTSService flipped from arcana to coda.
  • Add support for the timescalefactor parameter

Test plan

  • ruff check and ruff format --check pass on the modified file.
  • Static smoke checks pass:
    • Default model for RimeTTSService is coda
    • WS params for model="coda" exclude temperature / top_p / repetition_penalty / Mist-only params
    • Arcana branch unchanged: still sends the three sampling params
    • Mistv2 branch unchanged: still sends reduceLatency / pauseBetweenBrackets
    • HTTP service: coda stays on audio/pcm (only arcana strips WAV header)
    • Deprecated NonJson service: Arcana params are gated on model == "arcana"
  • Live API path validated indirectly via a parallel change to livekit-plugins-rime (livekit/agents#5748) which confirmed Rime's /v1/rime-tts and /ws3 endpoints accept modelId=coda and return audio/pcm on both transports.

@codecov
Copy link
Copy Markdown

codecov Bot commented May 17, 2026

Codecov Report

❌ Patch coverage is 4.76190% with 40 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
src/pipecat/services/rime/tts.py 4.76% 40 Missing ⚠️
Files with missing lines Coverage Δ
src/pipecat/services/rime/tts.py 30.84% <4.76%> (-1.54%) ⬇️

... and 36 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Copy link
Copy Markdown
Contributor

@markbackman markbackman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The implementation for RimeTTSService looks good. Should the RimeHttpTTSService be updated similarly?

In testing, I notice that the word-timestamps lag the spoken audio by a similar margin to the arcana model on the /ws3 endpoint. I'm assuming that this is a known issue. For example, in the screenshot, the white text shows the word-timestamps outputted by the time the audio finishes playing:
Image

You can see that this gap can be sizable for longer outputs. This isn't blocking since the issue exists for the /ws3 endpoint already and your team is aware.

I'm not approving for now, awaiting on your response regarding RimeHttpTTSService.

@MaCaki
Copy link
Copy Markdown
Contributor Author

MaCaki commented May 19, 2026

Should the RimeHttpTTSService be updated similarly?

Yes! Updating this class now.

Regarding WLTs for coda - This is still a known discrepancy. We're still using estimates for coda, arcana and mistv3, though making iterative improvements.

On the other side of this launch however we're going to re-prioritize dialing in the WLT estimates as well as extracting and delivering model-native WLT's from mistv3

@MaCaki
Copy link
Copy Markdown
Contributor Author

MaCaki commented May 19, 2026

RimeHttpTTSService updated to default to coda

@MaCaki MaCaki requested a review from markbackman May 19, 2026 19:53
Comment thread src/pipecat/services/rime/tts.py Outdated
Comment thread changelog/4511.changed.md Outdated
MaCaki and others added 2 commits May 19, 2026 17:59
@markbackman
Copy link
Copy Markdown
Contributor

@MaCaki sorry for all of the "one more things". Can you lint the code?
uv run scripts/fix-ruff-and-typecheck.sh

@MaCaki
Copy link
Copy Markdown
Contributor Author

MaCaki commented May 20, 2026

@MaCaki sorry for all of the "one more things". Can you lint the code? uv run scripts/fix-ruff-and-typecheck.sh

yea I'll re-run that, ha I keep rushing through this, but now that we've completed all the release work I'll dot all the i's on this.

I also need to add support for a new model parameter in this PR, so yet another detail on my end to address.

repetition_penalty: Token repetition penalty (1.0-2.0).
temperature: Sampling temperature (0.0-1.0).
top_p: Cumulative probability threshold (0.0-1.0).
repetition_penalty: Token repetition penalty (arcana only, 1.0-2.0).
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

RimeNonJsonTTSService is deprecated and we traditionally don't update these classes. Perhaps we should leave out the update for this one?

Copy link
Copy Markdown
Contributor

@markbackman markbackman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good! Just one question about RimeNonJsonTTSService.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants