diff --git a/llama_stack/distributions/ci-tests/build.yaml b/llama_stack/distributions/ci-tests/build.yaml index a4d920cd6..e4cb7adf8 100644 --- a/llama_stack/distributions/ci-tests/build.yaml +++ b/llama_stack/distributions/ci-tests/build.yaml @@ -25,6 +25,7 @@ distribution_spec: - provider_type: inline::milvus - provider_type: remote::chromadb - provider_type: remote::pgvector + - provider_type: remote::mongodb files: - provider_type: inline::localfs safety: diff --git a/llama_stack/distributions/ci-tests/run.yaml b/llama_stack/distributions/ci-tests/run.yaml index b14477a9a..7a93050a7 100644 --- a/llama_stack/distributions/ci-tests/run.yaml +++ b/llama_stack/distributions/ci-tests/run.yaml @@ -129,6 +129,19 @@ providers: kvstore: type: sqlite db_path: ${env.SQLITE_STORE_DIR:=~/.llama/distributions/ci-tests}/pgvector_registry.db + - provider_id: ${env.MONGODB_CONNECTION_STRING:+mongodb_atlas} + provider_type: remote::mongodb + config: + connection_string: ${env.MONGODB_CONNECTION_STRING} + database_name: llama_stack + index_name: vector_index + path_field: embedding + similarity_metric: cosine + max_pool_size: 100 + timeout_ms: 30000 + kvstore: + type: sqlite + db_path: ${env.SQLITE_STORE_DIR:=~/.llama/distributions/ci-tests}/mongodb_registry.db files: - provider_id: meta-reference-files provider_type: inline::localfs diff --git a/llama_stack/distributions/starter-gpu/build.yaml b/llama_stack/distributions/starter-gpu/build.yaml index 05a2bf180..679bdb80e 100644 --- a/llama_stack/distributions/starter-gpu/build.yaml +++ b/llama_stack/distributions/starter-gpu/build.yaml @@ -26,6 +26,7 @@ distribution_spec: - provider_type: inline::milvus - provider_type: remote::chromadb - provider_type: remote::pgvector + - provider_type: remote::mongodb files: - provider_type: inline::localfs safety: diff --git a/llama_stack/distributions/starter-gpu/run.yaml b/llama_stack/distributions/starter-gpu/run.yaml index de5fe5681..9af1f5c17 100644 --- a/llama_stack/distributions/starter-gpu/run.yaml +++ b/llama_stack/distributions/starter-gpu/run.yaml @@ -129,6 +129,19 @@ providers: kvstore: type: sqlite db_path: ${env.SQLITE_STORE_DIR:=~/.llama/distributions/starter-gpu}/pgvector_registry.db + - provider_id: ${env.MONGODB_CONNECTION_STRING:+mongodb_atlas} + provider_type: remote::mongodb + config: + connection_string: ${env.MONGODB_CONNECTION_STRING} + database_name: llama_stack + index_name: vector_index + path_field: embedding + similarity_metric: cosine + max_pool_size: 100 + timeout_ms: 30000 + kvstore: + type: sqlite + db_path: ${env.SQLITE_STORE_DIR:=~/.llama/distributions/starter-gpu}/mongodb_registry.db files: - provider_id: meta-reference-files provider_type: inline::localfs diff --git a/llama_stack/distributions/starter/build.yaml b/llama_stack/distributions/starter/build.yaml index 2f0cd24fd..8b5b541e1 100644 --- a/llama_stack/distributions/starter/build.yaml +++ b/llama_stack/distributions/starter/build.yaml @@ -26,6 +26,7 @@ distribution_spec: - provider_type: inline::milvus - provider_type: remote::chromadb - provider_type: remote::pgvector + - provider_type: remote::mongodb files: - provider_type: inline::localfs safety: diff --git a/llama_stack/distributions/starter/run.yaml b/llama_stack/distributions/starter/run.yaml index c440e4e4b..d0540337f 100644 --- a/llama_stack/distributions/starter/run.yaml +++ b/llama_stack/distributions/starter/run.yaml @@ -129,6 +129,19 @@ providers: kvstore: type: sqlite db_path: ${env.SQLITE_STORE_DIR:=~/.llama/distributions/starter}/pgvector_registry.db + - provider_id: ${env.MONGODB_CONNECTION_STRING:+mongodb_atlas} + provider_type: remote::mongodb + config: + connection_string: ${env.MONGODB_CONNECTION_STRING} + database_name: llama_stack + index_name: vector_index + path_field: embedding + similarity_metric: cosine + max_pool_size: 100 + timeout_ms: 30000 + kvstore: + type: sqlite + db_path: ${env.SQLITE_STORE_DIR:=~/.llama/distributions/starter}/mongodb_registry.db files: - provider_id: meta-reference-files provider_type: inline::localfs diff --git a/llama_stack/distributions/starter/starter.py b/llama_stack/distributions/starter/starter.py index 6bee51ff0..b57407d61 100644 --- a/llama_stack/distributions/starter/starter.py +++ b/llama_stack/distributions/starter/starter.py @@ -28,6 +28,9 @@ from llama_stack.providers.inline.vector_io.sqlite_vec.config import ( ) from llama_stack.providers.registry.inference import available_providers from llama_stack.providers.remote.vector_io.chroma.config import ChromaVectorIOConfig +from llama_stack.providers.remote.vector_io.mongodb.config import ( + MongoDBVectorIOConfig, +) from llama_stack.providers.remote.vector_io.pgvector.config import ( PGVectorVectorIOConfig, ) @@ -113,6 +116,7 @@ def get_distribution_template(name: str = "starter") -> DistributionTemplate: BuildProvider(provider_type="inline::milvus"), BuildProvider(provider_type="remote::chromadb"), BuildProvider(provider_type="remote::pgvector"), + BuildProvider(provider_type="remote::mongodb"), ], "files": [BuildProvider(provider_type="inline::localfs")], "safety": [ @@ -222,6 +226,13 @@ def get_distribution_template(name: str = "starter") -> DistributionTemplate: password="${env.PGVECTOR_PASSWORD:=}", ), ), + Provider( + provider_id="${env.MONGODB_CONNECTION_STRING:+mongodb_atlas}", + provider_type="remote::mongodb", + config=MongoDBVectorIOConfig.sample_run_config( + f"~/.llama/distributions/{name}", + ), + ), ], "files": [files_provider], }, @@ -295,5 +306,13 @@ def get_distribution_template(name: str = "starter") -> DistributionTemplate: "azure", "Azure API Type", ), + "MONGODB_CONNECTION_STRING": ( + "", + "MongoDB Atlas connection string (e.g., mongodb+srv://user:pass@cluster.mongodb.net/)", + ), + "MONGODB_DATABASE_NAME": ( + "llama_stack", + "MongoDB database name", + ), }, ) diff --git a/tests/unit/providers/vector_io/remote/__init__.py b/tests/unit/providers/vector_io/remote/__init__.py deleted file mode 100644 index 756f351d8..000000000 --- a/tests/unit/providers/vector_io/remote/__init__.py +++ /dev/null @@ -1,5 +0,0 @@ -# Copyright (c) Meta Platforms, Inc. and affiliates. -# All rights reserved. -# -# This source code is licensed under the terms described in the LICENSE file in -# the root directory of this source tree.