Skip to content

Conversation

@plangary
Copy link
Contributor

@plangary plangary commented Jan 17, 2026

Summary by CodeRabbit

  • New Features
    • Added support for selecting Resemble TTS models ("chatterbox", "chatterbox-turbo") at initialization or via update; chosen model is sent for both standard and streaming synthesis.
  • Bug Fixes
    • Model property now exposes the configured model value (or "unknown" if unset), reflecting runtime updates.

✏️ Tip: You can customize this high-level summary in your review settings.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Jan 17, 2026

📝 Walkthrough

Walkthrough

Adds a new TTSModels literal type and exposes it from the package; threads an optional model option through the Resemble TTS plugin (constructor, options update, property) and includes the model in REST and WebSocket synthesis payloads.

Changes

Cohort / File(s) Summary
Type Definition & Package Exports
livekit/plugins/resemble/models.py, livekit/plugins/resemble/__init__.py
Introduces TTSModels = Literal["chatterbox", "chatterbox-turbo"] and adds TTSModels to the package __all__ exports.
TTS Model Parameter Integration
livekit/plugins/resemble/tts.py
Adds model to _TTSOptions; TTS.__init__ accepts `model: TTSModels

Sequence Diagram(s)

sequenceDiagram
    participant Client
    participant TTS
    participant ResembleAPI
    participant AudioSink

    Client->>TTS: instantiate TTS(model="chatterbox")
    Client->>TTS: request synthesis (text)
    alt REST path
        TTS->>ResembleAPI: HTTP POST { voice_uuid, model?, audio_chunk }
        ResembleAPI-->>TTS: synthesized audio chunks
    else WebSocket streaming
        TTS->>ResembleAPI: WS send token payload { token, model? }
        ResembleAPI-->>TTS: WS audio frames
    end
    TTS->>AudioSink: deliver synthesized audio
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Poem

🐰
I hopped into models with a curious twitch,
Tucked a "model" into every stitch.
From REST to WS my whiskers sing,
Chatterbox voices take to wing. 🥕

🚥 Pre-merge checks | ✅ 2 | ❌ 1
❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 25.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'Chatterbox model support' accurately summarizes the main change: adding support for Chatterbox TTS models (chatterbox and chatterbox-turbo) to the Resemble TTS plugin.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
  • 📝 Generate docstrings

📜 Recent review details

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between a421ccc and 0950be7.

📒 Files selected for processing (2)
  • livekit-plugins/livekit-plugins-resemble/livekit/plugins/resemble/models.py
  • livekit-plugins/livekit-plugins-resemble/livekit/plugins/resemble/tts.py
🚧 Files skipped from review as they are similar to previous changes (2)
  • livekit-plugins/livekit-plugins-resemble/livekit/plugins/resemble/tts.py
  • livekit-plugins/livekit-plugins-resemble/livekit/plugins/resemble/models.py
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (3)
  • GitHub Check: unit-tests
  • GitHub Check: type-check (3.9)
  • GitHub Check: type-check (3.13)

✏️ Tip: You can disable this entire section by setting review_details to false in your review settings.


Comment @coderabbitai help to get the list of available commands and usage tips.

…s and updating default model settings in the TTS class.
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
livekit-plugins/livekit-plugins-resemble/livekit/plugins/resemble/tts.py (1)

143-157: Bug: update_options always resets model to "resemble" when not explicitly provided.

The default value model: TTSModels | str = "resemble" combined with the check model if model is not None else self._opts.model means the model will always be overwritten to "resemble" when calling update_options() without explicitly specifying a model. This silently resets any previously configured model.

For example, if a user sets model="chatterbox" in __init__, then later calls update_options(voice_uuid="new-voice"), the model will unexpectedly revert to "resemble".

🐛 Proposed fix
     def update_options(
         self,
         *,
         voice_uuid: str | None = None,
-        model: TTSModels | str = "resemble",
+        model: TTSModels | str | None = None,
     ) -> None:
         """
         Update the Text-to-Speech (TTS) configuration options.

         Args:
             voice_uuid (str, optional): The voice UUID for the desired voice.
-            model (TTSModels | str, optional): The model to use for synthesis.
+            model (TTSModels | str | None, optional): The model to use for synthesis.
         """  # noqa: E501
         self._opts.voice_uuid = voice_uuid or self._opts.voice_uuid
         self._opts.model = model if model is not None else self._opts.model
📜 Review details

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 894275e and a421ccc.

📒 Files selected for processing (2)
  • livekit-plugins/livekit-plugins-resemble/livekit/plugins/resemble/models.py
  • livekit-plugins/livekit-plugins-resemble/livekit/plugins/resemble/tts.py
🧰 Additional context used
📓 Path-based instructions (1)
**/*.py

📄 CodeRabbit inference engine (AGENTS.md)

**/*.py: Format code with ruff
Run ruff linter and auto-fix issues
Run mypy type checker in strict mode
Maintain line length of 100 characters maximum
Ensure Python 3.9+ compatibility
Use Google-style docstrings

Files:

  • livekit-plugins/livekit-plugins-resemble/livekit/plugins/resemble/models.py
  • livekit-plugins/livekit-plugins-resemble/livekit/plugins/resemble/tts.py
🧬 Code graph analysis (1)
livekit-plugins/livekit-plugins-resemble/livekit/plugins/resemble/tts.py (7)
livekit-plugins/livekit-plugins-elevenlabs/livekit/plugins/elevenlabs/tts.py (2)
  • model (204-205)
  • _ensure_session (211-214)
livekit-agents/livekit/agents/tts/tts.py (1)
  • model (89-98)
livekit-plugins/livekit-plugins-smallestai/livekit/plugins/smallestai/tts.py (2)
  • model (122-123)
  • _ensure_session (129-133)
livekit-plugins/livekit-plugins-groq/livekit/plugins/groq/tts.py (2)
  • model (99-100)
  • _ensure_session (106-110)
livekit-plugins/livekit-plugins-google/livekit/plugins/google/tts.py (1)
  • model (174-175)
livekit-plugins/livekit-plugins-deepgram/livekit/plugins/deepgram/tts.py (2)
  • model (104-105)
  • _ensure_session (154-157)
livekit-plugins/livekit-plugins-clova/livekit/plugins/clova/stt.py (1)
  • _ensure_session (94-97)
🔇 Additional comments (6)
livekit-plugins/livekit-plugins-resemble/livekit/plugins/resemble/models.py (1)

7-9: LGTM!

The TTSModels type alias correctly defines the supported models as a Literal union, and includes "resemble" as a valid option to maintain backward compatibility as the default.

livekit-plugins/livekit-plugins-resemble/livekit/plugins/resemble/tts.py (5)

39-39: LGTM!

Import of TTSModels is correctly added.


55-105: LGTM!

The model parameter is correctly added to __init__ with a sensible default of "resemble" for backward compatibility. The docstring clearly documents the available options.


114-116: LGTM!

The model property now correctly returns the configured model, consistent with other TTS plugin implementations.


187-204: LGTM!

The REST payload correctly includes the model field for synthesis requests.


318-332: LGTM!

The WebSocket payload correctly includes the model field, consistent with the REST implementation.

✏️ Tip: You can disable this entire section by setting review_details to false in your review settings.

…els and updating model type to allow None. Adjusted default model settings and payload handling for TTS requests.
Copy link
Member

@davidzhao davidzhao left a comment

Choose a reason for hiding this comment

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

lgtm!

@davidzhao davidzhao merged commit 3dbd1d9 into livekit:main Jan 21, 2026
10 checks passed
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