Repository navigation
feat: backport MongoDB sidecar to rc/1.101.0 - #40316
Conversation
(cherry picked from commit b8d573c)
Greptile SummaryThis PR moves MongoDB vector-store searches from an in-process PyMongo connection to an authenticated HTTP sidecar
Confidence Score: 3/5This PR is not safe to merge until existing configurations have an opt-in migration path and provider switching cannot reuse sidecar credentials Existing MongoDB configurations are rejected without the required compatibility control, and shared sidecar credentials can be submitted after selecting another provider Files Needing Attention: litellm/llms/mongodb/vector_stores/transformation.py, ui/litellm-dashboard/src/components/vector_store_providers.tsx, ui/litellm-dashboard/src/app/(dashboard)/vector-stores/_components/VectorStoreForm.tsx
|
| Filename | Overview |
|---|---|
| litellm/llms/mongodb/vector_stores/transformation.py | Replaces direct PyMongo searches with a validated sidecar protocol, but unconditionally rejects the previous configuration contract |
| litellm/llms/custom_httpx/llm_http_handler.py | Propagates vector-store timeouts and maps transport timeouts through provider-specific errors |
| ui/litellm-dashboard/src/components/vector_store_providers.tsx | Adds MongoDB sidecar fields using shared form keys that retain values when users switch providers |
| ui/litellm-dashboard/src/app/(dashboard)/vector-stores/_components/VectorStoreForm.tsx | Removes the direct connection-string field but does not clear shared sidecar credentials during provider changes |
| pyproject.toml | Removes the obsolete MongoDB SDK extra now that LiteLLM no longer imports PyMongo |
| tests/test_litellm/llms/mongodb/vector_stores/test_mongodb_transformation.py | Replaces direct-driver tests with sync and async sidecar contract, validation, timeout, and error tests |
Reviews (1): Last reviewed commit: "feat: backport MongoDB sidecar to rc/1.1..." | Re-trigger Greptile
| if litellm_params.get("mongodb_connection_string") is not None: | ||
| raise config_error( | ||
| "MongoDB vector stores now use the BETA sidecar. Move mongodb_connection_string to " | ||
| "MONGODB_CONNECTION_STRING in the sidecar, remove it from LiteLLM, and configure api_base and api_key." | ||
| ) |
There was a problem hiding this comment.
Existing mongodb_connection_string configurations now fail unconditionally. This violates the repository directive requiring user-controlled flags for backward-incompatible behavior
Rule Used: What: avoid backwards-incompatible changes without... (source)
Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!
| name: "api_base", | ||
| label: "Sidecar URL", | ||
| tooltip: "Use HTTPS for a remote sidecar, or HTTP with a loopback IP for a sidecar on the same host or Pod", | ||
| placeholder: "http://127.0.0.1:8080", | ||
| required: true, | ||
| type: "text", | ||
| }, | ||
| { | ||
| name: "api_key", | ||
| label: "Sidecar API Key", | ||
| tooltip: "The MONGODB_SIDECAR_API_KEY configured in your MongoDB sidecar", | ||
| placeholder: "Enter sidecar API key", | ||
| required: true, | ||
| type: "password", | ||
| }, | ||
| { | ||
| name: "mongodb_database", | ||
| label: "Database", |
TLDR
Problem this solves:
How it solves it:
rc/1.101.0Clean cherry-pick of merge commit
b8d573c5f958bab6d93037d292ea2c5de6ea2899, using its first parent, onto RC baseeeb7732fc1. All 16 files applied without conflicts or manual changes. The resulting patch ID matches the original PR's merged patch, andgit diff --checkpassesUser Flow
Before: MongoDB users configure the database connection inside LiteLLM
https://litellm-domain/vector-stores/and select Manage Vector StoresPOST https://litellm-domain/v1/vector_stores/{index}/searchwith a query and receive matching document text and scoresAfter: MongoDB users deploy the optional sidecar and keep search requests unchanged
https://litellm-domain/vector-stores/and select Manage Vector StoresPOST https://litellm-domain/v1/vector_stores/{index}/searchwith a query and receive matching document text and scoresRelevant issues
Backport of #40203
Linear ticket
Pre-Submission checklist
Screenshots / Proof of Fix
RC runtime, image, and browser validation have not been run for this backport. The source PR documents its own validation; that evidence does not validate this RC head. This PR is opened as a draft and work pauses after creation as requested
Type
Refactoring, Infrastructure, Test
Caveats
Severe
Medium
Final Attestation