feat: display provider key aliases as model names in model catalog overview - #4776
Conversation
77aa835 to
514fd70
Compare
|
Warning Review limit reachedYou’ve reached a temporary PR review limit under our Fair Usage Limits Policy. Next review available in: 43 minutes Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughThe overviewTab component was updated to fetch provider keys alongside model histogram data. New helper functions build an alias-to-display-name map from provider key aliases and expand raw model lists using that map. The models-loading effect now runs both queries in parallel and returns the expanded model list. ChangesModel alias expansion in overview tab
Estimated code review effort: 2 (Simple) | ~10 minutes Sequence Diagram(s)sequenceDiagram
participant OverviewTab
participant HistogramQuery
participant ProviderKeysQuery
OverviewTab->>HistogramQuery: fetch model histogram
OverviewTab->>ProviderKeysQuery: triggerProviderKeys
ProviderKeysQuery-->>OverviewTab: key.aliases
HistogramQuery-->>OverviewTab: data.models
OverviewTab->>OverviewTab: expand models via alias display map
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
7a5027f to
c76f12e
Compare
There was a problem hiding this comment.
Actionable comments posted: 1
🧹 Nitpick comments (1)
ui/app/workspace/model-catalog/views/overviewTab.tsx (1)
20-45: 🗄️ Data Integrity & Integration | 🔵 Trivial | ⚡ Quick winWiden
ModelProviderKey.aliasesto include string aliases. The backend wire format accepts both shapes, soui/lib/types/config.tsshould modelRecord<string, AliasConfig | string>(or a dedicated union) and this helper can drop theas unknowncast.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@ui/app/workspace/model-catalog/views/overviewTab.tsx` around lines 20 - 45, The alias handling in buildAliasDisplayMap is compensating for an incomplete type shape, since ModelProviderKey.aliases can be either AliasConfig or a string in the backend wire format. Update the aliases type in ui/lib/types/config.ts to accept both forms (for example, a union like Record<string, AliasConfig | string>), then simplify buildAliasDisplayMap in overviewTab.tsx to use the typed value directly and remove the as unknown cast while keeping the current model_id/model_name extraction logic.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@ui/app/workspace/model-catalog/views/overviewTab.tsx`:
- Around line 20-49: The model expansion logic is over-counting because one raw
model can map to multiple alias names in buildAliasDisplayMap and then get
expanded into all of them in getDisplayModels. Update the mapping so each
underlying model_id/model_name resolves to only one display label (for example,
the first alias encountered or a stable preferred alias), and make
getDisplayModels return a single display entry per raw model using that chosen
name. Keep the fix localized to buildAliasDisplayMap and getDisplayModels in
overviewTab.tsx.
---
Nitpick comments:
In `@ui/app/workspace/model-catalog/views/overviewTab.tsx`:
- Around line 20-45: The alias handling in buildAliasDisplayMap is compensating
for an incomplete type shape, since ModelProviderKey.aliases can be either
AliasConfig or a string in the backend wire format. Update the aliases type in
ui/lib/types/config.ts to accept both forms (for example, a union like
Record<string, AliasConfig | string>), then simplify buildAliasDisplayMap in
overviewTab.tsx to use the typed value directly and remove the as unknown cast
while keeping the current model_id/model_name extraction logic.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro Plus
Run ID: cb8cfe9d-77fc-4d90-bf50-0fffe9a3bee4
📒 Files selected for processing (1)
ui/app/workspace/model-catalog/views/overviewTab.tsx
c76f12e to
80a3faf
Compare
Merge activity
|
The base branch was changed.
…erview (#4776) ## Summary When displaying models used per provider in the Model Catalog overview tab, raw model IDs were shown instead of their human-readable alias names. This PR resolves that by fetching provider keys alongside model histogram data and mapping model IDs to their configured aliases before rendering. ## Changes - Added `useLazyGetProviderKeysQuery` to the overview tab to fetch provider key configurations per provider. - Introduced `buildAliasDisplayMap`, which parses alias configurations (supporting both string and object forms with `model_id`/`model_name` fields) and builds a reverse lookup from model value to alias names. - Introduced `getDisplayModels`, which replaces raw model IDs with their corresponding alias names when available, falling back to the original model ID if no alias is found. - Provider keys and model histogram data are now fetched in parallel per provider, keeping the existing performance characteristics. ## Type of change - [ ] Bug fix - [x] Feature - [ ] Refactor - [ ] Documentation - [ ] Chore/CI ## Affected areas - [ ] Core (Go) - [ ] Transports (HTTP) - [ ] Providers/Integrations - [ ] Plugins - [x] UI (React) - [ ] Docs ## How to test 1. Configure a provider with one or more model aliases in the provider key settings. 2. Generate some traffic through those aliased models. 3. Navigate to the Model Catalog overview tab. 4. Verify that the "Models Used" column displays alias names rather than raw model IDs. ```sh cd ui pnpm i || npm i pnpm build || npm run build ``` ## Screenshots/Recordings Before: Model IDs (e.g., `gpt-4o-mini`) were shown directly in the models used list. After: Configured alias names are shown in place of raw model IDs where aliases exist. ## Breaking changes - [x] No ## Related issues ## Security considerations Provider keys are fetched using the existing authenticated query mechanism. No new secrets or PII are introduced; alias names are treated as display strings only. ## Checklist - [ ] I read `docs/contributing/README.md` and followed the guidelines - [ ] I added/updated tests where appropriate - [ ] I updated documentation where needed - [ ] I verified builds succeed (Go and UI) - [ ] I verified the CI pipeline passes locally if applicable

Summary
When displaying models used per provider in the Model Catalog overview tab, raw model IDs were shown instead of their human-readable alias names. This PR resolves that by fetching provider keys alongside model histogram data and mapping model IDs to their configured aliases before rendering.
Changes
useLazyGetProviderKeysQueryto the overview tab to fetch provider key configurations per provider.buildAliasDisplayMap, which parses alias configurations (supporting both string and object forms withmodel_id/model_namefields) and builds a reverse lookup from model value to alias names.getDisplayModels, which replaces raw model IDs with their corresponding alias names when available, falling back to the original model ID if no alias is found.Type of change
Affected areas
How to test
Screenshots/Recordings
Before: Model IDs (e.g.,
gpt-4o-mini) were shown directly in the models used list.After: Configured alias names are shown in place of raw model IDs where aliases exist.
Breaking changes
Related issues
Security considerations
Provider keys are fetched using the existing authenticated query mechanism. No new secrets or PII are introduced; alias names are treated as display strings only.
Checklist
docs/contributing/README.mdand followed the guidelines