Skip to content

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]

Merge remote-tracking branch 'origin/litellm_internal_staging' into litellm_python_version_ci

mateo-berri71f5b89499b9
diff --cc tests/logging_callback_tests/test_bedrock_knowledgebase_hook.py
index 6b162ea90f1,63bad6d0e22..9faaaf492e8
--- a/tests/logging_callback_tests/test_bedrock_knowledgebase_hook.py
+++ b/tests/logging_callback_tests/test_bedrock_knowledgebase_hook.py
@@@ -376,7 -376,7 +376,6 @@@ async def test_bedrock_kb_request_body_
timeout=None,
client=None,
_is_async=False,
- router: "litellm.Router | None" = None,
- embedding_executor=None,
):
litellm_params_dict = (
litellm_params.model_dump(exclude_none=False)
diff --cc tests/test_litellm/vector_stores/test_main.py
index 21f4165bd26,234e0b01094..e3575c33b17
--- a/tests/test_litellm/vector_stores/test_main.py
+++ b/tests/test_litellm/vector_stores/test_main.py
@@@ -9,9 -9,10 +9,12 @@@ model_dump() it (the #19550 serializati
from unittest.mock import MagicMock, patch
+import pytest
+
import litellm.vector_stores.main as vector_stores_main
+ from litellm.llms.base_llm.vector_store.transformation import (
+ RouterVectorStoreEmbeddingExecutor,
+ )
from litellm.vector_stores.main import search
MOCK_SEARCH_RESPONSE = {
@@@ -21,9 -22,9 +24,10 @@@
}
-def test_search_wraps_router_into_the_handler_embedding_executor():
[email protected]("query", ["q", ["q", "another question"]])
- def test_search_threads_router_to_handler(query: str | list[str]):
- """search() must pass its router param through to the HTTP handler"""
++def test_search_wraps_router_into_the_handler_embedding_executor(query: str | list[str]):
+ """search() hands the HTTP handler a Router-backed embedding executor carrying the
+ request metadata, and no bare router kwarg (LIT-6750)"""
mock_router = MagicMock()
logger = MagicMock()
@@@ -48,8 -50,11 +53,12 @@@
assert response == MOCK_SEARCH_RESPONSE
mock_handler.assert_called_once()
- assert mock_handler.call_args.kwargs["router"] is mock_router
+ assert "router" not in mock_handler.call_args.kwargs
+ assert mock_handler.call_args.kwargs["query"] == query
+ executor = mock_handler.call_args.kwargs["embedding_executor"]
+ assert isinstance(executor, RouterVectorStoreEmbeddingExecutor)
+ assert executor.router is mock_router
+ assert dict(executor.metadata) == {"user_api_key_team_id": "team-a"}
def test_search_router_not_in_litellm_params():
diff --cc type-discipline-budget.json
index 2c018a412b5,d5bf3883be4..6c316d2eca1
--- a/type-discipline-budget.json
+++ b/type-discipline-budget.json
@@@ -27,12 -27,12 +27,12 @@@
"limit": 0
},
"LIT010": {
- "limit": 16478
+ "limit": 16477
},
"LIT011": {
- "limit": 5520
+ "limit": 5519
},
"LIT012": {
- "limit": 4489
+ "limit": 4488
}
}