Streaming TTS for Kokoro (kokoro-wyoming) — Assist speaks before the LLM finishes

TL;DR: Home Assistant will stream an LLM’s reply into a TTS engine as it’s generated, but only if the engine advertises Wyoming’s synthesize-streaming. Kokoro didn’t, so replies waited for the full answer plus full synthesis before any audio. I added it and sent it upstream. Now the satellite speaks the first sentence while the model is still writing the rest.

The setup: local LLM as the Assist conversation agent, Kokoro-82M on the GPU as TTS via kokoro-wyoming, Wyoming satellites.

The problem: on a multi-sentence reply you get dead air. HA generates the whole response, hands the whole thing to TTS, TTS synthesizes all of it, and only then does the satellite speak. The wait scales with reply length.

Why it happens: HA’s wyoming/tts.py only token-streams into the engine when the engine’s Info says supports_synthesize_streaming: true. Stock kokoro-wyoming implements only the one-shot Synthesize event, so HA falls back to waiting for everything.

What I changed (engine side): handle SynthesizeStart / Chunk / Stop, synthesize each sentence as it arrives and stream its audio immediately, and advertise the streaming flag in Info. The one-shot path (tts.speak, announcements) is untouched.

Results (GPU Kokoro, real pipeline): before, first audio only after the entire reply is synthesized; after, first audio about 0.07s after the LLM’s run-end because early sentences were already spoken.

How to try it: two files, the streaming handlers in src/main.py plus a requirements.txt bump (wyoming>=1.7.0, sentence-stream). Rebuild, restart, reload the Wyoming entry. No pipeline changes. Full diff in the PR: [Add Wyoming synthesize-streaming (sentence-by-sentence synthesis) by dizzle215 · Pull Request #13 · nordwestt/kokoro-wyoming · GitHub].

Caveats and upstream credit included. Open to critique.