Open
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Contributor
Greptile OverviewGreptile SummaryThis PR implements access group-based filtering for load balancing to prevent cross-team deployment routing (fixes #18333). However, it accidentally removes critical user spend tracking needed by Prometheus metrics. Key Changes
Critical Issue
Testing
Confidence Score: 1/5
|
| Filename | Overview |
|---|---|
| litellm/proxy/litellm_pre_call_utils.py | Accidentally removed user spend/budget metrics needed by prometheus.py, added access group filtering logic |
| litellm/router_utils/common_utils.py | Added filter_deployments_by_access_groups function to prevent cross-team load balancing, formatting improvements |
| litellm/router.py | Integrated access group filtering, improved error messages, added null checks for retry/fails policies |
Sequence Diagram
sequenceDiagram
participant User
participant ProxyServer
participant PreCallUtils as litellm_pre_call_utils
participant ModelChecks as model_checks
participant Router
participant CommonUtils as router_utils/common_utils
participant Deployment
User->>ProxyServer: API Request (team has AG2 access)
ProxyServer->>PreCallUtils: add_litellm_data_to_request()
PreCallUtils->>Router: get_model_access_groups()
Router-->>PreCallUtils: model_access_groups dict
PreCallUtils->>ModelChecks: get_access_groups_from_models(models)
ModelChecks-->>PreCallUtils: ["AG2"]
PreCallUtils->>PreCallUtils: Set metadata["user_api_key_allowed_access_groups"] = ["AG2"]
PreCallUtils-->>ProxyServer: Request with metadata
ProxyServer->>Router: async_function_with_fallbacks()
Router->>Router: get_available_deployment()
Router->>CommonUtils: filter_deployments_by_access_groups()
CommonUtils->>CommonUtils: Filter deployments where access_groups overlap with ["AG2"]
CommonUtils-->>Router: Filtered deployments (only AG2 deployments)
Router->>Deployment: Route to allowed deployment
Deployment-->>User: Response
Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>
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.
fixes ci pipeline: #18891