diff --git a/xinference/core/supervisor.py b/xinference/core/supervisor.py index c8837f7a84..8eefe4b39d 100644 --- a/xinference/core/supervisor.py +++ b/xinference/core/supervisor.py @@ -57,6 +57,8 @@ ASYNC_LAUNCH_TASKS = {} # type: ignore +RESERVED_MODEL_UIDS = ["prompts", "families", "vllm-supported", "instances"] + def callback_for_async_launch(model_uid: str): ASYNC_LAUNCH_TASKS.pop(model_uid, None) @@ -747,6 +749,11 @@ async def launch_builtin_model( if model_uid is None: model_uid = self._gen_model_uid(model_name) + else: + if model_uid in RESERVED_MODEL_UIDS: + raise ValueError( + f"Model uid cannot be the reserved name: '{model_uid}'." + ) model_size = str(model_size_in_billions) if model_size_in_billions else "" logger.debug(