feat(schema.prisma): store model id + model group as part of spend logs

allows precise model metrics
This commit is contained in:
Krrish Dholakia 2024-05-22 17:29:44 -07:00
parent 9f518030b9
commit 3c0e9cb48e
5 changed files with 1215 additions and 800 deletions

View file

@ -1874,6 +1874,9 @@ def get_logging_payload(
# hash the api_key
api_key = hash_token(api_key)
_model_id = metadata.get("model_info", {}).get("id", "")
_model_group = metadata.get("model_group", "")
# clean up litellm metadata
if isinstance(metadata, dict):
clean_metadata = {}
@ -1928,6 +1931,8 @@ def get_logging_payload(
"request_tags": metadata.get("tags", []),
"end_user": end_user_id or "",
"api_base": litellm_params.get("api_base", ""),
"model_group": _model_group,
"model_id": _model_id,
}
verbose_proxy_logger.debug("SpendTable: created payload - payload: %s\n\n", payload)