BerriAI/litellm · error · ReplicateError

LiteLLM Error - prediction not succeeded - {raw_response_jso

Error message

LiteLLM Error - prediction not succeeded - {raw_response_json}

What it means

Terminal-state guard in the Replicate response transformation: the prediction JSON's status is not 'succeeded', so there is no output to map into a ModelResponse; the entire prediction payload is attached for diagnosis.

Source

Thrown at litellm/llms/replicate/chat/transformation.py:250

        model_response: ModelResponse,
        logging_obj: LoggingClass,
        request_data: dict,
        messages: list[AllMessageValues],
        optional_params: dict,
        litellm_params: dict,
        encoding: Any,
        api_key: str | None = None,
        json_mode: bool | None = None,
    ) -> ModelResponse:
        logging_obj.post_call(
            input=messages,
            api_key=api_key,
            original_response=raw_response.text,
            additional_args={"complete_input_dict": request_data},
        )
        raw_response_json: Final = raw_response.json()
        if raw_response_json.get("status") != "succeeded":
            raise ReplicateError(
                status_code=422,
                message=f"LiteLLM Error - prediction not succeeded - {raw_response_json}",
                headers=raw_response.headers,
            )
        outputs: Final = raw_response_json.get("output", [])
        response_str = "".join(outputs)
        if len(response_str) == 0:  # edge case, where result from replicate is empty
            response_str = " "

        ## Building RESPONSE OBJECT
        if len(response_str) >= 1:
            model_response.choices[0].message.content = response_str

        # Calculate usage
        prompt_tokens: Final = token_counter(model=model, messages=messages)
        completion_tokens: Final = token_counter(
            model=model,
            text=response_str,

View on GitHub (pinned to 77b7c6c40c)

Solutions

  1. The prediction status is not 'succeeded'; inspect raw_response_json for the failure reason.
  2. Check model inputs and Replicate logs for the failed prediction.

Example fix

# check prediction status/logs in the Replicate dashboard.
Defensive patterns

Strategy: type-guard

When it happens

Trigger: Triggered when a Replicate prediction completes with a status other than 'succeeded'.

Common situations: See trigger scenarios.


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