mirror of
https://github.com/BerriAI/litellm.git
synced 2026-12-05 01:59:27 +00:00
* feat(mcp): re-rank mcp_tool_search results with a rerank model Adds an optional `litellm_settings.mcp_tool_search.rerank_model`, a model_name from model_list. When it is set, the keyword or embedding stage keeps up to 50 candidates and one /rerank call through the router re-orders them before top_k is applied. The call runs the same pre-call hooks as /rerank and is billed to the calling key. A provider error, timeout or invalid answer keeps the base order. Rate-limit and guardrail refusals still reach the caller. The Admin UI settings form carries the field so a save does not drop it. * fix(mcp): resolve the caller's guardrails before the tool search rerank call The rerank sub-call now attaches key, team, project and policy guardrails to its request metadata the same way /rerank does, so guardrails assigned to the caller run on it. * fix(mcp): forward the caller's model region on the tool search rerank call The rerank sub-call now passes allowed_model_region to the router when the caller has one, as the /rerank request setup does, so region-restricted keys keep their routing checks. * refactor(mcp): send the tool search rerank call through the proxy's /rerank routing The rerank sub-call now goes through route_request like /rerank, so team model aliases and blocked models apply, and a rerank_model missing from model_list keeps the base order * fix(mcp): check the caller's model access before the tool search rerank call A key or team whose model allowlist or per-model budget excludes the rerank model now keeps the keyword or embedding order, with no rerank call and no spend, using the same caller checks compaction's sub-call runs * fix(mcp): count the tool search rerank call against the caller's per-model budgets The rerank sub-call now carries the key, team, user, team member and end user model budgets in its metadata, so the budget tracker charges its spend and the caller gate refuses the next call once a budget is spent * fix(mcp): keep the base order on every rerank failure, log rerank with caller tags and redaction opt-in, rerank the whole catalog in keyword mode, warn on an unroutable rerank_model * fix(mcp): send inherited_tags with the tool search rerank so key and team tag rules route it like /rerank * fix(mcp): free the key's rate-limit slot and keep the base order when any guardrail blocks the tool search rerank * fix(mcp): bound the tool search rerank call, warn on a non-rerank rerank_model, and log it to the key's and team's callbacks A failed rerank after the pre-call hooks now reports the dict they returned, like /rerank, so a masked query stays masked in failure logs * test(proxy): keep the settings endpoint tests in their original layout The previous commit reformatted the whole file. This keeps only the new rerank_model mode warning test * fix(mcp): bound every tool search rerank step by one timeout, free its rate-limit slot on cancel, and check sub-call budgets by the sub-call's model * fix(mcp): run each tool search rerank step in the calling task so the failure hook frees the rate-limit slot on Python 3.10 and 3.11 * fix(mcp): skip the rerank_model mode warning for names only a wildcard, default deployment or pass-through matches --------- Co-authored-by: Xytronix <32957125+Xytronix@users.noreply.github.com> |
||
|---|---|---|
| .. | ||
| a2a | ||
| access_control | ||
| batches | ||
| claude_code | ||
| cli_harness | ||
| codex | ||
| coverage_registry | ||
| gateway | ||
| guardrails | ||
| llm_translation | ||
| logging | ||
| management | ||
| mcp | ||
| migrations | ||
| other | ||
| perf | ||
| quota_management | ||
| router | ||
| ui | ||
| AGENTS.md | ||
| conftest.py | ||
| CONTRIBUTING.md | ||
| e2e_config.py | ||
| e2e_db.py | ||
| e2e_http.py | ||
| e2e_metadata.py | ||
| fixture_bundle.py | ||
| fixture_canonical.py | ||
| fixture_mode.py | ||
| fixture_profile.py | ||
| idp.py | ||
| idp_realm.json | ||
| junit_properties.py | ||
| lifecycle.py | ||
| memory_readings.py | ||
| models.py | ||
| otel_client.py | ||
| PROVIDER_CACHE.md | ||
| provider_cache.py | ||
| provider_cache_redis.py | ||
| provider_cache_routing.py | ||
| provider_edge.py | ||
| provider_edge_bedrock.py | ||
| proxy_client.py | ||
| pytest.ini | ||
| transport.py | ||