From 3b844afd0046057f4bf4fdedb23a8782203a5a92 Mon Sep 17 00:00:00 2001 From: Aidan Do Date: Tue, 17 Dec 2024 09:49:34 +1100 Subject: [PATCH] Ollama Setup --- .gitignore | 4 ++++ .../providers/remote/inference/ollama/ollama.py | 10 +++++----- llama_stack/templates/ollama/run.yaml | 5 +++++ 3 files changed, 14 insertions(+), 5 deletions(-) diff --git a/.gitignore b/.gitignore index 24ce79959..7600a9a00 100644 --- a/.gitignore +++ b/.gitignore @@ -18,3 +18,7 @@ Package.resolved .vscode _build docs/src + +env/ +envs/ +.envrc \ No newline at end of file diff --git a/llama_stack/providers/remote/inference/ollama/ollama.py b/llama_stack/providers/remote/inference/ollama/ollama.py index acd5b62bc..463179d10 100644 --- a/llama_stack/providers/remote/inference/ollama/ollama.py +++ b/llama_stack/providers/remote/inference/ollama/ollama.py @@ -48,10 +48,10 @@ model_aliases = [ "llama3.1:8b-instruct-fp16", CoreModelId.llama3_1_8b_instruct.value, ), - build_model_alias_with_just_provider_model_id( - "llama3.1:8b", - CoreModelId.llama3_1_8b_instruct.value, - ), + # build_model_alias_with_just_provider_model_id( + # "llama3.1:8b", + # CoreModelId.llama3_1_8b_instruct.value, + # ), build_model_alias( "llama3.1:70b-instruct-fp16", CoreModelId.llama3_1_70b_instruct.value, @@ -347,7 +347,7 @@ class OllamaInferenceAdapter(Inference, ModelsProtocolPrivate): ) return model model = await self.register_helper.register_model(model) - models = await self.client.ps() + models = await self.client.list() available_models = [m["model"] for m in models["models"]] if model.provider_resource_id not in available_models: raise ValueError( diff --git a/llama_stack/templates/ollama/run.yaml b/llama_stack/templates/ollama/run.yaml index bcbed3e6e..e0436abba 100644 --- a/llama_stack/templates/ollama/run.yaml +++ b/llama_stack/templates/ollama/run.yaml @@ -79,6 +79,11 @@ models: provider_id: ollama provider_model_id: null model_type: llm +- metadata: {} + model_id: Llama-3.2-3B-Instruct + provider_id: ollama + provider_model_id: null + model_type: llm - metadata: embedding_dimension: 384 model_id: all-MiniLM-L6-v2