BerriAI/litellm · error · BaseLLMException

error.get("message", "Unknown Perplexity error")

Error message

error.get("message", "Unknown Perplexity error")

What it means

Perplexity's Responses API reports failures with HTTP 200 and a body carrying status:'failed' plus an error object. LiteLLM checks for this shape before delegating to the base Responses transformer and raises BaseLLMException with error.message (defaulting to 'Unknown Perplexity error' when absent) and the original 200 status code. Naive status-code monitoring misses these because the HTTP layer looks successful.

Source

Thrown at litellm/llms/perplexity/responses/transformation.py:112

            litellm_params=litellm_params,
            headers=headers,
        )

    def transform_response_api_response(
        self,
        model: str,
        raw_response: httpx.Response,
        logging_obj: LiteLLMLoggingObj,
    ) -> ResponsesAPIResponse:
        """Check for Perplexity's status:'failed' on HTTP 200 before delegating to base."""
        try:
            raw_response_json = raw_response.json()
        except Exception:
            raw_response_json = None

        if isinstance(raw_response_json, dict) and raw_response_json.get("status") == "failed":
            error: Final = raw_response_json.get("error", {})
            raise BaseLLMException(
                status_code=raw_response.status_code,
                message=error.get("message", "Unknown Perplexity error"),
            )

        return super().transform_response_api_response(
            model=model,
            raw_response=raw_response,
            logging_obj=logging_obj,
        )

    def supports_native_websocket(self) -> bool:
        """Perplexity does not support native WebSocket for Responses API"""
        return False

View on GitHub (pinned to 77b7c6c40c)

Solutions

  1. Read the exception message - it carries Perplexity's error.message describing the failure
  2. Retry with backoff; status:failed outcomes are frequently transient
  3. Review search-related parameters (search_domain, search_mode) if the message references them
  4. Check Perplexity's status page for ongoing incidents
Defensive patterns

Strategy: retry

Try / catch

Catch BaseLLMException around litellm.responses() even on HTTP-200 paths; status:'failed' outcomes are frequently transient, so retry with short exponential backoff (2-3 attempts) before surfacing error.message to the caller.

Prevention

When it happens

Trigger: Calling litellm.responses(model='perplexity/...') when Perplexity's server-side search or inference fails: upstream search backend errors, capacity issues, or invalid search parameters - all returned as status:'failed' on a 200.

Common situations: Perplexity incidents degrading search quality/failing queries; restrictive search-domain or search-mode parameters the backend rejects; intermittent upstream failures that mostly succeed on retry.

Related errors


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