Repository navigation
feat(tts): Chatterbox voice with Kokoro fallback; choose the voice per request - #85
Merged
Merged
Conversation
TTS_FALLBACK_URL names a second OpenAI-compatible speech service (Kokoro) that speaks when the voice (TTS_URL, now Chatterbox Turbo on the Arc B580) fails or does not answer within TTS_PRIMARY_TIMEOUT_MS (default 10 s; the full 15 s applies without a fallback). The B580 is shared with Ollama, and Chatterbox slows ~8x while Ollama's 9B runs; without this the plugin would fall back to the Mac's local voice instead. Fallback settings are read per call. Nothing else changes when TTS_FALLBACK_URL is unset. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Contributor
|
Note Currently processing new changes in this PR. This may take a few minutes, please wait... ⚙️ Run configuration
📒 Files selected for processing (6)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
TTS_SERVICES=chatterbox=http://chatterbox:8880,kokoro=http://kokoro:8880 names the services in order: the first is the default, the rest are fallbacks. /api/ai/voice-audio takes an optional `model` (a service name) that is tried first, so the plugin's `/devscope:voice model kokoro` keeps Kokoro for one user while Chatterbox stays the default. Every service but the last gets TTS_PRIMARY_TIMEOUT_MS. GET /api/ai/voice-models lists them. TTS_URL/TTS_FALLBACK_URL still work as the unnamed form. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Merged
2 tasks done
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
The voice moves to Chatterbox Turbo (350M) on the homelab's Intel Arc B580. It won the bake-off (3.4–3.9× real time, first piece of an explanation in 1.7 s, 3.6 GB of GPU memory) and runs as a small OpenAI-compatible server in the deployment stack. Kokoro stays, as the fallback and as a voice users can choose.
Named services, a voice per request
TTS_SERVICES=chatterbox=http://chatterbox:8880,kokoro=http://kokoro:8880: the services in order. The first is the default voice, the rest are fallbacks in order./api/ai/voice-audiotakes an optionalmodel(a service name). That service is tried first and the others after it, which is how the plugin's/devscope:voice model kokoroworks. An unknown name is ignored.GET /api/ai/voice-models→{models: ["chatterbox", "kokoro"]}, default first.TTS_URL(+TTS_FALLBACK_URL) still work as the unnamed form, so the current.envkeeps working.Why fallbacks have a short leash
The B580 is shared with Ollama. While Ollama's 9B model runs, Chatterbox slows about 8× (a 15 s summary took ~40 s today, while another job hammered the 9B). So every service but the last gets
TTS_PRIMARY_TIMEOUT_MS(default 10 s). The Chatterbox server also answers 503 at once when busy (measured: 2 s), so Kokoro speaks instead of you waiting.Deploy: merge → watchtower → set
TTS_SERVICES=chatterbox=http://chatterbox:8880,kokoro=http://kokoro:8880in the stack's.envand recreate the backend.Test plan
bun testtts + routes/voice + voiceSummary: 36 pass (new: parsing, default and requested order, unknown name ignored, requested voice falls back, primary timeout, both fail → null, route passesmodel, malformed name 400,/voice-models).tsc: 34 errors both before and after this change.model: "kokoro"→ Kokoro; Chatterbox stopped → Kokoro answers.🤖 Generated with Claude Code
Summary by CodeRabbit