Skip to content

Commit 068f1af

Browse files
committed
fix use thread_pool_executor for pass through logging
1 parent 68408c4 commit 068f1af

File tree

2 files changed

+7
-4
lines changed

2 files changed

+7
-4
lines changed

litellm/proxy/pass_through_endpoints/success_handler.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
from litellm.proxy._types import PassThroughEndpointLoggingResultValues
1919
from litellm.proxy.auth.user_api_key_auth import user_api_key_auth
2020
from litellm.types.utils import StandardPassThroughResponseObject
21+
from litellm.utils import executor as thread_pool_executor
2122

2223
from .llm_provider_handlers.anthropic_passthrough_logging_handler import (
2324
AnthropicPassthroughLoggingHandler,
@@ -93,15 +94,16 @@ async def pass_through_async_success_handler(
9394
standard_logging_response_object = StandardPassThroughResponseObject(
9495
response=httpx_response.text
9596
)
96-
threading.Thread(
97-
target=logging_obj.success_handler,
97+
thread_pool_executor.submit(
98+
logging_obj.success_handler,
9899
args=(
99100
standard_logging_response_object,
100101
start_time,
101102
end_time,
102103
cache_hit,
103104
),
104-
).start()
105+
)
106+
105107
await logging_obj.async_success_handler(
106108
result=(
107109
json.dumps(result)

litellm/proxy/proxy_config.yaml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,4 +21,5 @@ router_settings:
2121
redis_password: os.environ/REDIS_PASSWORD
2222

2323
litellm_settings:
24-
callbacks: ["prometheus"]
24+
callbacks: ["prometheus"]
25+
success_callback: ["langfuse"]

0 commit comments

Comments
 (0)