Commit graph

2 commits

Author SHA1 Message Date
Thomas Menard
014f6d68a3 fix: connect fetch_tools to proxy server config parsing
Adds parse_fetch_tools() method and integrates fetch_tools into:
- ProxyConfig._load_router_config() - reads from YAML config
- _update_llm_router() - hot-reload from database config

fetch_tools can now be configured in proxy_config.yaml:
  fetch_tools:
    - fetch_tool_name: "my-firecrawl"
      litellm_params:
        fetch_provider: "firecrawl"
        api_key: "os.environ/FIRECRAWL_API_KEY"

Also fixes mock in test_webfetch_interception.py (ui_friendly_name).
2026-05-03 17:26:35 +02:00
Thomas Menard
097ad9c9ce feat: add WebFetch interception with Firecrawl support
Implements server-side WebFetch tool interception for LLMs that don't
natively support web fetch (e.g., Bedrock/Claude).

Features:
- Intercepts litellm_web_fetch tool calls via agentic loop
- Supports Anthropic native format (web_fetch_20250305) conversion
- Firecrawl integration via /scrape endpoint with markdown output
- Modular provider architecture (BaseFetchConfig pattern)
- Full coexistence with WebSearch interception (chaining supported)
- Router fetch_tools configuration (Pattern A)
- Proxy YAML config support (webfetch_interception params)
- No public API (transparent, internal only)

Files added:
- litellm/integrations/webfetch_interception/ (handler, tools, transformation)
- litellm/llms/base_llm/fetch/ (BaseFetchConfig, WebFetchResponse)
- litellm/llms/firecrawl/fetch/ (FirecrawlFetchConfig)
- litellm/types/integrations/webfetch_interception.py (types)
- tests/webfetch_tests/ (27 tests, all passing)

Files modified:
- litellm/constants.py (add LITELLM_WEB_FETCH_TOOL_NAME)
- litellm/router.py (add fetch_tools to Router)
- litellm/types/router.py (add FetchToolTypedDict)
- litellm/utils.py (add get_provider_fetch_config)
- litellm/proxy/common_utils/callback_utils.py (add webfetch_interception)

Tested: 27/27 tests passing
2026-05-03 17:26:35 +02:00