Skip to content

feat: display provider key aliases as model names in model catalog overview - #4776

Merged
akshaydeo merged 4 commits into
devfrom
06-29-fix_show_proper_model_name_on_model_catalog
Jul 1, 2026
Merged

feat: display provider key aliases as model names in model catalog overview#4776
akshaydeo merged 4 commits into
devfrom
06-29-fix_show_proper_model_name_on_model_catalog

Conversation

@impoiler

@impoiler impoiler commented Jun 29, 2026

Copy link
Copy Markdown
Contributor

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
  • Feature
  • Refactor
  • Documentation
  • Chore/CI

Affected areas

  • Core (Go)
  • Transports (HTTP)
  • Providers/Integrations
  • Plugins
  • 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.
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

  • 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

@impoiler impoiler self-assigned this Jun 29, 2026
@impoiler impoiler changed the title fix: show proper model name on model catalog feat: display provider key aliases as model names in model catalog overview Jun 29, 2026
@impoiler
impoiler force-pushed the 06-29-fix_show_proper_model_name_on_model_catalog branch from 77aa835 to 514fd70 Compare June 30, 2026 05:49
@coderabbitai

coderabbitai Bot commented Jun 30, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

Warning

Review limit reached

You’ve reached a temporary PR review limit under our Fair Usage Limits Policy.

Your recent review volume is higher than typical usage, so adaptive limits are currently applied.

Next review available in: 43 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

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 configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: 02c3f4e7-5299-42a2-b61b-604a849300f5

📥 Commits

Reviewing files that changed from the base of the PR and between c76f12e and 80a3faf.

📒 Files selected for processing (1)
  • ui/app/workspace/model-catalog/views/overviewTab.tsx
📝 Walkthrough

Walkthrough

The 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.

Changes

Model alias expansion in overview tab

Layer / File(s) Summary
Alias mapping helpers and imports
ui/app/workspace/model-catalog/views/overviewTab.tsx
Refactors store imports to add useLazyGetProviderKeysQuery and consolidates KnownProvider/ModelProviderKey types; adds helpers to build an alias-to-display map from key.aliases and to expand a models list using that map.
Provider keys fetch and model expansion wiring
ui/app/workspace/model-catalog/views/overviewTab.tsx
Introduces triggerProviderKeys, fetches provider keys concurrently with model histogram data, applies alias expansion to the returned model list instead of raw data.models, and adds triggerProviderKeys to the effect's dependency array.

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
Loading
🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly summarizes the main UI change: showing provider key aliases instead of raw model IDs.
Description check ✅ Passed The description follows the template well and covers summary, changes, testing, screenshots, breaking changes, and security.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch 06-29-fix_show_proper_model_name_on_model_catalog

Comment @coderabbitai help to get the list of available commands.

@impoiler
impoiler force-pushed the 06-29-fix_show_proper_model_name_on_model_catalog branch 3 times, most recently from 7a5027f to c76f12e Compare July 1, 2026 06:27
@impoiler
impoiler marked this pull request as ready for review July 1, 2026 06:45
@greptile-apps

greptile-apps Bot commented Jul 1, 2026

Copy link
Copy Markdown
Contributor

Confidence Score: 5/5

Safe to merge — the change is UI-only, scoped to one component, and adds a defensive parallel fetch with per-operation error fallbacks.

Both the histogram fetch and the provider-keys fetch have individual .catch(() => []) guards, so a partial failure silently degrades to showing raw model IDs rather than breaking the page. The cancellation flag prevents stale state on unmount. No new API surfaces, no security-sensitive paths, and no existing data-testid attributes are removed.

No files require special attention. The two edge cases flagged in prior review threads (duplicate entries and the as unknown cast) are the only areas worth revisiting.

Important Files Changed

Filename Overview
ui/app/workspace/model-catalog/views/overviewTab.tsx Adds alias name resolution for the models-used column; two edge cases (duplicate entries when histogram contains both raw ID and alias, and the as unknown type escape) were flagged in prior review threads. Core logic is correct and error handling is sound.

Sequence Diagram

%%{init: {'theme': 'neutral'}}%%
sequenceDiagram
    participant C as OverviewTab
    participant H as Model Histogram API
    participant K as Provider Keys API
    participant R as Render

    C->>C: providers list available
    loop per provider p
        C->>H: triggerModelHistogram(p.name)
        C->>K: triggerProviderKeys(p.name)
        H-->>C: models[] (raw IDs)
        K-->>C: keys[] (ModelProviderKey[])
        C->>C: buildAliasDisplayMap(keys)
        C->>C: getDisplayModels(models, displayMap)
    end
    C->>R: setModelsUsedMap(aliasedModels)
    R-->>C: renders alias names in "Models Used" column
Loading
%%{init: {'theme': 'base', 'themeVariables': {"darkMode": true, "background": "#0d1117", "primaryColor": "#21262d", "primaryTextColor": "#e6edf3", "primaryBorderColor": "#8b949e", "lineColor": "#8b949e", "textColor": "#e6edf3", "edgeLabelBackground": "#161b22", "actorBkg": "#21262d", "actorBorder": "#8b949e", "actorTextColor": "#e6edf3", "actorLineColor": "#8b949e", "signalColor": "#8b949e", "signalTextColor": "#e6edf3", "noteBkgColor": "#373320", "noteBorderColor": "#d4a72c", "noteTextColor": "#f0e6c0", "labelBoxBkgColor": "#21262d", "labelBoxBorderColor": "#8b949e", "labelTextColor": "#e6edf3", "loopTextColor": "#e6edf3", "activationBkgColor": "#30363d", "activationBorderColor": "#8b949e"}}}%%
sequenceDiagram
    participant C as OverviewTab
    participant H as Model Histogram API
    participant K as Provider Keys API
    participant R as Render

    C->>C: providers list available
    loop per provider p
        C->>H: triggerModelHistogram(p.name)
        C->>K: triggerProviderKeys(p.name)
        H-->>C: models[] (raw IDs)
        K-->>C: keys[] (ModelProviderKey[])
        C->>C: buildAliasDisplayMap(keys)
        C->>C: getDisplayModels(models, displayMap)
    end
    C->>R: setModelsUsedMap(aliasedModels)
    R-->>C: renders alias names in "Models Used" column
Loading

Reviews (2): Last reviewed commit: "fix: show proper model name on model ca..." | Re-trigger Greptile

Comment thread ui/app/workspace/model-catalog/views/overviewTab.tsx
Comment thread ui/app/workspace/model-catalog/views/overviewTab.tsx

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🧹 Nitpick comments (1)
ui/app/workspace/model-catalog/views/overviewTab.tsx (1)

20-45: 🗄️ Data Integrity & Integration | 🔵 Trivial | ⚡ Quick win

Widen ModelProviderKey.aliases to include string aliases. The backend wire format accepts both shapes, so ui/lib/types/config.ts should model Record<string, AliasConfig | string> (or a dedicated union) and this helper can drop the as unknown cast.

🤖 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

📥 Commits

Reviewing files that changed from the base of the PR and between af0b891 and c76f12e.

📒 Files selected for processing (1)
  • ui/app/workspace/model-catalog/views/overviewTab.tsx

Comment thread ui/app/workspace/model-catalog/views/overviewTab.tsx
@impoiler
impoiler changed the base branch from dev to graphite-base/4776 July 1, 2026 06:57
@impoiler
impoiler force-pushed the 06-29-fix_show_proper_model_name_on_model_catalog branch from c76f12e to 80a3faf Compare July 1, 2026 06:57
@impoiler
impoiler changed the base branch from graphite-base/4776 to fix/handle-special-characters-in-dashboard-filters July 1, 2026 06:57
coderabbitai[bot]
coderabbitai Bot previously approved these changes Jul 1, 2026

akshaydeo commented Jul 1, 2026

Copy link
Copy Markdown
Contributor

Merge activity

  • Jul 1, 8:29 AM UTC: A user started a stack merge that includes this pull request via Graphite.
  • Jul 1, 8:32 AM UTC: @akshaydeo merged this pull request with Graphite.

@akshaydeo
akshaydeo changed the base branch from fix/handle-special-characters-in-dashboard-filters to graphite-base/4776 July 1, 2026 08:31
@akshaydeo
akshaydeo changed the base branch from graphite-base/4776 to dev July 1, 2026 08:32
@akshaydeo
akshaydeo dismissed coderabbitai[bot]’s stale review July 1, 2026 08:32

The base branch was changed.

@akshaydeo
akshaydeo merged commit e98d8f6 into dev Jul 1, 2026
10 of 11 checks passed
@akshaydeo
akshaydeo deleted the 06-29-fix_show_proper_model_name_on_model_catalog branch July 1, 2026 08:32
akshaydeo pushed a commit that referenced this pull request Jul 1, 2026
…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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants