The fastest, litest AI Gateway. Rust core with Python SDK. Call 100+ LLM APIs in OpenAI (or native) format with cost tracking, guardrails, load balancing, and logging [Bedrock, Azure, OpenAI, Anthropic, OpenAI, VertexAI, vLLM, Nvidia NIM]
Python ai-gatewayanthropicazure-openaibedrockgatewaylangchainlitellmllmllm-gatewayllmopsmcp-gatewayopenaiopenai-proxyrustrust-aivertex-ai
fix: only show semantic tool filter warning when feature is configured (#20651)
Krish Dholakiad26878af70e8
diff --git a/litellm/proxy/proxy_server.py b/litellm/proxy/proxy_server.pyindex 22d63579986..294294cdda7 100644--- a/litellm/proxy/proxy_server.py+++ b/litellm/proxy/proxy_server.py@@ -4942,24 +4942,29 @@ class ProxyStartupEvent:"""Initialize MCP semantic tool filter if configured"""from litellm.proxy.hooks.mcp_semantic_filter import SemanticToolFilterHook- verbose_proxy_logger.info(+ mcp_semantic_filter_config = litellm_settings.get("mcp_semantic_tool_filter", None)++ # Only proceed if the feature is configured and enabled+ if not mcp_semantic_filter_config or not mcp_semantic_filter_config.get("enabled", False):+ verbose_proxy_logger.debug("Semantic tool filter not configured or not enabled, skipping initialization")+ return++ verbose_proxy_logger.debug(f"Initializing semantic tool filter: llm_router={llm_router is not None}, "- f"litellm_settings keys={list(litellm_settings.keys())}"+ f"config={mcp_semantic_filter_config}")- mcp_semantic_filter_config = litellm_settings.get("mcp_semantic_tool_filter", None)- verbose_proxy_logger.debug(f"Semantic filter config: {mcp_semantic_filter_config}")-hook = await SemanticToolFilterHook.initialize_from_config(config=mcp_semantic_filter_config,llm_router=llm_router,)if hook:- verbose_proxy_logger.debug("✅ Semantic tool filter hook registered")+ verbose_proxy_logger.debug("Semantic tool filter hook registered")litellm.logging_callback_manager.add_litellm_callback(hook)else:- verbose_proxy_logger.warning("❌ Semantic tool filter hook not initialized")+ # Only warn if the feature was configured but failed to initialize+ verbose_proxy_logger.warning("Semantic tool filter hook was configured but failed to initialize")@classmethoddef _initialize_jwt_auth(