Use the list endpoint instead of ps to get ollama's models

This commit is contained in:
Geronimo De Abreu 2024-11-08 00:40:18 -05:00
parent 6192bf43a4
commit e178081be5

View file

@ -72,7 +72,7 @@ class OllamaInferenceAdapter(Inference, ModelsProtocolPrivate):
ollama_to_llama = {v: k for k, v in OLLAMA_SUPPORTED_MODELS.items()}
ret = []
res = await self.client.ps()
res = await self.client.list()
for r in res["models"]:
if r["model"] not in ollama_to_llama:
print(f"Ollama is running a model unknown to Llama Stack: {r['model']}")