From ed2bd60bd96bd9d8e51e684d75bd0f117d320b67 Mon Sep 17 00:00:00 2001 From: Kai Wu Date: Tue, 25 Feb 2025 11:25:23 -0800 Subject: [PATCH] add ollama embedding config and fix sqlite_vec db --- .../providers/inline/vector_io/sqlite_vec/sqlite_vec.py | 2 +- llama_stack/templates/ollama/run.yaml | 6 ++++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/llama_stack/providers/inline/vector_io/sqlite_vec/sqlite_vec.py b/llama_stack/providers/inline/vector_io/sqlite_vec/sqlite_vec.py index 17865c93e..eb97572d5 100644 --- a/llama_stack/providers/inline/vector_io/sqlite_vec/sqlite_vec.py +++ b/llama_stack/providers/inline/vector_io/sqlite_vec/sqlite_vec.py @@ -162,7 +162,7 @@ class SQLiteVecVectorIOAdapter(VectorIO, VectorDBsProtocolPrivate): async def initialize(self) -> None: # Open a connection to the SQLite database (the file is specified in the config). - self.connection = sqlite3.connect(self.config.db_path) + self.connection = sqlite3.connect(self.config.db_path,check_same_thread=False) self.connection.enable_load_extension(True) sqlite_vec.load(self.connection) self.connection.enable_load_extension(False) diff --git a/llama_stack/templates/ollama/run.yaml b/llama_stack/templates/ollama/run.yaml index d64e07347..48e243482 100644 --- a/llama_stack/templates/ollama/run.yaml +++ b/llama_stack/templates/ollama/run.yaml @@ -87,6 +87,12 @@ models: model_id: ${env.INFERENCE_MODEL} provider_id: ollama model_type: llm +- metadata: + embedding_dimension: 384 + model_id: all-MiniLM-L6-v2 + provider_id: ollama + provider_model_id: all-minilm:latest + model_type: embedding shields: [] vector_dbs: [] datasets: []