BerriAI/litellm · error · ReplicateError

No response received from Replicate API after max retries

Error message

No response received from Replicate API after max retries

What it means

Poll-loop exhaustion in the Replicate completion handler: every retry returned a non-200 or non-terminal status (never succeeded/failed/canceled), so after max retries there is no usable response and the call gives up.

Source

Thrown at litellm/llms/replicate/chat/handler.py:232

            if response.status_code == 200 and response.json().get("status") in [
                "processing",
                "starting",
            ]:
                continue
            return litellm.ReplicateConfig().transform_response(
                model=model,
                raw_response=response,
                model_response=model_response,
                logging_obj=logging_obj,
                api_key=api_key,
                request_data=input_data,
                messages=messages,
                optional_params=optional_params,
                litellm_params=litellm_params,
                encoding=encoding,
            )

    raise ReplicateError(
        status_code=500,
        message="No response received from Replicate API after max retries",
        headers=None,
    )


async def async_completion(
    model_response: ModelResponse,
    model: str,
    messages: list[AllMessageValues],
    encoding,
    optional_params: dict,
    litellm_params: dict,
    version_id,
    input_data,
    api_key,
    api_base,
    logging_obj: LiteLLMLoggingObj,

View on GitHub (pinned to 77b7c6c40c)

Solutions

  1. Increase the polling timeout/max retries for long-running Replicate predictions.
  2. Check Replicate service status and your network connectivity.

Example fix

litellm.completion(..., timeout=600)  # allow longer prediction time
Defensive patterns

Strategy: retry

When it happens

Trigger: Triggered when polling the Replicate API exhausts max retries without receiving a completed response.

Common situations: See trigger scenarios.


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