feat(ui): show in the log drawer and session sidebar when an auto-router served a request - #34434
Conversation
Greptile SummaryAdds auto-router indicators to request logs and session details.
Confidence Score: 5/5The PR appears safe to merge No blocking failures remain
|
| Filename | Overview |
|---|---|
| ui/litellm-dashboard/src/app/(dashboard)/hooks/models/useModels.ts | Adds a paginated query that derives the complete set of configured auto-router model groups |
| ui/litellm-dashboard/src/components/shared/table_cells/AutoRouterTag.tsx | Adds shared context, tag, icon, and lookup helpers for auto-router indicators |
| ui/litellm-dashboard/src/components/view_logs/LogDetailsDrawer/LogDetailsDrawer.tsx | Uses the shared lookup to select the auto-router icon for session trace entries |
| ui/litellm-dashboard/src/components/view_logs/LogDetailsDrawer/DrawerHeader.tsx | Shows the requested auto-router model group beside model and provider details |
| ui/litellm-dashboard/src/components/view_logs/RequestLogsPanel.tsx | Mounts one auto-router model-group provider around the logs surfaces |
Reviews (3): Last reviewed commit: "feat(ui): show in the log drawer and ses..." | Re-trigger Greptile
950862e to
e29c2d8
Compare
…ter served a request The dashboard already receives the requested model name as model_group on every spend-log row, but LogEntry dropped the field, so nothing distinguished an auto-routed request from a direct one. Surface it precisely rather than by comparing requested against resolved: model_group differs from model for plain aliases and wildcard deployments too, so a bare mismatch tags almost every row and identifies nothing. The indication is driven instead by which deployments are auto-routers, resolved from every page of /v2/model/info and shared through context. The request drawer header names the router in a badge next to the provider; the session sidebar swaps the entry's leading icon. Rows that no auto-router served render exactly as before.
e29c2d8 to
42aba4f
Compare
Runtime test of the latest commit (
|
|
bugbot run |
There was a problem hiding this comment.
✅ Bugbot reviewed your changes and found no new issues!
Comment @cursor review or bugbot run to trigger another review on this PR
Reviewed by Cursor Bugbot for commit 42aba4f. Configure here.
TLDR
Problem this solves:
model_group, and both UI endpoints already return it; the dashboard type dropped the fieldHow it solves it:
model_group != model, which is true for ordinary aliases tooRelevant issues
Linear ticket
Resolves LIT-4748
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
Ran a local proxy against real Anthropic with one auto-router (
smart-router, a complexity router overclaude-haiku/claude-sonnet/claude-opus) plus two plain aliases, then read back what the UI endpoints serveBoth
/spend/logs/uiand/spend/logs/session/uireturnmodel_groupon every rowThis is also why the indication is not driven by comparing the two columns. All three rows have
model_group != model, because that is what amodel_namealias is; only the third row went through an auto-router. The auto-routed row is otherwise indistinguishable server side, with the samemodel_idas the directclaude-haikurow and an identicalmetadatakey set, so the requested name is matched against the deployments whoselitellm_params.modelstarts withauto_router/Verified that a non-admin virtual key gets the same
litellm_params.modelvalues from that endpoint, so the indication renders for non-admins tooType
🆕 New Feature
Changes
LogEntrycarriesmodel_group, anduseAutoRouterModelGroupsresolves the set of auto-router model groups from every page of/v2/model/info, keyed on theauto_router/prefix so complexity, adaptive and quality routers are all coveredAutoRouterTagandAutoRouterModelGroupsProviderinshared/table_cells, mounted once in the logs panel so both surfaces share one lookupTraceEventRow's icon choice moves into a smallTraceEventIconwith early returns, which drops two grandfatheredno-nested-ternarysuppressionsThings a reviewer will ask about
The indication is a lookup rather than a string comparison because
model_group != modelholds for every plain alias and every wildcard deployment, so a mismatch-based badge would fire on nearly every row and single out nothing.AutoRouterTagreads its set from context with an empty-set default instead of calling the query hook itself, so any consumer outside a provider keeps rendering without aQueryClientLeft alone deliberately:
model_info_view.tsxandedit_auto_router_modal.tsxhand-roll a narrowerauto_router/complexity_routercheck. That asks a different question, namely whether the complexity-router edit UI applies, and widening it to the general prefix would wrongly show that UI for adaptive and quality routersQA runbook
smart-routermodel whoselitellm_params.modelisauto_router/complexity_routeralongside aclaude-haikumodel whoselitellm_params.modelisanthropic/claude-haiku-4-5litellm_session_idon all three so they group into one sessionsmart-routerrow. The drawer header shows the resolved model, the provider, then a badge namingsmart-routerclaude-haikuorclaude-sonnetrow. The header shows no badge, exactly as before this PRFinal Attestation
Note
Low Risk
Dashboard-only, read-only UI over existing log and model-info APIs; mislabeling is avoided by not rendering until the router set is known.
Overview
Request logs now surface auto-router routing in the drawer header and session trace sidebar, using
model_groupfrom spend-log rows and a shared deployment lookup instead of comparing requested vs resolved model names.LogEntrygains optionalmodel_group.useAutoRouterModelGroupsloads all pages of/v2/model/info, treats deployments whoselitellm_params.modelstarts withauto_router/as routers, and exposes their publicmodel_nameset.AutoRouterModelGroupsProvidermounts once on the request logs panel so drawer header and sidebar share one cached lookup.The drawer header shows an
AutoRouterTagbadge naming the router whenmodel_groupmatches that set. Session sidebar rows use the waypoints icon for auto-routed entries (viaTraceEventIcon). Tags and icons stay hidden while the lookup is loading, on failure, or outside the provider so rows are not mislabeled.Reviewed by Cursor Bugbot for commit 42aba4f. Bugbot is set up for automated code reviews on this repo. Configure here.