Skip to content

Commit 8cc4925

Browse files
chore: Enable keyword search for Milvus inline (#3073)
# What does this PR do? With milvus-io/milvus-lite#294 - Milvus Lite supports keyword search using BM25. While introducing keyword search we had explicitly disabled it for inline milvus. This PR removes the need for the check, and enables `inline::milvus` for tests. <!-- If resolving an issue, uncomment and update the line below --> <!-- Closes #[issue-number] --> ## Test Plan Run llama stack with `inline::milvus` enabled: ``` pytest tests/integration/vector_io/test_openai_vector_stores.py::test_openai_vector_store_search_modes --stack-config=http://localhost:8321 --embedding-model=all-MiniLM-L6-v2 -v ``` ``` INFO 2025-08-07 17:06:20,932 tests.integration.conftest:64 tests: Setting DISABLE_CODE_SANDBOX=1 for macOS =========================================================================================== test session starts ============================================================================================ platform darwin -- Python 3.12.11, pytest-7.4.4, pluggy-1.5.0 -- /Users/vnarsing/miniconda3/envs/stack-client/bin/python cachedir: .pytest_cache metadata: {'Python': '3.12.11', 'Platform': 'macOS-14.7.6-arm64-arm-64bit', 'Packages': {'pytest': '7.4.4', 'pluggy': '1.5.0'}, 'Plugins': {'asyncio': '0.23.8', 'cov': '6.0.0', 'timeout': '2.2.0', 'socket': '0.7.0', 'html': '3.1.1', 'langsmith': '0.3.39', 'anyio': '4.8.0', 'metadata': '3.0.0'}} rootdir: /Users/vnarsing/go/src/github/meta-llama/llama-stack configfile: pyproject.toml plugins: asyncio-0.23.8, cov-6.0.0, timeout-2.2.0, socket-0.7.0, html-3.1.1, langsmith-0.3.39, anyio-4.8.0, metadata-3.0.0 asyncio: mode=Mode.AUTO collected 3 items tests/integration/vector_io/test_openai_vector_stores.py::test_openai_vector_store_search_modes[None-None-all-MiniLM-L6-v2-None-384-vector] PASSED [ 33%] tests/integration/vector_io/test_openai_vector_stores.py::test_openai_vector_store_search_modes[None-None-all-MiniLM-L6-v2-None-384-keyword] PASSED [ 66%] tests/integration/vector_io/test_openai_vector_stores.py::test_openai_vector_store_search_modes[None-None-all-MiniLM-L6-v2-None-384-hybrid] PASSED [100%] ============================================================================================ 3 passed in 4.75s ============================================================================================= ``` Signed-off-by: Varsha Prasad Narsing <[email protected]> Co-authored-by: Francisco Arceo <[email protected]>
1 parent eb07a0f commit 8cc4925

File tree

4 files changed

+8
-10
lines changed

4 files changed

+8
-10
lines changed

llama_stack/providers/remote/vector_io/milvus/milvus.py

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -413,15 +413,6 @@ async def query_chunks(
413413
index = await self._get_and_cache_vector_db_index(vector_db_id)
414414
if not index:
415415
raise VectorStoreNotFoundError(vector_db_id)
416-
417-
if params and params.get("mode") == "keyword":
418-
# Check if this is inline Milvus (Milvus-Lite)
419-
if hasattr(self.config, "db_path"):
420-
raise NotImplementedError(
421-
"Keyword search is not supported in Milvus-Lite. "
422-
"Please use a remote Milvus server for keyword search functionality."
423-
)
424-
425416
return await index.query_chunks(query, params)
426417

427418
async def delete_chunks(self, store_id: str, chunks_for_deletion: list[ChunkForDeletion]) -> None:

pyproject.toml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,7 @@ unit = [
9393
"blobfile",
9494
"faiss-cpu",
9595
"pymilvus>=2.5.12",
96+
"milvus-lite>=2.5.0",
9697
"litellm",
9798
"together",
9899
"coverage",
@@ -118,6 +119,7 @@ test = [
118119
"sqlalchemy[asyncio]>=2.0.41",
119120
"requests",
120121
"pymilvus>=2.5.12",
122+
"milvus-lite>=2.5.0",
121123
"weaviate-client>=4.16.4",
122124
]
123125
docs = [

tests/integration/vector_io/test_openai_vector_stores.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@ def skip_if_provider_doesnt_support_openai_vector_stores_search(client_with_mode
5656
"keyword": [
5757
"inline::sqlite-vec",
5858
"remote::milvus",
59+
"inline::milvus",
5960
],
6061
"hybrid": [
6162
"inline::sqlite-vec",

uv.lock

Lines changed: 5 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)