Issue Title: SGLang Backend: Context Drop / Identity Bleed in Multi-Speaker voice_clone_and_continuation (MOSS-TTSD v1.0)
Description: When running the fused MOSS-TTSD v1.0 + Tokenizer model via the moss-ttsd-v1.0-with-cat SGLang branch, the inference server struggles to maintain multimodal context during long, multi-speaker scenes.
While the native Hugging Face transformers implementation successfully holds the voice identity using a concatenated assistant_message acoustic history, the SGLang backend appears to drop or mishandle this complex acoustic KV-cache. During a multi-turn continuation, the model will suddenly drop the cloned identity ([S1] or [S2]) and hallucinate a generic, unconditioned voice (male or female) mid-scene.
Environment:
OS: Linux Alma 10.1
Hardware: NVIDIA RTX 5090 / 32GB RAM
SGLang Branch: moss-ttsd-v1.0-with-cat
Model: Fused OpenMOSS-Team/MOSS-TTSD-v1.0 + MOSS-Audio-Tokenizer
Startup Command: sglang serve --model-path
Steps to Reproduce: The issue is easily reproducible using a multi-speaker prompt where the text exceeds a few hundred tokens. Below is a standalone Python reproduction script that hits the http://localhost:30000/generate endpoint using standard base64 encoding for the reference audio.
It passes two references (Harold and Johnny) and asks the SGLang server to generate a continuation. Midway through the response, the server loses the voice binding.
Reproduction Script (sglang_multispeaker_bug.py):
Python import requests import base64 import json
=====================================================================
SGLANG BUG REPORT: Multi-Speaker Identity Bleed
Ensure the SGLang server is running on port 30000 with the fused model
=====================================================================
SERVER_URL = "http://localhost:30000/generate"
def encode_audio(file_path): with open(file_path, "rb") as audio_file: return base64.b64encode(audio_file.read()).decode("utf-8")
Encode reference files
Note: Ensure harold_kline.wav and johnny_dollar.wav are in the same directory
audio_s1 = encode_audio("harold.wav") audio_s2 = encode_audio("johnny.wav")
Construct the multi-speaker prompt
The text contains the reference transcripts followed by the continuation text
prompt_text = ( "[S1] According to subsection four, paragraph B of the policy, we are not liable for acts of... spontaneous combustion. " "[S2] Your marriage is none of my business. But that policy his paper took out on him is. " "[S1] This is Harold at Intermountain Indemnity in Dallas. " "[S2] Harold. Sounds like you have either trouble or overtime. " "[S1] Both. We insure the Dallas Mining Company." "[S2] Mining, huh. Caveins and bad coffee. " )
payload = { "text": prompt_text, "audio_data": [audio_s1, audio_s2], "sampling_params": { "temperature": 0.8, "top_p": 0.80, "repetition_penalty": 1.15, "max_new_tokens": 2000 } }
print("Sending multi-speaker payload to SGLang server...") response = requests.post(SERVER_URL, json=payload)
if response.status_code == 200: result = response.json() # SGLang returns the generated audio as a base64 string in the 'text' field if "text" in result: output_audio_bytes = base64.b64decode(result["text"]) with open("sglang_bug_output.wav", "wb") as f: f.write(output_audio_bytes) print("Saved sglang_bug_output.wav. Listen to the voice drift midway through the dialogue.") else: print(f"Server Error {response.status_code}: {response.text}") Expected Behavior: The SGLang server should seamlessly handle the acoustic baton pass between [S1] and [S2], maintaining both distinct identities throughout the entire generated WAV file, matching the behavior of the native Hugging Face pipeline.
Actual Behavior: The server begins the generation correctly but drops the multimodal context from the KV-cache, resulting in the sudden morphing of the voices into unconditioned base states.
We have identified this issue and are currently working on a fix. In the meantime, you can use the following command to temporarily circumvent this problem:
SGLANG_VLM_CACHE_SIZE_MB=0 \
sglang serve \
--model-path <path-to-save-model> \
--delay-pattern \
--trust-remote-code \
--disable-radix-cache \
--port 30000 --host 0.0.0.0
Thank you for the reply. I have done much deeper testing and there is a larger issue. I have given up on the non SGLang multispeaker usage since it produces too many of the same issues to be used in a production environment.
SGLang v1.0 follow-up: two-speaker continuation is unstable / wrong-speaker / silence, while similar minimal test works on v0.7
Summary
I am following up on an earlier SGLang multi-speaker issue.
After additional testing, I can now reproduce a much smaller and more targeted failure on MOSS-TTSD v1.0 over SGLang:
- a minimal two-speaker continuation test on v1.0 does not behave reliably
- the first speaker (Speaker 1 / announcer-style role) is usually cloned correctly
- the second speaker (Speaker 2 / investigator-style role) is unstable: wrong identity, sometimes wrong-gender sounding, and often followed by silence
- by contrast, a similar minimal two-speaker smoke test on v0.7 works, though it still has minor quirks
This suggests the problem is not only in a larger episode-generation pipeline. There appears to be a v1.0 SGLang path issue specifically affecting two-speaker continuation / speaker handoff.
Prior related issue
This appears related to the previously acknowledged cache/context issue for v1.0 multi-speaker continuation.
I previously reported multi-speaker identity bleed / context loss, and was advised to start the server with:
SGLANG_VLM_CACHE_SIZE_MB=0 \
sglang serve \
--model-path <path-to-save-model> \
--delay-pattern \
--trust-remote-code \
--disable-radix-cache \
--port 30000 --host 0.0.0.0
I applied that workaround. It improved behavior somewhat, but did not resolve this smaller two-speaker failure on v1.0.
Environment
- OS: AlmaLinux 10.1
- GPU: NVIDIA RTX 5090 32 GB
- Python: 3.12
- v1.0 SGLang branch:
moss-ttsd-v1.0-with-cat - v0.7 SGLang branch:
moss-ttsd-v0.7-with-xy
v1.0 model path
OpenMOSS-Team/MOSS-TTSD-v1.0OpenMOSS-Team/MOSS-Audio-Tokenizer- fused with
scripts/fuse_moss_tts_delay_with_codec.py
v0.7 model path
OpenMOSS-Team/MOSS-TTSD-v0.7OpenMOSS-Team/MOSS_TTSD_Tokenizer_hf- fused with
legacy/v0.7/fuse_model_with_codec.py
What I tested
1) Larger multi-speaker pipeline
A larger client pipeline originally failed on multi-speaker scenes, especially with longer scenes. Since that pipeline is fairly large, I reduced the problem to a minimal two-speaker smoke test.
2) Minimal two-speaker smoke test against v0.7
A very small two-speaker request to the v0.7 SGLang server worked. Audio still had minor quirks, but it did produce a usable two-speaker continuation.
3) Minimal two-speaker test against v1.0
Running a comparable tiny two-speaker test against the v1.0 SGLang server did not behave correctly.
Observed behavior on repeated runs:
- Speaker 1 voice is correct
- Speaker 2 voice is wrong / unstable
- sometimes Speaker 2 sounds wrong-gender
- after that, the output often falls into silence
This happens even though the prompt is short and the request is no longer the full pipeline.
Reproduction prompt
I used short English reference lines and a short two-speaker continuation.
Speaker 1 reference
- Audio:
speaker1.wav - Text:
[S1] This is the host speaking for tonight's program.
Speaker 2 reference
- Audio:
speaker2.wav - Text:
[S2] Formal report submitted by the assigned investigator.
Continuation to generate
[S1] Tonight, a strange visitor arrives.
[S2] And I was the one sent to meet him.
Reproduction methods
A. Official-style v1.0 request path
I also tested a request script derived directly from the official scripts/request_sglang_generation.py approach:
- concatenated text prefix:
prompt_text_speaker1 + prompt_text_speaker2 + gen_text audio_dataas two separate data-URI WAV inputs- standard
/generaterequest
In my environment, this official-style test either:
- returns 500 Internal Server Error, or
- behaves worse than the v0.7 minimal smoke test
B. Minimal merged-prompt smoke test
I also tested a simpler minimal request shape:
- merge the two prompt audios into one prompt WAV
- prepend the two reference transcripts to the text
- send one
/generaterequest
This worked on v0.7 but on v1.0 it still showed:
- S1 correct
- S2 incorrect / wrong identity
- silence after the handoff
Expected behavior
The model should:
- preserve the first speaker identity
- switch to the second speaker identity correctly
- continue generating audio for both lines without collapsing into silence
Because this is a short two-speaker prompt, I would expect it to be significantly more stable than a long multi-scene request.
Actual behavior on v1.0
Typical observed result:
- Speaker 1 is correct
- Speaker 2 is wrong or unstable
- output often turns into silence after the first handoff
Examples of the failure:
- Speaker 1 correct, then silence
- Speaker 1 correct, then wrong-identity Speaker 2, then silence
Comparison that seems important
v0.7
- same general type of short two-speaker prompt
- works with minor quirks
v1.0
- same kind of short prompt
- two-speaker continuation is unstable or collapses
This makes me suspect either:
- a regression in the v1.0 SGLang multi-speaker continuation path, or
- an incompatibility in the v1.0 server request handling for multi-speaker prompt audio / prompt-text conditioning
Additional notes
- I already applied the suggested cache workaround (
SGLANG_VLM_CACHE_SIZE_MB=0and--disable-radix-cache) on the server side. - The issue is easier to isolate now because it reproduces with a short two-speaker prompt, not only with a large pipeline.
- Since v0.7 works materially better for this minimal two-speaker case, I suspect the remaining problem is upstream in the v1.0 SGLang path rather than only in orchestration code.
What would help
It would help to know:
-
Is the official v1.0 SGLang request shape expected to send:
audio_dataas a list of separate speaker WAVs- or a single merged prompt WAV?
-
Is there any known v1.0-specific issue where:
- the first speaker is conditioned correctly
- but the second speaker handoff fails or collapses into silence?
-
Is there a recommended minimal two-speaker test that the team considers the canonical repro for v1.0 SGLang?
-
Is there any way to have more speakers -- I would like to see 10 in a scene if possible.
Your current approach is correct. However, the model seems to struggle with short text generations. Try ensuring the generated text is longer than the reference audio; that should resolve the issue.
Thanks. I tested that case directly and I still see the problem even after making the generated text longer than the reference audio.
To isolate it, I reduced the test to a short single-speaker case and also tried deterministic settings on my side. With those changes, the output becomes consistent across runs, but it is still the wrong cloned voice rather than the target reference voice. So this does not appear to be only a short-generation issue.
I am also seeing a difference between inference paths:
- a minimal two-speaker smoke test on v0.7 can work, though with minor quirks
- v1.0 over SGLang is much less stable in my setup
- in the older non-SGLang path, even a longer single-speaker announcer test can lock onto a consistent but incorrect voice on one machine
Because of that, could you clarify:
- whether there are any known issues with speaker conditioning drift even in longer single-speaker generations
- whether the expected request format for v1.0 SGLang is separate speaker audio inputs or a merged prompt audio input
- whether there is a recommended canonical single-speaker and two-speaker repro script for validating that conditioning is working correctly
If helpful, I can provide a minimal repro using generic speaker labels and short reference lines.