Repository navigation
feat(audio): let the flagship speak through Lemonade - #6204
Conversation
|
Verdict: Request changes This PR makes the flagship's speak-aloud tool safer: it checks the voice and speed, splits long text into chunks, and won't download a speech model mid-chat. The direction is right. But the tool used to fetch the Kokoro model on first use, and now it refuses and tells the user to go to a screen that, as far as I can find, doesn't offer TTS models. A new user who asks GAIA to read something aloud gets an error they can't fix. What to fix before merge:
Real-world evidenceN/A: no evidence bundle was produced for this PR, and the description says no live Lemonade TTS service was available. This verdict rests on reading the code. I also couldn't run the unit tests here (pytest isn't installed in this runner). The tool's real behaviour, especially on a fresh install, hasn't been exercised. 🔍 Technical details🟡 Removing the auto-pull leaves new users with no working fix (
I couldn't find a Settings → Models TTS path in the webui either. This is CLAUDE.md's cold-state case: it only works on a machine that already has Kokoro cached. Name a command the user can run instead, or add Kokoro to init. The same applies to the "not in its catalog" message at line 254. 🟡 No tool-level tests for the new contract (
🟢 🟢 🟢 The hard split can cut words in half ( Strengths
|
|
Pushed commit |
|
The current head |
|
The tool hardening is good. But adding Kokoro to the talk profile also adds it to
🔍 Technical details
|
…h tool Merges amd#6204 (the flagship text_to_speech tool) under read-aloud so GAIA has one way to make speech: the same Lemonade client, voice list and speed range, and the voice and speed the user picks for reading aloud. - text_to_speech now defaults to read_aloud_voice and read_aloud_speed from ~/.gaia/config.json when the request names neither. - Its speed bounds come from READ_ALOUD_MIN_SPEED/MAX_SPEED, the range the settings already enforce.
Adding Kokoro to the talk profile also put it in `gaia init --profile all`, whose model check sent every non-embedding model a chat request, so a clean install reported the voice model as broken. Init now recognises TTS models from the model registry, checks them by synthesizing one word, and labels them "speech" in `gaia init --check --load`. The docs now say to run `gaia download --agent talk` before asking the agent to read aloud, since the tool no longer downloads Kokoro itself.
|
Thanks @huong8373tt-beep. The tool hardening is solid. I pushed the two remaining review items onto your branch, so a clean
🔍 Technical details
|
…h tool Merges amd#6204 (the flagship text_to_speech tool) under read-aloud so GAIA has one way to make speech: the same Lemonade client, voice list and speed range, and the voice and speed the user picks for reading aloud. - text_to_speech now defaults to read_aloud_voice and read_aloud_speed from ~/.gaia/config.json when the request names neither. - Its speed bounds come from READ_ALOUD_MIN_SPEED/MAX_SPEED, the range the settings already enforce.
…h tool Merges amd#6204 (the flagship text_to_speech tool) under read-aloud so GAIA has one way to make speech: the same Lemonade client, voice list and speed range, and the voice and speed the user picks for reading aloud. - text_to_speech now defaults to read_aloud_voice and read_aloud_speed from ~/.gaia/config.json when the request names neither. - Its speed bounds come from READ_ALOUD_MIN_SPEED/MAX_SPEED, the range the settings already enforce.
GAIA had a local voice (Kokoro, through Lemonade) but no way to hear a reply in either app: the agent's `text_to_speech` tool only wrote a WAV nobody saw. Now every reply in the Agent UI has a speaker button, the TUI has `/read-aloud`, and both share one voice, speed and "read every reply" setting in `~/.gaia/config.json`. - **Agent UI:** a speaker button on each reply (press again to stop). **Settings › Read aloud** has a voice picker grouped by American or British English and female or male, with **Preview**, a speed from 0.5× to 2×, and a toggle to read each reply when it finishes. Code blocks, links and markdown marks are skipped. Long replies are spoken in pieces, the next fetched while one plays, so speech starts in about a second once the voice is loaded. On a PC without the voice model, the first press says it is downloading (~0.35 GB) instead of showing a bare spinner. - **TUI:** `/read-aloud` reads the last reply (again, or `/read-aloud stop`, stops it). `/voice` lists and sets voice, speed and auto-read. Playback uses the OS's own player: PowerShell on Windows, `afplay` on macOS, `pw-play`/`paplay`/`aplay` on Linux. - **Backend:** `GET/PUT /api/speech/settings`, `GET /api/speech/model` (is the voice downloaded) and `POST /api/speech` (WAV). Failures say what broke: 503 when Lemonade is unreachable, 502 when it can't speak, 422 for a bad voice or speed. **One speech pipeline.** Built on amd#6204 (the agent's `text_to_speech` tool, now in main): the button, the TUI and the agent's tool share one Lemonade client, voice list and speed range. With no voice or speed named, the tool now uses the ones picked for reading aloud. The `text_to_speech` docstring now says an omitted voice or speed means the user's choice. Eval category to watch at the next RC: `web_system` (`text_to_speech`). The voices speak English only; the settings say so, since Arabic replies are read with an English accent. ## Test plan - [x] `pytest tests/unit` — new `test_speech_router.py` (settings round trip, validation, WAV shape, 502/503) and `test_tui_voices_drift.py` (TUI voice list matches `KOKORO_VOICES`) - [x] `npm test` (2,471 tests incl. new store, text-splitting, button and settings-pane tests) and `npm run test:rtl` with read-aloud settings and a failed reading, in Arabic light/dark and English - [x] `go build ./...`, `go vet ./...`, `go test ./...` in `tui/` - [x] Real Lemonade (private 2026.43.3 instance): `POST /api/speech` returned 4.5 s of 24 kHz audio (30 s cold, 1.4 s warm); in the Agent UI, Settings › Read aloud saved a new voice and Preview played to the end and returned to idle - [x] Real Windows playback through the TUI's player: a 4.5 s clip played in 5.2 s; stopping cut it off in 0.5 s - [x] Screenshots read in English and Arabic, light and dark, and at 390 px - [x] Both apps end to end against a stand-in Lemonade, in an isolated GAIA home: a voice and speed set in the Agent UI were used by the TUI's auto-read; auto-read skipped a failed turn (it used to read the error out); a speech failure shows the reason; 20 rapid clicks and `/read-aloud` twice both end idle - [ ] Reviewer: on a PC with a chat model, press the speaker on a reply and turn on auto-read; in the TUI, `/read-aloud` and `/voice bm_george` - [x] Linux playback: in a Debian container, the TUI's player played a read-aloud WAV through `paplay` on a real PulseAudio daemon (null sink) to the end, and a cancel stopped it within 0.7 s; `aplay` accepted the same WAV - [ ] Reviewer: macOS playback (`afplay`; no Mac was available) --------- Co-authored-by: Kalin Ovtcharov <[email protected]>
Summary
Closes #6090.
text_to_speechtool.Validation
tests/unit/test_lemonade_speech.py tests/unit/test_audio_tools.py -q: 67 passed, 1 skippedpython -m py_compileon changed Python files: passedgit diff --check: passedSlai Agent Runtime performed the investigation, implementation, and test execution. The account owner authorized this contribution and is responsible for its content.