Repository navigation
feat(voice): read aloud with StyleTTS2 on this machine, as an opt-in service - #291
Merged
Merged
Conversation
…service Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01WkPdbtd7zvYMRWaRkLN2F6
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.
Requested by Adeel · project thread
Description
Before: spoken answers and podcasts needed a cloud provider, an OpenAI-compatible server you ran yourself, or a Mac.
After: StyleTTS2 is a text-to-speech choice in Settings → AI assistant → Voice. It runs on your own machine as the optional
styletts2Compose service (docker compose --profile styletts2 up -d), off by default because it is heavy (PyTorch, ~1 GB model fetched on first use). Its voices are clips: drop a few seconds of someone speaking into thestyletts2-voicesvolume (e.g.grandpa.wav) and it appears in the voice picker;defaultis a public-domain LibriVox reader.How:
styletts2/is a small stdlib HTTP server around the MITstyletts2package that speaks the OpenAI audio API (POST /v1/audio/speech,GET /v1/audio/voices,GET /health). Lens'sspeech.speak()andvoices()call it atvoice.styletts2_url(defaulthttp://styletts2:8880); when it isn't running, answers fall back to the browser and the picker says how to start it. A newStyleTTS2workflow builds the image and reads a sentence aloud on every change tostyletts2/.Tested for real on CPU (outside Docker, same server and pins): the first request fetched the model and answered in 49 s, later sentences in ~5 s, a clip-cloned voice worked, an unknown voice gave 404.
Motivation and Context
Adeel asked for StyleTTS2 alongside ElevenLabs, macOS
sayand Gemini (#268).Types of changes
!in the title)Checklist:
make hookschecks it on commit).docs/accordingly.## UnreleasedinCHANGELOG.md.Done questions (AGENTS.md)
GET /voice/voicesandPOST /voice/speakcover it.voice.styletts2_urlin Settings with a default.🤖 Generated with Claude Code
https://claude.ai/code/session_01WkPdbtd7zvYMRWaRkLN2F6
Generated by Claude Code