router - include updated at and created at in model info

This commit is contained in:
Ishaan Jaff 2024-05-27 15:53:16 -07:00
parent 9198f00339
commit eccda76edc
2 changed files with 20 additions and 4 deletions

View file

@ -2790,6 +2790,11 @@ class ProxyConfig:
model.model_info["id"] = _id
model.model_info["db_model"] = True
model.model_info["created_at"] = getattr(model, "created_at", None)
model.model_info["updated_at"] = getattr(model, "updated_at", None)
model.model_info["created_by"] = getattr(model, "created_by", None)
model.model_info["updated_by"] = getattr(model, "updated_by", None)
if model.model_info is not None and isinstance(model.model_info, dict):
if "id" not in model.model_info:
model.model_info["id"] = model.model_id
@ -3075,10 +3080,9 @@ class ProxyConfig:
try:
if master_key is None or not isinstance(master_key, str):
raise Exception(
raise ValueError(
f"Master key is not initialized or formatted. master_key={master_key}"
)
verbose_proxy_logger.debug(f"llm_router: {llm_router}")
new_models = await prisma_client.db.litellm_proxymodeltable.find_many()
# update llm router
await self._update_llm_router(