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/main' into litellm_prompt_injection_async_llm_check

yucheng2cbfd280e91d
diff --cc litellm/proxy/proxy_server.py
index 2e8f7778a80,d7d8413d2ce..3af9aeccd69
--- a/litellm/proxy/proxy_server.py
+++ b/litellm/proxy/proxy_server.py
@@@ -9336,14 -9356,11 +9355,19 @@@ def giveup(e)
class ProxyStartupEvent:
+ @staticmethod
+ def _attach_router_to_prompt_injection_detectors(llm_router: Router | None) -> None:
+ for callback in litellm.logging_callback_manager.get_custom_loggers_for_type(
+ _OPTIONAL_PromptInjectionDetection
+ ):
+ if isinstance(callback, _OPTIONAL_PromptInjectionDetection):
+ callback.update_environment(router=llm_router)
+
+ @staticmethod
+ async def refresh_model_info() -> None:
+ if llm_router is not None:
+ await llm_router.arefresh_model_info()
+
@staticmethod
def _warn_budget_without_db(max_budget: float | None, prisma_client: PrismaClient | None) -> None:
if prisma_client is not None or not max_budget or max_budget <= 0: