unslothai/unsloth · warning · AudioBackendUnsupportedError
audio_unsupported_backend
audio_unsupported_backend
Error message
This backend cannot generate audio.
What it means
AudioBackendUnsupportedError with code 'audio_unsupported_backend': the active model's inference backend has no code path for this TTS task. The source comment is explicit — a tagged code means 'no path for this task, not a failure'; the error may carry a worker-provided hint about what backend would work.
Source
Thrown at studio/backend/core/inference/orchestrator.py:2226
self._mark_worker_started(cancel_event)
worker_started = True
continue
if rtype == "audio_done":
if cancel_event is not None and cancel_event.is_set():
raise AudioGenerationCancelledError("Audio generation cancelled")
wav_bytes = base64.b64decode(resp["wav_base64"])
sample_rate = resp["sample_rate"]
return wav_bytes, sample_rate
if rtype == "audio_error":
if resp.get("cancelled") or (
cancel_event is not None and cancel_event.is_set()
):
raise AudioGenerationCancelledError("Audio generation cancelled")
# Tagged code = no path for this task, not a failure.
if resp.get("code") == AUDIO_UNSUPPORTED_CODE:
raise AudioBackendUnsupportedError(
resp.get("error", "This backend cannot generate audio."),
hint = resp.get("hint"),
)
raise RuntimeError(resp.get("error", "Audio generation failed"))
if rtype == "error":
if cancel_event is not None and cancel_event.is_set():
raise AudioGenerationCancelledError("Audio generation cancelled")
raise RuntimeError(resp.get("error", "Unknown error"))
if rtype == "status":
continue
# A caller cancellation already spent the drain window polling this
# request's mailbox. Tear down an unresponsive worker now instead of
# waiting out the much longer generation watchdog or draining twice.
if cancel_deadline is not None:
if self._shutdown_subprocess(timeout = _AUDIO_CANCEL_DRAIN_TIMEOUT):View on GitHub (pinned to 203007d190)
Solutions
- Load a TTS-capable model/backend before requesting audio.
- Read the hint field — it names the supported backend or model shape.
- Disable the audio action in the UI for non-TTS models (use this error's code to detect the condition).
Example fix
// before
wav, sr = orchestrator.generate_audio(text)
// after
from core.inference.orchestrator import AudioBackendUnsupportedError
try:
wav, sr = orchestrator.generate_audio(text)
except AudioBackendUnsupportedError as e:
show_info(e.hint or "This model cannot generate audio") Defensive patterns
Strategy: type-guard
Validate before calling
if not model_supports_tts(orchestrator.active_model_name):
disable_audio_button() Type guard
from core.inference.orchestrator import AudioBackendUnsupportedError
def is_audio_unsupported(exc: Exception) -> bool:
return isinstance(exc, AudioBackendUnsupportedError) and getattr(exc, "code", None) == "audio_unsupported_backend" Try / catch
try:
wav, sr = orchestrator.generate_audio(text)
except AudioBackendUnsupportedError as e:
show_capability_message(e.hint) Prevention
- Track model capabilities in the UI and hide audio actions for non-TTS models.
- Treat the tagged code as a capability signal, not a failure.
When it happens
Trigger: Calling generate_audio on a model loaded with a text-only backend (e.g. a plain transformers LLM without TTS support), or requesting an audio modality the loaded adapter/backend cannot produce.
Common situations: UI allows the audio button for models without TTS support; user loads a chat model and triggers speech generation; backend matrix mismatch after a model switch.
Related errors
- Inference subprocess is not running
- No active model
- Audio generation cancelled
- No valid audio codes found after START_OF_SPEECH token
- No bicodec_semantic tokens found in generated output
AI-assisted analysis of unslothai/unsloth@203007d190 (2026-08-15).
Data as JSON: /api/errors/de7b2f6eb450f289.
Report an issue: GitHub.