mirror of
https://github.com/open-webui/open-webui.git
synced 2026-05-06 10:58:17 -05:00
[PR #17837] [MERGED] feat: Impelement Milvus multitenancy // breaking: set milvus multitenancy as standard option (just like Qdrant already is) #47617
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?
📋 Pull Request Information
Original PR: https://github.com/open-webui/open-webui/pull/17837
Author: @Classic298
Created: 9/28/2025
Status: ✅ Merged
Merged: 9/29/2025
Merged by: @tjbck
Base:
dev← Head:milvus-multitenancy📝 Commits (7)
50a2204add env vars8dc43f9Create milvus_multitenancy.py01d4a8aUpdate factory.py27af450Update config.py1773a4dtypo0e99c43ADD FAT WARNINGb1e6363ADD FAT WARNING - QDRANT📊 Changes
4 files changed (+314 additions, -5 deletions)
View changed files
📝
backend/open_webui/config.py(+5 -2)➕
backend/open_webui/retrieval/vector/dbs/milvus_multitenancy.py(+288 -0)📝
backend/open_webui/retrieval/vector/dbs/qdrant_multitenancy.py(+7 -0)📝
backend/open_webui/retrieval/vector/factory.py(+14 -3)📄 Description
Pull Request Checklist
Note to first-time contributors: Please open a discussion post in Discussions and describe your changes before submitting a pull request.
Before submitting, make sure you've checked the following:
devbranch.Changelog Entry
Description
This PR introduces a scalable, multi-tenant architecture for Milvus, mirroring the existing Qdrant implementation. When enabled via the ENABLE_MILVUS_MULTITENANCY_MODE environment variable, this mode utilizes a fixed set of shared collections instead of creating a new collection for each resource.
Data isolation is achieved by adding a resource_id to each vector's metadata and applying a filter expression (expr) to all database operations. This prevents the proliferation of collections, which can lead to performance degradation and resource exhaustion in large-scale deployments.
The implementation includes:
A new milvus_multitenancy.py module with the multi-tenant client.
Configuration variables in config.py to enable the mode and define the collection prefix.
Updated logic in the factory.py to conditionally select the appropriate Milvus client.
Breaking Changes
truebecause the same is the case for Qdrant and users will otherwise quickly run into collection limits of milvus.Tested locally, works - tested with Milvus Lite.
Contributor License Agreement
By submitting this pull request, I confirm that I have read and fully agree to the Contributor License Agreement (CLA), and I am providing my contributions under its terms.
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.