Skip to content

feat: backport MongoDB sidecar to rc/1.101.0 - #40316

Merged
yuneng-berri merged 1 commit into
rc/1.101.0from
litellm_backport_40203_rc_1_101_0
Sep 8, 2026
Merged

yuneng-berri merged 1 commit into
rc/1.101.0from
litellm_backport_40203_rc_1_101_0

Conversation

@yuneng-berri

@yuneng-berri yuneng-berri commented Sep 8, 2026 •

Copy link
Copy Markdown
Contributor

TLDR

Problem this solves:

  • RC images install MongoDB's driver alongside ordinary LiteLLM dependencies

How it solves it:

Clean cherry-pick of merge commit b8d573c5f958bab6d93037d292ea2c5de6ea2899, using its first parent, onto RC base eeb7732fc1. All 16 files applied without conflicts or manual changes. The resulting patch ID matches the original PR's merged patch, and git diff --check passes

User Flow

Before: MongoDB users configure the database connection inside LiteLLM

  1. Open https://litellm-domain/vector-stores/ and select Manage Vector Stores
  2. Add a MongoDB index with its connection string, database, collection, and embedding model
  3. Send POST https://litellm-domain/v1/vector_stores/{index}/search with a query and receive matching document text and scores

After: MongoDB users deploy the optional sidecar and keep search requests unchanged

  1. Open https://litellm-domain/vector-stores/ and select Manage Vector Stores
  2. Add a MongoDB index with its sidecar URL and key, database, collection, and embedding model
  3. Send POST https://litellm-domain/v1/vector_stores/{index}/search with a query and receive matching document text and scores

Relevant issues

Backport of #40203

Linear ticket

Pre-Submission checklist

  • Meaningful tests from the original PR are included
  • The focused tests covering this backport pass locally
  • This PR passes all required CI/CD checks
  • This PR is isolated to the MongoDB sidecar backport
  • Greptile has independently reviewed this PR's current head at 5/5

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

  • Existing MongoDB configurations require a sidecar URL and key
  • MongoDB connection strings and TLS files move into the sidecar

Medium

  • RC tests, image validation, CI, and current-head review remain pending

Final Attestation

  • The tests check the right things, including the edge cases, and regressions in the respective real-world customer use-cases are not possible after this PR

@yuneng-berri
yuneng-berri marked this pull request as ready for review September 8, 2026 22:54
@yuneng-berri
yuneng-berri merged commit 744156d into rc/1.101.0 Sep 8, 2026
7 checks passed
@yuneng-berri
yuneng-berri deleted the litellm_backport_40203_rc_1_101_0 branch September 8, 2026 22:56
@greptile-apps

greptile-apps Bot commented Sep 8, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

This PR moves MongoDB vector-store searches from an in-process PyMongo connection to an authenticated HTTP sidecar

  • Removes PyMongo from package extras, images, CI installation, and the lockfile
  • Adds sidecar URL, authentication, request validation, response validation, and timeout handling
  • Updates the dashboard and tests for sidecar configuration
  • Introduces an unconditional compatibility break for existing MongoDB configurations
  • Allows retained sidecar credentials to cross provider selections in the dashboard

Confidence Score: 3/5

This 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

Important Files Changed

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

Comment on lines +142 to +146
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."
)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Existing configs rejected

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!

Comment on lines +178 to 195
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",

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Credentials cross provider selections

After users enter MongoDB sidecar credentials and switch providers, shared fields retain those values, so the next provider receives incorrect credentials

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant