forked from phoenix/litellm-mirror
Merge pull request #3715 from BerriAI/litellm_model_id_fix
fix(proxy_server.py): fix setting model id for db models
This commit is contained in:
commit
8d25a7b9dc
3 changed files with 6 additions and 9 deletions
|
@ -18,11 +18,3 @@ model_list:
|
|||
|
||||
router_settings:
|
||||
enable_pre_call_checks: true
|
||||
|
||||
litellm_settings:
|
||||
success_callback: ["langfuse"]
|
||||
failure_callback: ["langfuse"]
|
||||
|
||||
general_settings:
|
||||
alerting: ["slack"]
|
||||
|
|
@ -2603,6 +2603,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
|
||||
|
|
|
@ -102,7 +102,7 @@ async def test_delete_deployment():
|
|||
pc = ProxyConfig()
|
||||
|
||||
db_model = DBModel(
|
||||
model_id="12340523",
|
||||
model_id=deployment.model_info.id,
|
||||
model_name="gpt-3.5-turbo",
|
||||
litellm_params=encrypted_litellm_params,
|
||||
model_info={"id": deployment.model_info.id},
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue