-
Notifications
You must be signed in to change notification settings - Fork 2.7k
Chatterbox model support #4541
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Chatterbox model support #4541
Conversation
📝 WalkthroughWalkthroughAdds a new TTSModels literal type and exposes it from the package; threads an optional Changes
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
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Poem
🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches
📜 Recent review detailsConfiguration used: Organization UI Review profile: CHILL Plan: Pro 📒 Files selected for processing (2)
🚧 Files skipped from review as they are similar to previous changes (2)
⏰ 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)
✏️ Tip: You can disable this entire section by setting Comment |
livekit-plugins/livekit-plugins-resemble/livekit/plugins/resemble/models.py
Show resolved
Hide resolved
…s and updating default model settings in the TTS class.
There was a problem hiding this 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_optionsalways resets model to"resemble"when not explicitly provided.The default value
model: TTSModels | str = "resemble"combined with the checkmodel if model is not None else self._opts.modelmeans the model will always be overwritten to"resemble"when callingupdate_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 callsupdate_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
📒 Files selected for processing (2)
livekit-plugins/livekit-plugins-resemble/livekit/plugins/resemble/models.pylivekit-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.pylivekit-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
TTSModelstype alias correctly defines the supported models as aLiteralunion, 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
TTSModelsis correctly added.
55-105: LGTM!The
modelparameter 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
modelproperty now correctly returns the configured model, consistent with other TTS plugin implementations.
187-204: LGTM!The REST payload correctly includes the
modelfield for synthesis requests.
318-332: LGTM!The WebSocket payload correctly includes the
modelfield, 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.
davidzhao
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm!
Summary by CodeRabbit
✏️ Tip: You can customize this high-level summary in your review settings.