mirror of
https://github.com/BerriAI/litellm.git
synced 2025-04-25 18:54:30 +00:00
(fix) use litellm.cache for getting key
This commit is contained in:
parent
2130a61b6e
commit
bf851ef19a
2 changed files with 4 additions and 7 deletions
|
@ -1382,8 +1382,6 @@ async def initialize(
|
|||
verbose_proxy_logger.setLevel(
|
||||
level=logging.DEBUG
|
||||
) # set proxy logs to debug
|
||||
litellm.set_verbose = True
|
||||
|
||||
dynamic_config = {"general": {}, user_model: {}}
|
||||
if config:
|
||||
(
|
||||
|
|
|
@ -995,15 +995,14 @@ def get_logging_payload(kwargs, response_obj, start_time, end_time):
|
|||
if api_key is not None and isinstance(api_key, str) and api_key.startswith("sk-"):
|
||||
# hash the api_key
|
||||
api_key = hash_token(api_key)
|
||||
from litellm.caching import Cache
|
||||
|
||||
c = Cache()
|
||||
cache_key = c.get_cache_key(**kwargs)
|
||||
|
||||
if "headers" in metadata and "authorization" in metadata["headers"]:
|
||||
metadata["headers"].pop(
|
||||
"authorization"
|
||||
) # do not store the original `sk-..` api key in the db
|
||||
if litellm.cache is not None:
|
||||
cache_key = litellm.cache.get_cache_key(**kwargs)
|
||||
else:
|
||||
cache_key = "Cache OFF"
|
||||
|
||||
payload = {
|
||||
"request_id": id,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue