fix(ui): show team BYOK models in team fallback settings - #36241
Conversation
Team router settings loaded fallback options from /model_group/info, which resolves models without a team, so a team's own BYOK deployments were never selectable in its own fallback config. Load the team-scoped listing when a team id is present. Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
🤖 Devin AI EngineerI'll be helping with this pull request! Here's what you should know: ✅ I will automatically:
Note: I can only respond to comments from users who have write access to this repository. ⚙️ Control Options:
|
|
|
Greptile SummaryThe PR fixes team fallback settings by loading team-scoped models through a team-aware query while preserving the proxy-wide behavior for global router settings
Confidence Score: 5/5The PR appears safe to merge No blocking failure remains
|
| Filename | Overview |
|---|---|
| ui/litellm-dashboard/src/components/common_components/RouterSettingsAccordion.tsx | Replaces manually managed model-fetch state with a query keyed by access token and team ID, resolving the previously reported stale-response race |
| ui/litellm-dashboard/src/components/llm_calls/fetch_models.tsx | Adds a team-aware model-list helper that deduplicates, filters, sorts, and maps model IDs for fallback selection |
| ui/litellm-dashboard/src/components/team/TeamInfo.tsx | Passes the active team ID into the shared router settings accordion |
| ui/litellm-dashboard/src/components/common_components/RouterSettingsAccordion.test.tsx | Covers team and global model sources and verifies that a late response for an old team does not replace the current team's options |
| ui/litellm-dashboard/src/components/llm_calls/fetch_models.test.tsx | Verifies team-scoped endpoint arguments, sentinel filtering, deduplication, sorting, and empty responses |
Reviews (3): Last reviewed commit: "refactor(ui): use react-query for fallba..." | Re-trigger Greptile
|
Tested end to end against a local proxy with a team that owns a BYOK wildcard deployment Setup: a proxy-level model Before configuring anything, the failing model has nothing to fall back to:
In Team Settings > Edit Settings > Router Settings > Fallbacks, the team's BYOK model shows up and is selectable: Same request now succeeds, and the headers prove it landed on the team's BYOK deployment at real OpenAI
PersistenceRegression: global admin Router Settings unchangedStill loads the proxy-wide listing only ( Dashboard unit tests: 7 passed, including the new stale-response case |
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
|
@greptileai re review |
|
Re-QA at 49efcfb after the react-query refactor: the dropdown lists the team's openai/* expansions, the fallback saves and persists after reload |
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |



TLDR
Problem this solves:
How it solves it:
/models?team_id=...Relevant issues
Linear ticket
Resolves LIT-5299
Pre-Submission checklist
Please complete all items before asking a LiteLLM maintainer to review your PR
@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
Repro and verification against a live proxy on localhost:4000 with the Admin UI dev server on localhost:3000, using a team that owns a BYOK wildcard deployment (
model_name: openai/*withmodel_info.team_idset)Before, at commit ca2ed49e2a:
gpt-5-miniis listed, none of the team'sopenai/*models appearThe backend already exposes both listings, which is what the dropdown difference comes down to:
After, at commit 4166054, same steps:
openaiin Primary Model now listsopenai/*and every expansion; pickopenai/gpt-5.2openai/*and select itRe-verified the same flow at commit 49efcfb after the react-query refactor, this time picking
openai/gpt-5.6with anopenai/*fallback chain: the dropdown lists the team'sopenai/*expansions, the save succeeds, and/team/inforeturns the persisted fallbacks. Screenshots are in the PR commentsType
🐛 Bug Fix
🧹 Refactoring
Changes
RouterSettingsAccordionis shared by the global Router Settings page and the per team settings form, and it always built its fallback options fromfetchAvailableModels, which hits/model_group/info. That listing resolves with no team id, soRouter.get_model_namesdrops team scoped rows and a team's own BYOK models never showed up, even while you were editing that exact team.The accordion now takes an optional
teamIdand, when present, loads options from the team aware/models?team_id=...route through a newfetchAvailableModelsForTeamhelper.TeamInfopasses the team id it already has. Global Router Settings passes nothing, so its behavior is unchanged.The model fetch now goes through react-query instead of a hand-rolled effect:
useQuerykeyed on the access token and team id replaces the local state plus manual stale-response guard, since the dashboard already ships@tanstack/react-querywith a provider at the app root. Out of order responses are handled by query keying, and the component tests render under aQueryClientProviderFinal Attestation
Link to Devin session: https://app.devin.ai/sessions/c2770b07352e4073b24895ec26693f2b