{"record":{"id":"731c3b7ea1490833","repo":"BerriAI/litellm","slug":"search-provider-not-found-in-litellm-params-for-se","errorCode":null,"errorMessage":"search_provider not found in litellm_params for search tool '{search_tool_name}'","messagePattern":"search_provider not found in litellm_params for search tool '(.+?)'","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"litellm/router_utils/search_api_router.py","lineNumber":212,"sourceCode":"        \"\"\"\n        search_tool_name: Final = model  # model field contains the search_tool_name\n\n        try:\n            # Find matching search tools\n            matching_tools: Final = SearchAPIRouter.get_matching_search_tools(\n                router_instance=router_instance,\n                search_tool_name=search_tool_name,\n            )\n\n            # Simple random selection for load balancing across multiple providers with same name\n            # For search tools, we use simple random choice since they don't have TPM/RPM constraints\n            selected_tool: Final = random.choice(matching_tools)\n\n            # Extract search provider and other params from litellm_params\n            litellm_params: Final = selected_tool.get(\"litellm_params\", {})\n            search_provider: Final = litellm_params.get(\"search_provider\")\n            if not search_provider:\n                raise ValueError(f\"search_provider not found in litellm_params for search tool '{search_tool_name}'\")\n\n            api_key, api_base = SearchAPIRouter._resolve_search_provider_credentials(\n                tool_litellm_params=litellm_params,\n            )\n\n            verbose_router_logger.debug(\"Selected search tool with provider: %s\", search_provider)\n\n            # Call the original search function with the provider config\n            response: Final = await original_generic_function(\n                search_provider=search_provider,\n                api_key=api_key,\n                api_base=api_base,\n                **kwargs,\n            )\n\n            return response\n\n        except Exception as e:","sourceCodeStart":194,"sourceCodeEnd":230,"githubUrl":"https://github.com/BerriAI/litellm/blob/77b7c6c40c0c5aa5fbcb1d6a1825ac39ca8829b8/litellm/router_utils/search_api_router.py#L194-L230","documentation":"Config guard in the search API router: the selected search tool entry has no search_provider key in its litellm_params, so the router cannot determine which provider handler to invoke for it.","triggerScenarios":"Thrown at litellm/router_utils/search_api_router.py:212 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Add search_provider to the search tool's litellm_params."],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"77b7c6c40c0c5aa5fbcb1d6a1825ac39ca8829b8","analyzedAt":"2026-08-18T11:44:31.656Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}