mirror of
https://github.com/BerriAI/litellm.git
synced 2025-04-26 11:14:04 +00:00
fix(proxy_server.py): fix setting model id for db models
get model_id and use that as it's id in router, this enables `/model/delete` to work with the given id from `/model/info`
This commit is contained in:
parent
afd2d73b33
commit
b137cea230
2 changed files with 7 additions and 2 deletions
|
@ -14,5 +14,5 @@ model_list:
|
|||
router_settings:
|
||||
enable_pre_call_checks: true
|
||||
|
||||
general_settings:
|
||||
master_key: sk-1234 # [OPTIONAL] Use to enforce auth on proxy. See - https://docs.litellm.ai/docs/proxy/virtual_keys
|
||||
# general_settings:
|
||||
# master_key: sk-1234 # [OPTIONAL] Use to enforce auth on proxy. See - https://docs.litellm.ai/docs/proxy/virtual_keys
|
||||
|
|
|
@ -2597,6 +2597,11 @@ class ProxyConfig:
|
|||
|
||||
Return model info w/ id
|
||||
"""
|
||||
_id: Optional[str] = getattr(model, "model_id", None)
|
||||
if _id is not None:
|
||||
model.model_info["id"] = _id
|
||||
model.model_info["db_model"] = True
|
||||
|
||||
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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue