feat(voice): Kokoro local-TTS backend as a private alternative to ElevenLabs (+ mute toggle & statusline indicator)#1465
Closed
HotSauceHacker wants to merge 1 commit into
Conversation
d1863b9 to
4239a18
Compare
…ne indicator Adds a fully-local voice backend (Kokoro) as a private alternative to the cloud ElevenLabs path: no API key, and no text or audio leaves the machine. Opt-in via PAI_VOICE_BACKEND=kokoro; ElevenLabs behavior is unchanged when unset. - voice.ts: playKokoroVoice() POSTs to a warm local daemon, selected ahead of ElevenLabs. Adds a live mute gate (voice-mute.json) read per notification that silences TTS only; desktop notifications still fire; fail-open. - kokoro_server.py: warm Kokoro daemon (GET /health, POST /speak); audio player is env-configurable (PAI_KOKORO_PLAYER) for non-macOS. - TOOLS/VoiceMute.ts: on/off/toggle/status CLI, bindable to a keyboard shortcut. - LIFEOS_StatusLine.sh: mute glyph read live from the same state file. - DOCUMENTATION/Notifications/KokoroVoiceBackend.md: setup and hotkey guide.
4239a18 to
208819b
Compare
Owner
|
Thank you @HotSauceHacker — this is clean, well-scoped work and the env-gated design (ElevenLabs stays default) is exactly how a backend alternative should land. Holding it out of v7.0.0 purely on dependency footprint: the Python/ONNX runtime plus a resident LaunchAgent is a bigger product decision than this release wants to make. Not a no — a not-in-this-one. Would welcome revisiting it as a follow-up. |
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.
What and why
LifeOS voice (
PULSE/VoiceServer/voice.ts) currently speaks via ElevenLabs, which sends the text of every notification to a cloud API and requires an API key. This PR adds a fully-local alternative powered by Kokoro: no API key, and no text or audio ever leaves the machine. That fits the privacy posture many people want from a personal AI.It is opt-in and backward-compatible. With
LIFEOS_VOICE_BACKENDunset, the ElevenLabs path is byte-for-byte unchanged.What's included
voice.ts:playKokoroVoice()POSTs{text, voice}to a warm local daemon, selected ahead of ElevenLabs whenLIFEOS_VOICE_BACKEND=kokoro. Also adds a live mute gate read fromvoice-mute.jsonon every notification. Muting silences TTS only; desktop notifications still fire, and it fails open.kokoro_server.py: a small warm Kokoro daemon (GET /health,POST /speak) that keeps the model resident so utterances skip cold-start. The audio player is env-configurable (LIFEOS_KOKORO_PLAYER) for non-macOS.TOOLS/VoiceMute.ts: anon|off|toggle|statusCLI writing the shared state file, bindable to a keyboard shortcut for a live mute hotkey.LIFEOS_StatusLine.sh: a mute glyph (audible / muted) in the header, read live from the same state file.DOCUMENTATION/Notifications/KokoroVoiceBackend.md: setup (deps, model, daemon, env vars) plus an optional skhd keyboard-shortcut guide.Trying it
See the setup doc. In short: install
kokoro-onnxplus model files, run the daemon, and setLIFEOS_VOICE_BACKEND=kokoroin the Pulse process environment.Notes
afplay; Linux viaLIFEOS_KOKORO_PLAYER=aplay).