BerriAI/litellm · error · TimeoutError

RunwayML task polling timed out after {timeout_secs} seconds

Error message

RunwayML task polling timed out after {timeout_secs} seconds

What it means

Poll-loop timeout in the RunwayML image-generation handler: elapsed time since start_time exceeded timeout_secs while the task was still in a non-terminal state, so a TimeoutError is raised instead of polling forever.

Source

Thrown at litellm/llms/runwayml/image_generation/transformation.py:153

                        )
                    )

        return model_response

    @staticmethod
    def _check_timeout(start_time: float, timeout_secs: float) -> None:
        """
        Check if operation has timed out.

        Args:
            start_time: Start time of the operation
            timeout_secs: Timeout duration in seconds

        Raises:
            TimeoutError: If operation has exceeded timeout
        """
        if time.time() - start_time > timeout_secs:
            raise TimeoutError(f"RunwayML task polling timed out after {timeout_secs} seconds")

    @staticmethod
    def _check_task_status(response_data: dict[str, Any]) -> str:
        """
        Check RunwayML task status from response.

        RunwayML statuses: PENDING, RUNNING, SUCCEEDED, FAILED, CANCELLED, THROTTLED

        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()

View on GitHub (pinned to 77b7c6c40c)

Solutions

  1. Increase the polling timeout for long-running image tasks.
  2. Check RunwayML service status if tasks never complete.

Example fix

litellm.image_generation(..., timeout=300)
Defensive patterns

Strategy: retry

When it happens

Trigger: Triggered when polling a RunwayML image generation task exceeds the configured timeout.

Common situations: See trigger scenarios.

Understand the failure class


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