BerriAI/litellm · error · ValueError

RunwayML TTS failed: {failure_reason} (code: {failure_code})

Error message

RunwayML TTS failed: {failure_reason} (code: {failure_code})

What it means

Terminal-state mapping in the RunwayML TTS status normalization: the task FAILED, and the failure reason and failureCode from the task payload are surfaced so the caller can distinguish TTS failures from timeouts or cancellation.

Source

Thrown at litellm/llms/runwayml/text_to_speech/transformation.py:269

        Args:
            response_data: JSON response from RunwayML task endpoint

        Returns:
            Normalized status string: "running", "succeeded", or raises on failure

        Raises:
            ValueError: If task failed or status is unknown
        """
        status: Final = response_data.get("status", "").upper()

        verbose_logger.debug("RunwayML TTS task status: %s", status)

        if status == "SUCCEEDED":
            return "succeeded"
        elif status == "FAILED":
            failure_reason: Final = response_data.get("failure", "Unknown error")
            failure_code: Final = response_data.get("failureCode", "unknown")
            raise ValueError(f"RunwayML TTS failed: {failure_reason} (code: {failure_code})")
        elif status == "CANCELLED":
            raise ValueError("RunwayML TTS was cancelled")
        elif status in ["PENDING", "RUNNING", "THROTTLED"]:
            return "running"
        else:
            raise ValueError(f"Unknown RunwayML task status: {status}")

    def _poll_task_sync(
        self,
        task_id: str,
        api_base: str,
        headers: dict[str, str],
        timeout_secs: float = 600,
    ) -> httpx.Response:
        """
        Poll RunwayML task until completion (sync).

        RunwayML POST returns immediately with a task that has status PENDING/RUNNING.

View on GitHub (pinned to 77b7c6c40c)

Solutions

  1. Read failure_reason/failure_code to identify the cause.
  2. Adjust TTS input text or voice parameters to valid values.

Example fix

# verify voice id and text length limits in RunwayML docs.
Defensive patterns

Strategy: type-guard

When it happens

Trigger: Triggered when a RunwayML TTS task finishes with a failed status.

Common situations: See trigger scenarios.


AI-assisted analysis of BerriAI/litellm@77b7c6c40c (2026-08-18). Data as JSON: /api/errors/35b90f2a3e855d61. Report an issue: GitHub.