From 322aefb97d843449078626dbddd9630cd4e37a2e Mon Sep 17 00:00:00 2001 From: Cole McIntosh <82463175+colesmcintosh@users.noreply.github.com> Date: Mon, 9 Jun 2025 16:19:57 -0600 Subject: [PATCH] Update documentation for configuring web search options in config.yaml (#11537) * Update web_search.md to include new supported providers and models, enhance web search options, and improve documentation for using web search with various AI models. * Update LiteLLM version in web_search.md to reflect the latest stable release. * Fix formatting in web_search.md for model declaration consistency. * docs(web_search.md): add configuration options for web search in config.yaml This update introduces sections for setting default and custom web search options in the proxy config file, including examples for different models and context sizes. A note clarifies that users can override these settings in API requests. --- docs/my-website/docs/completion/web_search.md | 48 +++++++++++++++++++ 1 file changed, 48 insertions(+) diff --git a/docs/my-website/docs/completion/web_search.md b/docs/my-website/docs/completion/web_search.md index 18ea8c9b4f..b0c77debe3 100644 --- a/docs/my-website/docs/completion/web_search.md +++ b/docs/my-website/docs/completion/web_search.md @@ -308,10 +308,58 @@ print(response.output_text) +## Configuring Web Search in config.yaml +You can set default web search options directly in your proxy config file: + + +```yaml +model_list: + # Enable web search by default for all requests to this model + - model_name: grok-3 + litellm_params: + model: xai/grok-3 + api_key: os.environ/XAI_API_KEY + web_search_options: {} # Enables web search with default settings +``` + + + +```yaml +model_list: + # Set custom web search context size + - model_name: grok-3 + litellm_params: + model: xai/grok-3 + api_key: os.environ/XAI_API_KEY + web_search_options: + search_context_size: "high" # Options: "low", "medium", "high" + + # Different context size for different models + - model_name: gpt-4o-search-preview + litellm_params: + model: openai/gpt-4o-search-preview + api_key: os.environ/OPENAI_API_KEY + web_search_options: + search_context_size: "low" + + # Gemini with medium context (default) + - model_name: gemini-2-flash + litellm_params: + model: gemini-2.0-flash + vertex_project: your-project-id + vertex_location: us-central1 + web_search_options: + search_context_size: "medium" +``` + + + + +**Note:** When `web_search_options` is set in the config, it applies to all requests to that model. Users can still override these settings by passing `web_search_options` in their API requests. ## Checking if a model supports web search