mirror of
https://github.com/BerriAI/litellm.git
synced 2025-04-26 19:24:27 +00:00
fix ProxyUpdateSpend
This commit is contained in:
parent
537bed127b
commit
0c1d00864d
1 changed files with 6 additions and 0 deletions
|
@ -13,6 +13,7 @@ from litellm.litellm_core_utils.core_helpers import (
|
||||||
from litellm.litellm_core_utils.litellm_logging import StandardLoggingPayloadSetup
|
from litellm.litellm_core_utils.litellm_logging import StandardLoggingPayloadSetup
|
||||||
from litellm.proxy._types import UserAPIKeyAuth
|
from litellm.proxy._types import UserAPIKeyAuth
|
||||||
from litellm.proxy.auth.auth_checks import log_db_metrics
|
from litellm.proxy.auth.auth_checks import log_db_metrics
|
||||||
|
from litellm.proxy.utils import ProxyUpdateSpend
|
||||||
from litellm.types.utils import (
|
from litellm.types.utils import (
|
||||||
StandardLoggingPayload,
|
StandardLoggingPayload,
|
||||||
StandardLoggingUserAPIKeyMetadata,
|
StandardLoggingUserAPIKeyMetadata,
|
||||||
|
@ -230,6 +231,11 @@ def _should_track_cost_callback(
|
||||||
"""
|
"""
|
||||||
Determine if the cost callback should be tracked based on the kwargs
|
Determine if the cost callback should be tracked based on the kwargs
|
||||||
"""
|
"""
|
||||||
|
|
||||||
|
# don't run track cost callback if user opted into disabling spend
|
||||||
|
if ProxyUpdateSpend.disable_spend_updates() is True:
|
||||||
|
return False
|
||||||
|
|
||||||
if (
|
if (
|
||||||
user_api_key is not None
|
user_api_key is not None
|
||||||
or user_id is not None
|
or user_id is not None
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue