Repository navigation
feat(inworld): let the server split streamed text on inworld-tts-2 - #8000
Merged
tinalenguyen merged 4 commits intoOct 21, 2026
Merged
tinalenguyen merged 4 commits into
tinalenguyen merged 4 commits into
Conversation
Without a custom tokenizer, inworld-tts-2 streams forward text as it arrives and create the context with the SENTENCE_BOUNDARY auto-mode strategy, so the server finds sentence boundaries. Passing a tokenizer keeps client-side sentence splitting. With SENTENCE_BOUNDARY the buffer threshold also cuts sentences longer than it, so it is sent only when set. The default for client-side splitting is now 250.
retain_format=False normalizes whitespace in the default tokenizer, which server-side splitting skips, so it selects client-side splitting the same way passing a tokenizer does.
tinalenguyen
approved these changes
Oct 21, 2026
Removed unnecessary whitespace in test file.
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
On
inworld-tts-2models,SynthesizeStreamnow sends text to Inworld as it arrives and creates the context with Inworld'sSENTENCE_BOUNDARYauto-mode strategy. The server buffers the text and starts synthesis at each sentence boundary, so the plugin no longer splits sentences itself for these models.Passing
tokenizer=orretain_format=Falsekeeps client-side splitting. Other models behave as before. Inworld supports this strategy only oninworld-tts-2models.In this mode
buffer_char_thresholdalso cuts sentences longer than it, so it is sent only when set, and Inworld's default applies otherwise. The default for client-side splitting is now 250.In a side-by-side run on
inworld-tts-2with text streamed at 20 ms per token, median time to first audio went from 328 to 195 ms for a short reply and from 451 to 417 ms for text with abbreviations. A reply with a long first sentence took about the same time either way.Testing
tests/test_plugin_inworld_tts.py.ruffandmypypass on the plugin.inworld-tts-2andinworld-tts-1.5-max. Audio and word timestamps arrive and stay in order across several generations in one stream.