BerriAI/litellm · error · ValueError

Azure AI Search service name is required. Provide it via lit

Error message

Azure AI Search service name is required. Provide it via litellm_params['azure_search_service_name'] or api_base parameter

What it means

To build the Azure AI Search endpoint (https://<name>.search.windows.net), the vector-store config needs either a full api_base or the search service name. get_base_endpoint raises when api_base is empty and litellm_params['azure_search_service_name'] is missing/empty.

Source

Thrown at litellm/llms/azure_ai/vector_stores/transformation.py:101

    def get_complete_url(
        self,
        api_base: str | None,
        litellm_params: dict,
    ) -> str:
        """
        Get the base endpoint for Azure AI Search API

        Expected format: https://{search_service_name}.search.windows.net
        """
        if api_base:
            return api_base.rstrip("/")

        # Get search service name from litellm_params
        search_service_name: Final = litellm_params.get("azure_search_service_name")

        if not search_service_name:
            raise ValueError(
                "Azure AI Search service name is required. "
                "Provide it via litellm_params['azure_search_service_name'] or api_base parameter"
            )

        # Azure AI Search endpoint
        return f"https://{search_service_name}.search.windows.net"

    def transform_search_vector_store_request(
        self,
        vector_store_id: str,
        query: str | list[str],
        vector_store_search_optional_params: VectorStoreSearchOptionalRequestParams,
        api_base: str,
        litellm_logging_obj: LiteLLMLoggingObj,
        litellm_params: dict,
        extra_body: dict[str, Any] | None = None,
    ) -> tuple[str, dict[str, Any]]:
        """

View on GitHub (pinned to 6c2dcb801b)

Solutions

  1. Set litellm_params['azure_search_service_name'] = 'my-search-service' (just the name, not the full URL)
  2. Or provide the full endpoint: litellm_params['api_base'] = 'https://my-search-service.search.windows.net'
  3. Double-check the exact key spelling — azure_search_service_name

Example fix

# before
litellm_params={'api_key': key}

# after
litellm_params={'api_key': key, 'azure_search_service_name': 'my-search-service'}
Defensive patterns

Strategy: validation

Validate before calling

if not (litellm_params.get('api_base') or litellm_params.get('azure_search_service_name')):
    raise ValueError('Provide azure_search_service_name or api_base for azure_ai_search')

Prevention

When it happens

Trigger: Using the azure_ai_search vector store provider with litellm_params containing neither api_base nor azure_search_service_name — e.g. only api_key was configured.

Common situations: Assuming the service name is inferred from the API key or index name; passing the full endpoint under a key the config doesn't read (e.g. endpoint instead of api_base); typos like azure_search_service.

Related errors


AI-assisted analysis of BerriAI/litellm@6c2dcb801b (2026-08-15). Data as JSON: /api/errors/3aab71c330f20cdf. Report an issue: GitHub.