mirror of
https://github.com/open-webui/open-webui.git
synced 2026-03-10 07:43:10 -05:00
Bug Report: OpenWeb-UI forces HNSW index on Milvus even when other configurations are set #3569
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @pablocerdeira on GitHub (Feb 4, 2025).
Issue Description
I’m using OpenWeb-UI with Milvus as the vector database. When attempting to upload files, I encounter the following error:
ERROR [pymilvus.decorators] RPC error: [create_index], <MilvusException: (code=65535, message=invalid index type: HNSW, local mode only support FLAT IVF_FLAT AUTOINDEX: )>Even after configuring docker-compose.yml to use a supported index (FLAT, IVF_FLAT, or AUTOINDEX), OpenWeb-UI always attempts to create the index using HNSW, which is not supported in standalone mode for Milvus.
Steps to Reproduce
1. Set up OpenWeb-UI with Milvus in standalone mode.
2. Configure docker-compose.yml with the appropriate settings:
Expected Behavior
OpenWeb-UI should respect the configuration defined in environment variables (VECTOR_INDEX_TYPE and MILVUS_COLLECTION_PARAMS) and allow users to select a compatible index type.
Environment
• OS: Linux (Docker)
• Vector Database: Milvus 2.3.5 standalone
• Index settings in docker-compose.yml: AUTOINDEX, FLAT, or IVF_FLAT
• OpenWeb-UI Version: ghcr.io/open-webui/open-webui:main
Cause of the Issue
The HNSW index type is hardcoded inside milvus.py:
Suggested Fix
Modify the code to read the index type from environment variables (VECTOR_INDEX_TYPE and MILVUS_COLLECTION_PARAMS), ensuring flexibility for different Milvus configurations.
Proposed Fix:
This change ensures that users can define their desired index type without modifying the source code manually.
Temporary Workaround
To work around this issue without modifying the container’s source code, I copied the milvus.py file to the host and mounted it inside the container using docker-compose.yml:
This ensures that the watchtower auto-update mechanism does not override my fix. However, the ideal solution is for OpenWeb-UI to respect environment variables and allow proper Milvus configuration.
Request
Please update the code so that the index type can be set via environment variables, ensuring compatibility with different Milvus modes.