mirror of
https://github.com/meta-llama/llama-stack.git
synced 2025-08-12 13:00:39 +00:00
fix: Unregister a model from registry if not being served
Signed-off-by: Yuan Tang <terrytangyuan@gmail.com>
This commit is contained in:
parent
b890d7a611
commit
6abfe0c43b
1 changed files with 2 additions and 1 deletions
|
@ -231,7 +231,7 @@ class VLLMInferenceAdapter(Inference, ModelsProtocolPrivate):
|
|||
pass
|
||||
|
||||
async def unregister_model(self, model_id: str) -> None:
|
||||
pass
|
||||
await self.register_helper.unregister_model(model_id)
|
||||
|
||||
async def completion(
|
||||
self,
|
||||
|
@ -342,6 +342,7 @@ class VLLMInferenceAdapter(Inference, ModelsProtocolPrivate):
|
|||
res = self.client.models.list()
|
||||
available_models = [m.id for m in res]
|
||||
if model.provider_resource_id not in available_models:
|
||||
await self.unregister_model(model.provider_resource_id)
|
||||
raise ValueError(
|
||||
f"Model {model.provider_resource_id} is not being served by vLLM. "
|
||||
f"Available models: {', '.join(available_models)}"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue