Repository navigation
fix(proxy): keep runtime-injected deployments the config reconcile cannot see - #42214
Draft
Pawan-Shahane wants to merge 1 commit into
Draft
Pawan-Shahane wants to merge 1 commit into
Pawan-Shahane wants to merge 1 commit into
Conversation
…nnot see The reconcile builds its keep-list from the db plus config.yaml, then drops every live deployment absent from it. A deployment injected at runtime is in neither source, so it was evicted on the next 30s tick with nothing logged, which made plugins and callbacks unusable with store_model_in_db on. A deployment can now name its owner in model_info.managed_by, and the reconcile leaves those alone and reports them as still desired, so a later drop still reads as damage. Anything that names no owner is evicted exactly as before.
Contributor
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
|
LGTM! Reviewed |
PR Review: Gemini Streaming Grounding Metadata NormalizationProblem & Solution:When streaming from Gemini 2.5 / Vertex AI with search grounding enabled, the final response chunk emits Key Verification:
LGTM! 🚀 |
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
TLDR
Problem this solves:
How it solves it:
model_info.managed_byUser Flow
Before: an operator whose plugin adds a model to the running proxy watches it disappear half a minute later
store_model_in_db: trueand a plugin of their own that adds a deployment namedinjected-by-pluginonce the proxy is upinjected-by-plugin"model": "injected-by-plugin"and get HTTP 400,Invalid model name passed in model=injected-by-pluginAfter: the same model stays put and keeps serving traffic
managed_by: <their plugin's name>inmodel_info"model": "injected-by-plugin"and get HTTP 200 with a real completionRelevant issues
Fixes #42211
Affected release
Linear ticket
Pre-Submission checklist
Please complete all items before asking a LiteLLM maintainer to review your PR
uv run pytest tests/test_litellm/<your_test_file>.py -v. Leave the suites (make test-unit-*,make test-unit) to CI: it finishes in ~15 minutes where a laptop takes an hour or more@greptileaito re-request a review after pushing changes)Delays in PR merge?
If you're seeing a delay in your PR being merged, ping the LiteLLM Team on Slack (#pr-review).
Screenshots / Proof of Fix
Both sides run the same proxy, the same plugin and the same commands against a real Postgres, and the last step is a real billed OpenRouter call.
qa_config.yaml, with the reload interval shortened to 10s so the wait is short:injector.pynext to it, standing in for any plugin that adds a deployment to a running proxy:managed_byis accepted on both commits, so the plugin is byte for byte identical on the two sides. On the Before commit it is simply an extra field nothing reads.Start the proxy:
Both sides then run these three, waiting for the plugin's line in the log first:
Before (aa0ffee)
$ grep -c "injected-by-plugin-id" proxy.log 0After (0bb58ee)
--detailed_debug, each reload says what it kept and who claimed it:Same proxy, same plugin, same commands on both sides, so the only thing that changed is whether the model survives the reload
Type
🐛 Bug Fix
Caveats (if any)
Medium
Low
--detailed_debugto show itcombined_id_listpicked up alist[str]annotation, which drops 3 basedpyright findings in the fileFinal Attestation
🤖 Generated with Claude Code