diff --git a/litellm/proxy/pass_through_endpoints/success_handler.py b/litellm/proxy/pass_through_endpoints/success_handler.py index c9c7707f0..b603510ff 100644 --- a/litellm/proxy/pass_through_endpoints/success_handler.py +++ b/litellm/proxy/pass_through_endpoints/success_handler.py @@ -18,6 +18,7 @@ from litellm.llms.vertex_ai_and_google_ai_studio.gemini.vertex_and_google_ai_stu from litellm.proxy._types import PassThroughEndpointLoggingResultValues from litellm.proxy.auth.user_api_key_auth import user_api_key_auth from litellm.types.utils import StandardPassThroughResponseObject +from litellm.utils import executor as thread_pool_executor from .llm_provider_handlers.anthropic_passthrough_logging_handler import ( AnthropicPassthroughLoggingHandler, @@ -93,15 +94,16 @@ class PassThroughEndpointLogging: standard_logging_response_object = StandardPassThroughResponseObject( response=httpx_response.text ) - threading.Thread( - target=logging_obj.success_handler, + thread_pool_executor.submit( + logging_obj.success_handler, args=( standard_logging_response_object, start_time, end_time, cache_hit, ), - ).start() + ) + await logging_obj.async_success_handler( result=( json.dumps(result) diff --git a/litellm/proxy/proxy_config.yaml b/litellm/proxy/proxy_config.yaml index 13fb1bcbe..40cd86c5c 100644 --- a/litellm/proxy/proxy_config.yaml +++ b/litellm/proxy/proxy_config.yaml @@ -21,4 +21,5 @@ router_settings: redis_password: os.environ/REDIS_PASSWORD litellm_settings: - callbacks: ["prometheus"] \ No newline at end of file + callbacks: ["prometheus"] + success_callback: ["langfuse"] \ No newline at end of file