diff --git a/litellm/proxy/utils.py b/litellm/proxy/utils.py index 789125b822..faa73d70b8 100644 --- a/litellm/proxy/utils.py +++ b/litellm/proxy/utils.py @@ -722,9 +722,14 @@ class PrismaClient: data_json = self.jsonify_object(data=user.model_dump()) except: data_json = self.jsonify_object(data=user.dict()) - batcher.litellm_usertable.update( + batcher.litellm_usertable.upsert( where={"user_id": user.user_id}, # type: ignore - data={**data_json}, # type: ignore + data={ + "create": {**data_json}, # type: ignore + "update": { + **data_json # type: ignore + }, # just update user-specified values, if it already exists + }, ) await batcher.commit() verbose_proxy_logger.info(