BerriAI/litellm · error · NotImplementedError

transform_search_request must be implemented by provider

Error message

transform_search_request must be implemented by provider

What it means

Raised by the abstract transform_search_request stub on the base search transformation. It fires when a provider config never implemented request transformation, so a caller-supplied search query cannot be mapped to the provider's request format.

Solutions

  1. Use a provider that implements search; transform_search_request is abstract.
  2. Implement transform_search_request in the custom provider's transformation class.
  3. Verify the search provider name is supported.
Defensive patterns

Strategy: try-catch

When it happens

Trigger: Thrown at litellm/llms/base_llm/search/transformation.py:230 when the library encounters an invalid state.

Common situations: See trigger scenarios.


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

Appendix: source

Thrown at litellm/llms/base_llm/search/transformation.py:230

    def transform_search_request(
        self,
        query: str | list[str],
        optional_params: dict,
        **kwargs,
    ) -> dict | list[dict]:
        """
        Transform Search request to provider-specific format.
        Override in provider-specific implementations.

        Args:
            query: Search query (string or list of strings)
            optional_params: Optional parameters for the request

        Returns:
            Dict with request data
        """
        raise NotImplementedError("transform_search_request must be implemented by provider")

    def transform_search_response(
        self,
        raw_response: httpx.Response,
        logging_obj: LiteLLMLoggingObj,
        **kwargs,
    ) -> SearchResponse:
        """
        Transform provider-specific Search response to standard format.
        Override in provider-specific implementations.
        """
        raise NotImplementedError("transform_search_response must be implemented by provider")

    def get_error_class(
        self,
        error_message: str,
        status_code: int,
        headers: dict,

View on GitHub (pinned to 77b7c6c40c)