Repository navigation
server: optional input on /v1/audio/speech/live for s2s and vc models - #822
Merged
Merged
Conversation
The live route asked every model for `input`, the text a TTS model speaks. A speech-to-speech or voice-conversion model answers or converts the live audio instead, and takes `input` as an optional prompt: LFM2.5-Audio's system prompt or PersonaPlex's persona prompt. MeanVC2 does not read it. So a request had to send a dummy, or repeat the default prompt, to get the model's default behaviour. `input` is now required only when the entry's task is not s2s, vc or svc. The check moves after the model lookup, next to the mode=streaming check, with the same message, so TTS keeps its 400. In the parallel runtime both checks come after the lease, so a TTS request without `input` gets its 400 once it holds a slot, or the busy error if none frees in time. An unknown model without `input` now gets "unknown model id". With neither `input` nor `language` the request carries no text_input, as /v1/tasks/run does without `text`, and the model uses its default. The lifecycle test covers s2s, vc and tts streaming entries in the parallel runtime; the runtime selection test checks the same gate in the legacy one through its public handler.
app/server/README.md says which models need `input` on /v1/audio/speech/live. The lfm2_audio live example drops it, so the reply uses liquid-audio's system prompt.
Owner
|
@ykhrustalev Thanks! This is a general server improvement. PR merged. |
This was referenced Oct 7, 2026
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.
Lets a speech-to-speech or voice-conversion request on the live route leave out
input, so the model uses its own default.Problem
POST /v1/audio/speech/liverefuses every request withoutinput, before it looks up the modelinputis the text a TTS model speaks. An s2s or vc model takes it as an optional prompt: LFM2.5-Audio's system prompt, PersonaPlex's persona prompt. MeanVC2 does not read itRespond with interleaved text and audio.What this PR changes
app/server/live_speech_input.h:live_speech_requires_input(VoiceTaskKind), false for s2s, vc and svc. Both runtimes use ithandle_speech_liveto after the mode=streaming check, with the same message. In the parallel runtime both come after the leaseinputnorlanguage, the request carries notext_input, as/v1/tasks/rundoes withouttextlive_speech_optional_inputinserver_parallel_lifecycle_test(s2s, vc and tts fixture entries), and a legacy check inserver_runtime_selection_testthrough its public handler. Lines the contract doc links do not moveinputis needed, and the lfm2_audio live example drops&input=What changes for users
inputuses liquid-audio's system prompt. PersonaPlex runs with no persona prompt, its documented default, andsystem_prompt=no longer needs a dummyinput. MeanVC2 no longer needs oneinput, an unknown model or an entry not configured with mode=streaming now gets that error instead of theinputoneinputgets its 400 once it holds a slot, or the busy error if none frees in time. On main it was refused at once. With the entry's only slot busy, it waited for the running stream (3 of 3 trials)What does not change
inputgive the same output as mainTesting
ENGINE_BUILD_EXTENDED_TESTS=ON, the 10 server-memory-guard CI tests andserver_speech_option_exceptions_testpass (11/11) on Linux (CPU build) and an M3 Ultra (Metal). The two changed tests pass three runs in a row on each, the lifecycle test for slots 1, 2 and 4. With main's two runtime files, both new tests fail on theinput400--parallel-jobs, on an A10 (CUDA, and the CPU) and the M3 Ultra (Metal, and the CPU):input,input=andlanguage=enalone give the same stream as the explicit default prompt: events, text deltas and every audio delta. Raw PCM (stream_format=audio) tooinputagainst main with the prompt, andinputagainst the sameinput): 40 comparisons on Linux, 24 on the Macinputstill changes the reply. Legacy and parallel give the same outputinputor withinput=, the same 400 body as main in all 16 requests on Linux and 8 on the Mac. Withinput, the same audio as main on each backend/v1/modelsshows nothing active or queued after the 400stext_inputinto no persona prompt and itssystem_promptoption still wins. MeanVC2 never readstext_inputlive streaming response did not observe input end, some TTS requests with a short body got a connection reset on both trees, and theinput400 comes before the body is read, so a client still uploading may see a resetBuild and run
Then run the curl example in
docs/community_models/lfm2_audio.mdagainst a streaming S2S entry.