BerriAI/litellm · error · PredibaseError

HTTPStatusError - received status_code={e.response.status_co

Error message

HTTPStatusError - received status_code={e.response.status_code}, error_message={e.response.text}

What it means

Error-mapping branch on the Predibase chat POST: httpx.HTTPStatusError was raised (raise_for_status), and both the status code and response body are packed into the PredibaseError message for diagnosis.

Source

Thrown at litellm/llms/predibase/chat/handler.py:221

        stream,
        data: dict,
        optional_params: dict,
        timeout: float | httpx.Timeout,
        litellm_params=None,
        logger_fn=None,
        headers={},
        predibase_config=None,
    ) -> ModelResponse:
        if predibase_config is None:
            predibase_config = litellm.PredibaseConfig()
        async_handler: Final = get_async_httpx_client(
            llm_provider=litellm.LlmProviders.PREDIBASE,
            params={"timeout": timeout},
        )
        try:
            response: Final = await async_handler.post(api_base, headers=headers, data=json.dumps(data))
        except httpx.HTTPStatusError as e:
            raise PredibaseError(
                status_code=e.response.status_code,
                message=f"HTTPStatusError - received status_code={e.response.status_code}, error_message={e.response.text}",
            )
        except Exception as e:
            for exception in litellm.LITELLM_EXCEPTION_TYPES:
                if isinstance(e, exception):
                    raise e
            raise PredibaseError(
                status_code=500, message=f"{e}"
            )  # don't use verbose_logger.exception, if exception is raised
        return predibase_config.transform_response(
            model=model,
            raw_response=response,
            model_response=model_response,
            logging_obj=logging_obj,
            api_key=api_key,
            request_data=data,
            messages=messages,

View on GitHub (pinned to 77b7c6c40c)

Solutions

  1. Read the returned status_code and error_message to identify the server-side failure.
  2. For 4xx codes fix authentication or request payload; for 5xx retry with backoff.

Example fix

# retry on 5xx with tenacity; on 401/403 verify PREDIBASE_API_KEY and tenant id.
Defensive patterns

Strategy: try-catch

When it happens

Trigger: Triggered when an httpx.HTTPStatusError is raised during a Predibase chat request, e.g. 4xx/5xx from the Predibase API.

Common situations: See trigger scenarios.


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