fix vllm registry

This commit is contained in:
Dinesh Yeduguru 2024-11-13 12:12:22 -08:00
parent a019011326
commit e272f8aa62
3 changed files with 10 additions and 4 deletions

View file

@ -283,10 +283,7 @@ class OllamaInferenceAdapter(Inference, ModelRegistryHelper, ModelsProtocolPriva
raise NotImplementedError()
async def register_model(self, model: Model) -> Model:
# First perform the parent class's registration check
model = await super().register_model(model)
# Additional Ollama-specific check
models = await self.client.ps()
available_models = [m["model"] for m in models["models"]]
if model.provider_resource_id not in available_models: