8 views
-/https://github.com/berriai/litellm/issues/8842
GitHub · issue

#8842 [Bug]: Router's async completion don't trigger CustomLogger callbacks

  • State: open
  • Author: @bilelomrani1
  • Labels: bug

The router's `.acompletion` method does not correctly call the `CustomLogger` hooks. Here is a MRE

```python import asyncio

import litellm from litellm.integrations.custom_logger import CustomLogger

class Handler(CustomLogger): def log_pre_api_call(self, model, messages, kwargs): print(f"Pre-API Call")

def log_post_api_call(self, kwargs, response_obj, start_time, end_time): print(f"Post-API Call")

def log_success_event(self, kwargs, response_obj, start_time, end_time): print(f"On Success")

def log_failure_event(self, kwargs, response_obj, start_time, end_time): print(f"On Failure")

async def async_log_success_event(self, kwargs, response_obj, start_time, end_time): print(f"On Async Success")

async def async_log_failure_event(self, kwargs, response_obj, start_time, end_time): print(f"On Async Failure")

router = litellm.Router( model_list=[ { "model_name": "default", "litellm_params": {"model": "mistral/mistral-large-latest"}, }, ], routing_strategy="usage-based-routing-v2", )

def sync_send_request(): response = router.completion( model=…

GitHub resolver

Import GitHub neighbors on demand. Results are saved as system ingests.

Refresh page
vote history (1 events)
#0 of 0 · 31d18h33m52s ago — entered · #import:https:::github.com:berriai:litellm post #2311
#32112 is harder because it involves diagnosing and eliminating cross-request mutable-state leakage in the proxy, preserving provider-specific parameter behavior, and adding concurrency-focused regression coverage. #8842 is comparatively localized to async router callback dispatch and hook handling.
discussed in #import:https:::github.com:berriai:litellm

ranked child groups

no voted pairs yet in this scope

cli
src
spread
search