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]

get_custom_logger_for_prompt_management

Ishaan Jaffa49bd460e0b0
diff --git a/litellm/litellm_core_utils/litellm_logging.py b/litellm/litellm_core_utils/litellm_logging.py
index b8e7df870bf..0a51fb20727 100644
--- a/litellm/litellm_core_utils/litellm_logging.py
+++ b/litellm/litellm_core_utils/litellm_logging.py
@@ -447,7 +447,9 @@ class Logging(LiteLLMLoggingBaseClass):
self.messages = messages
return model, messages, non_default_params
- def get_custom_logger_for_prompt_management(self, model: str) -> CustomLogger:
+ def get_custom_logger_for_prompt_management(
+ self, model: str
+ ) -> Optional[CustomLogger]:
for (
custom_logger_compatible_callback
) in litellm._known_custom_logger_compatible_callbacks:
@@ -468,7 +470,7 @@ class Logging(LiteLLMLoggingBaseClass):
)
if len(custom_prompt_management_loggers) > 0:
return custom_prompt_management_loggers[0]
- raise ValueError(f"No custom logger found for model: {model}")
+ return None
def _get_raw_request_body(self, data: Optional[Union[dict, str]]) -> dict:
if data is None: