From ae1bcb9593f0888ec3d47a57ffba21853d1dc595 Mon Sep 17 00:00:00 2001 From: Ashwin Bharambe Date: Fri, 21 Feb 2025 10:13:45 -0800 Subject: [PATCH] Pull ollama embedding model if necessary --- llama_stack/providers/remote/inference/ollama/ollama.py | 2 ++ llama_stack/templates/ollama/build.yaml | 1 + 2 files changed, 3 insertions(+) diff --git a/llama_stack/providers/remote/inference/ollama/ollama.py b/llama_stack/providers/remote/inference/ollama/ollama.py index 62c8381a8..f61ac9898 100644 --- a/llama_stack/providers/remote/inference/ollama/ollama.py +++ b/llama_stack/providers/remote/inference/ollama/ollama.py @@ -281,6 +281,8 @@ class OllamaInferenceAdapter(Inference, ModelsProtocolPrivate): async def register_model(self, model: Model) -> Model: if model.model_type == ModelType.embedding: + log.info(f"Pulling embedding model `{model.provider_resource_id}` if necessary...") + await self.client.pull(model.provider_resource_id) response = await self.client.list() else: response = await self.client.ps() diff --git a/llama_stack/templates/ollama/build.yaml b/llama_stack/templates/ollama/build.yaml index 0fee6808c..48960c5ba 100644 --- a/llama_stack/templates/ollama/build.yaml +++ b/llama_stack/templates/ollama/build.yaml @@ -6,6 +6,7 @@ distribution_spec: - remote::ollama vector_io: - inline::faiss + - inline::sqlite_vec - remote::chromadb - remote::pgvector safety: