Skip to content

feat(models): refactor model id and add model names - #515

Merged
steebchen merged 1 commit into
mainfrom
feat/models-ids
Jul 23, 2025
Merged

steebchen merged 1 commit into
mainfrom
feat/models-ids

Conversation

@steebchen

@steebchen steebchen commented Jul 23, 2025 •

Copy link
Copy Markdown
Member

Refactored model schema to use id and optional name instead of model. Updated relevant components, providers, and logic to handle changes. Improved readability and maintainability of model handling code.

Summary by CodeRabbit

  • New Features

    • Model lists and selectors now display human-readable model names where available, improving clarity for users.
  • Refactor

    • Standardized model identifiers across all providers from model to id, introducing a name property for clearer model display throughout the app.
    • Updated all model selection, filtering, sorting, and display components to use the new id and name fields consistently.
    • Adjusted activity tracking, usage tables, and charts to reference models by id for improved data accuracy and consistency.

@coderabbitai

coderabbitai Bot commented Jul 23, 2025 •

Copy link
Copy Markdown
Contributor

"""

Walkthrough

This change standardizes model identification across the codebase by replacing the model property with id and introducing an optional name property for human-readable display names in all model definition objects. All relevant code, interfaces, and UI components are updated to reference id and name instead of model.

Changes

Files/Groups Change Summary
packages/models/src/models.ts ModelDefinition interface: rename model to id, add optional name, add JSDoc comments.
packages/models/src/models/alibaba.ts, anthropic.ts, deepseek.ts, google.ts,
meta.ts, openai.ts, perplexity.ts, xai.ts All model objects: replace model with id, add name property (human-readable string).
packages/models/src/models/llmgateway.ts, mistral.ts, moonshot.ts Model objects: rename model to id, add name property.
apps/gateway/src/models/models.ts Update model listing endpoint: use id and name instead of model; update parameter passing and description.
apps/next/src/components/models/models-list.tsx,
apps/ui/src/components/models/models-list.tsx Use id as React key, display name if available else id in model cards.
apps/next/src/components/playground/model-selector.tsx LocalModel interface: rename model to id, add optional name; update all usages accordingly.
apps/ui/src/components/playground/model-selector.tsx Update to use id instead of model for model identification and display logic.
apps/ui/src/routes/providers/$id.tsx Prefer displayName for model name, fallback to model identifier.
apps/api/src/routes/activity.ts, activity.spec.ts Rename model property to id in model usage schema and test assertions.
apps/gateway/src/chat/chat.ts Replace all model property accesses with id for model identification in chat completion logic.
apps/gateway/src/lib/costs.ts Lookup model by id instead of model in cost calculation logic.
apps/gateway/src/api.e2e.ts Replace all model property accesses with id in e2e test filtering and test cases.
apps/next/src/app/providers/[id]/page.tsx Use id as React key and display title for provider models list.
apps/next/src/components/activity/recent-logs.tsx, apps/ui/src/components/activity/recent-logs.tsx Use id instead of model for keys and values in model filter dropdown.
apps/next/src/components/dashboard/activity-chart.tsx, apps/ui/src/components/dashboard/activity-chart.tsx Replace model with id in model breakdown data processing and rendering.
apps/next/src/components/models-supported.tsx, apps/ui/src/components/models-supported.tsx Rename model property to id in ProviderModel interface and update all usages accordingly.
apps/next/src/components/usage/model-usage-table.tsx, apps/ui/src/components/usage/model-usage-table.tsx Replace all model property references with id in sorting, aggregation, keys, and rendering.
apps/next/src/lib/api/v1.d.ts, apps/ui/src/lib/api/v1.d.ts Rename model to id in activity endpoint response type definitions.
apps/next/src/types/activity.ts, apps/ui/src/types/activity.ts Rename model to id in activity model usage related interfaces.
packages/models/src/helpers.ts Lookup model by id instead of model in streaming support helper function.
packages/models/src/models.spec.ts Fix uniqueness test to map id property instead of model.
packages/models/src/provider-api.ts Lookup models by id instead of model in provider API functions.
.github/workflows/claude-code-review.yml Improve detection of "@claude" mentions using grep for case-insensitive matching in workflow step.

Sequence Diagram(s)

sequenceDiagram
    participant UI as UI Component
    participant Gateway as Gateway Endpoint
    participant Models as Model Definitions

    UI->>Gateway: Request model list
    Gateway->>Models: Fetch all models (with id, name)
    Models-->>Gateway: Return models [{id, name, ...}]
    Gateway-->>UI: Respond with models [{id, name, ...}]
    UI->>UI: Render models using id (key) and name (display)
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

✨ Finishing Touches
  • 📝 Generate Docstrings

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Explain this complex logic.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai explain this code block.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and explain its main purpose.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@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

🔭 Outside diff range comments (1)
packages/models/src/models.ts (1)

68-93: Refactor Remaining model References to id

The core interface change from model → id hasn’t been fully applied—there are still extensive references to .model across the codebase. This will cause build/type errors and inconsistent behavior at runtime. Please update all of these to use the new id property, and leverage name for any human-readable labels.

Key areas needing updates (non-exhaustive):

  • packages/models/src/provider-api.ts
    • remove or replace requestBody.model usages
    • update models.find((m) => m.model === model) → (m.id === model)
    • replace model.model in serialization to model.id

  • packages/models/src/models.spec.ts & packages/models/src/helpers.ts
    • change .map(model => model.model) → .map(model => model.id)
    • update find((m) => m.model === …) to use m.id

  • apps/ui (components, routes, playground, usage tables, dashboards)
    • replace all model.model → model.id
    • use model.name (or displayName) for UI labels instead of the old string
    • update key generation and sorting logic to use id

  • apps/api/src/routes (chats.ts, logs.ts)
    • replace body.model, query.model, chat.model → body.id, etc.
    • update DB queries and sanitization to reference the correct column/property

  • apps/gateway/src (chat.ts, models/models.ts, api.e2e.ts)
    • migrate every def.model, data.model, multiProviderModel.model → .id
    • update error messages and formatting that mention “model”

  • apps/next & apps/next/src/app/providers
    • the same .model → .id updates in pages, components, and API calls

After these replacements, run a full compile/type-check to ensure no lingering model properties remain.
Fix all occurrences to solidify this breaking change and maintain consistent usage of id + optional name.

🧹 Nitpick comments (2)
apps/ui/src/components/playground/model-selector.tsx (1)

18-19: Consider updating interface to reflect actual data structure.

The LocalModel interface still uses model: string but this property now contains the model's id. Consider renaming it to id: string for clarity and consistency with the upstream model definitions.

interface LocalModel {
-	model: string;
+	id: string;
	jsonOutput: boolean;
	// ... rest of interface
}

And update the corresponding usages throughout the component.

packages/models/src/models/openai.ts (1)

150-150: Update commented code to use new property names.

The commented-out o1-mini model still references the old model property. For consistency, update the comment to use the new schema.

-	// 	model: "o1-mini",
+	// 	id: "o1-mini",
+	// 	name: "o1 Mini",
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 001ed98 and a7f8197.

📒 Files selected for processing (18)
  • apps/gateway/src/models/models.ts (2 hunks)
  • apps/next/src/components/models/models-list.tsx (1 hunks)
  • apps/next/src/components/playground/model-selector.tsx (4 hunks)
  • apps/ui/src/components/models/models-list.tsx (1 hunks)
  • apps/ui/src/components/playground/model-selector.tsx (1 hunks)
  • apps/ui/src/routes/providers/$id.tsx (1 hunks)
  • packages/models/src/models.ts (1 hunks)
  • packages/models/src/models/alibaba.ts (3 hunks)
  • packages/models/src/models/anthropic.ts (7 hunks)
  • packages/models/src/models/deepseek.ts (4 hunks)
  • packages/models/src/models/google.ts (18 hunks)
  • packages/models/src/models/llmgateway.ts (2 hunks)
  • packages/models/src/models/meta.ts (4 hunks)
  • packages/models/src/models/mistral.ts (1 hunks)
  • packages/models/src/models/moonshot.ts (1 hunks)
  • packages/models/src/models/openai.ts (11 hunks)
  • packages/models/src/models/perplexity.ts (3 hunks)
  • packages/models/src/models/xai.ts (7 hunks)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
  • GitHub Check: autofix
🔇 Additional comments (22)
apps/ui/src/components/models/models-list.tsx (1)

15-16: LGTM! Clean refactor with proper fallback logic.

The changes correctly update the key to use model.id and implement appropriate fallback logic for display names using model.name || model.id.

apps/next/src/components/models/models-list.tsx (1)

15-16: LGTM! Consistent implementation across apps.

The changes mirror those in the UI app's models-list component, maintaining consistency in the refactor. The key and display logic updates are correct.

packages/models/src/models/mistral.ts (1)

5-6: LGTM! Proper model schema refactor.

The changes correctly implement the new schema by replacing model with id and adding a human-readable name property. The values are appropriate for both technical identification and user display.

packages/models/src/models/alibaba.ts (1)

5-6: LGTM! Consistent schema updates across all Alibaba models.

All three model definitions correctly implement the refactor by replacing model with id and adding appropriate human-readable name properties. The naming convention is consistent and user-friendly.

Also applies to: 25-26, 45-46

packages/models/src/models/moonshot.ts (1)

5-6: LGTM! Clean refactoring of model properties.

The replacement of model with id and name properties is correctly implemented. The id preserves the technical identifier while name provides a human-readable display name.

packages/models/src/models/meta.ts (1)

5-6: LGTM! Consistent model property refactoring across all entries.

All models correctly implement the model → id + name refactoring pattern. The human-readable names are well-formatted and the technical identifiers are preserved accurately.

Also applies to: 46-47, 65-66, 83-84

apps/ui/src/components/playground/model-selector.tsx (1)

63-63: Update correctly maps to new model schema.

The change from typedModel.model to typedModel.id correctly aligns with the refactored model definitions.

packages/models/src/models/xai.ts (1)

5-6: LGTM! Comprehensive and consistent model schema refactoring.

All xAI models correctly implement the model → id + name pattern. The human-readable names are descriptive and well-formatted (e.g., "Grok-3", "Grok-3 Mini", "Grok-2 Vision (1212)"), while preserving the exact technical identifiers.

Also applies to: 25-26, 45-46, 65-66, 85-86, 105-106, 126-127

packages/models/src/models/deepseek.ts (1)

5-6: LGTM! Consistent implementation of model schema refactoring.

All DeepSeek models correctly implement the model → id + name refactoring. The human-readable names are well-formatted (e.g., "DeepSeek V3", "DeepSeek R1", "DeepSeek R1 (0528)") while preserving the exact technical identifiers.

Also applies to: 36-37, 67-68, 98-99

packages/models/src/models/openai.ts (1)

5-6: LGTM! Consistent refactoring applied across all model definitions.

The refactoring from model to id and addition of name property is consistently applied across all OpenAI model definitions. The technical identifiers are preserved in id while human-readable names are provided in name.

Also applies to: 26-27, 46-47, 68-69, 88-89, 108-109, 128-129, 167-168, 187-188, 207-208, 227-228

packages/models/src/models/llmgateway.ts (1)

5-6: LGTM! Appropriate display names for special models.

The refactoring is correctly applied with descriptive display names that clearly communicate the purpose of these special llmgateway models to end users.

Also applies to: 23-24

apps/gateway/src/models/models.ts (1)

110-113: LGTM! Proper API adaptation with fallback logic.

The changes correctly adapt the API endpoint to use the new model schema:

  • Uses model.id for unique identification
  • Implements fallback logic (model.name || model.id) for display names
  • Updates description and parameter lookup to use the new id field

The fallback logic ensures robustness when the optional name property is not provided.

Also applies to: 162-162

packages/models/src/models/anthropic.ts (1)

5-6: LGTM! Well-structured display names with version information.

The refactoring is consistently applied across all Anthropic model definitions. The display names are particularly well-crafted, including version dates in parentheses where appropriate (e.g., "Claude 3.5 Sonnet (2024-10-22)"), which will help users distinguish between different model versions.

Also applies to: 25-26, 45-46, 65-66, 84-85, 103-104, 122-123

packages/models/src/models/google.ts (1)

5-6: LGTM! Comprehensive and consistent refactoring with clear naming patterns.

The refactoring is systematically applied across all Google model definitions. The display names follow logical patterns that effectively communicate model capabilities and versions (e.g., "Gemini 2.5 Pro", "Gemma 3 4B IT"). The inclusion of preview dates and model size information will help users make informed model selections.

Also applies to: 24-25, 43-44, 62-63, 81-82, 100-101, 119-120, 138-139, 157-158, 176-177, 195-196, 214-215, 233-234, 252-253, 271-272, 290-291, 310-311, 330-331

apps/next/src/components/playground/model-selector.tsx (5)

18-21: Interface correctly aligned with ModelDefinition.

The LocalModel interface properly mirrors the updated ModelDefinition structure with id and optional name properties.


64-69: Proper mapping from ModelDefinition to LocalModel.

The transformation correctly extracts id and name from the typed model definition while maintaining all other necessary properties.


71-71: Correct usage of id for model identification.

The lookup logic properly uses id instead of the previous model property for identifying the current model.


91-91: Excellent fallback logic for display names.

The display logic {currentModelInfo?.name || currentModelInfo?.id || selectedModel} provides a robust fallback hierarchy that ensures something meaningful is always shown to the user.


99-101: Consistent usage of id throughout the component.

All key references, selection handlers, and comparison logic correctly use model.id for identification while displaying model.name || model.id for better UX.

Also applies to: 115-117

packages/models/src/models/perplexity.ts (3)

4-24: Well-executed model definition refactor for sonar-reasoning-pro.

The transformation from model to id with the addition of the human-readable name "Sonar Reasoning Pro" is correctly implemented. The ID preserves the original identifier while the name provides better UX.


25-45: Consistent model structure for sonar-pro.

The model definition correctly follows the new pattern with id: "sonar-pro" and name: "Sonar Pro", maintaining consistency with the refactor approach.


46-67: Proper implementation for the sonar model.

The basic sonar model correctly implements the new structure with appropriate id and name properties. The naming convention is consistent across all Perplexity models.

Comment thread apps/ui/src/routes/providers/$id.tsx Outdated
@steebchen
steebchen force-pushed the feat/models-ids branch 2 times, most recently from 2563dc1 to 8076690 Compare July 23, 2025 19:10
Refactored model schema to use `id` and optional `name` instead of `model`.
Updated relevant components, providers, and logic to handle changes. Improved
readability and maintainability of model handling code.

@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: 0

🧹 Nitpick comments (1)
apps/next/src/app/providers/[id]/page.tsx (1)

48-48: Consider using the name property for user-facing display.

The changes correctly update the React key and title to use model.id instead of model.model, aligning with the refactored model schema. However, since the refactor introduces an optional name property for human-readable display names, consider using model.name || model.id for the card title to provide a better user experience.

<CardTitle className="text-base leading-tight line-clamp-1">
-	{model.id}
+	{model.name || model.id}
</CardTitle>

Also applies to: 53-53

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between a7f8197 and f388663.

📒 Files selected for processing (40)
  • .github/workflows/claude-code-review.yml (2 hunks)
  • apps/api/src/routes/activity.spec.ts (1 hunks)
  • apps/api/src/routes/activity.ts (2 hunks)
  • apps/gateway/src/api.e2e.ts (6 hunks)
  • apps/gateway/src/chat/chat.ts (7 hunks)
  • apps/gateway/src/lib/costs.ts (1 hunks)
  • apps/gateway/src/models/models.ts (2 hunks)
  • apps/next/src/app/providers/[id]/page.tsx (1 hunks)
  • apps/next/src/components/activity/recent-logs.tsx (1 hunks)
  • apps/next/src/components/dashboard/activity-chart.tsx (5 hunks)
  • apps/next/src/components/models-supported.tsx (5 hunks)
  • apps/next/src/components/models/models-list.tsx (1 hunks)
  • apps/next/src/components/playground/model-selector.tsx (4 hunks)
  • apps/next/src/components/usage/model-usage-table.tsx (5 hunks)
  • apps/next/src/lib/api/v1.d.ts (1 hunks)
  • apps/next/src/types/activity.ts (2 hunks)
  • apps/ui/src/components/activity/recent-logs.tsx (1 hunks)
  • apps/ui/src/components/dashboard/activity-chart.tsx (2 hunks)
  • apps/ui/src/components/models-supported.tsx (5 hunks)
  • apps/ui/src/components/models/models-list.tsx (1 hunks)
  • apps/ui/src/components/playground/model-selector.tsx (4 hunks)
  • apps/ui/src/components/usage/model-usage-table.tsx (5 hunks)
  • apps/ui/src/lib/api/v1.d.ts (1 hunks)
  • apps/ui/src/routes/providers/$id.tsx (1 hunks)
  • apps/ui/src/types/activity.ts (1 hunks)
  • packages/models/src/helpers.ts (1 hunks)
  • packages/models/src/models.spec.ts (1 hunks)
  • packages/models/src/models.ts (1 hunks)
  • packages/models/src/models/alibaba.ts (3 hunks)
  • packages/models/src/models/anthropic.ts (7 hunks)
  • packages/models/src/models/deepseek.ts (4 hunks)
  • packages/models/src/models/google.ts (18 hunks)
  • packages/models/src/models/llmgateway.ts (2 hunks)
  • packages/models/src/models/meta.ts (4 hunks)
  • packages/models/src/models/mistral.ts (1 hunks)
  • packages/models/src/models/moonshot.ts (1 hunks)
  • packages/models/src/models/openai.ts (11 hunks)
  • packages/models/src/models/perplexity.ts (3 hunks)
  • packages/models/src/models/xai.ts (7 hunks)
  • packages/models/src/provider-api.ts (2 hunks)
✅ Files skipped from review due to trivial changes (4)
  • apps/ui/src/components/models-supported.tsx
  • packages/models/src/models/alibaba.ts
  • packages/models/src/models/mistral.ts
  • apps/next/src/types/activity.ts
🚧 Files skipped from review as they are similar to previous changes (16)
  • apps/ui/src/components/models/models-list.tsx
  • packages/models/src/models/moonshot.ts
  • packages/models/src/models/openai.ts
  • packages/models/src/models.ts
  • apps/ui/src/components/playground/model-selector.tsx
  • packages/models/src/models/deepseek.ts
  • packages/models/src/models/google.ts
  • packages/models/src/models/xai.ts
  • packages/models/src/models/meta.ts
  • packages/models/src/models/anthropic.ts
  • apps/ui/src/routes/providers/$id.tsx
  • apps/next/src/components/playground/model-selector.tsx
  • apps/next/src/components/models/models-list.tsx
  • apps/gateway/src/models/models.ts
  • packages/models/src/models/perplexity.ts
  • packages/models/src/models/llmgateway.ts
🧰 Additional context used
🧬 Code Graph Analysis (6)
packages/models/src/helpers.ts (1)
packages/models/src/models.ts (1)
  • models (95-107)
packages/models/src/provider-api.ts (1)
packages/models/src/models.ts (1)
  • models (95-107)
packages/models/src/models.spec.ts (1)
packages/models/src/models.ts (1)
  • models (95-107)
apps/gateway/src/lib/costs.ts (1)
packages/models/src/models.ts (2)
  • models (95-107)
  • ModelDefinition (68-93)
apps/gateway/src/chat/chat.ts (1)
packages/models/src/models.ts (1)
  • models (95-107)
apps/gateway/src/api.e2e.ts (1)
packages/models/src/models.ts (1)
  • models (95-107)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (3)
  • GitHub Check: e2e / run
  • GitHub Check: build / run
  • GitHub Check: autofix
🔇 Additional comments (41)
.github/workflows/claude-code-review.yml (1)

33-34: LGTM! Improved robustness for handling GitHub event data.

These changes enhance the workflow's ability to safely handle multiline content and special characters in GitHub event data by using environment variables and grep instead of direct shell pattern matching. This prevents potential issues with quotes, newlines, and other special characters that could break the shell evaluation.

Also applies to: 42-42, 55-58

apps/api/src/routes/activity.spec.ts (1)

206-206: LGTM! Test updated to match the refactored model schema.

The test assertion correctly updates from checking the model property to checking the id property, aligning with the broader refactor to standardize model identification across the codebase.

packages/models/src/models.spec.ts (1)

7-7: LGTM! Test correctly updated for the refactored model schema.

The change from model.model to model.id properly aligns the uniqueness check with the new model identifier property. This ensures the test continues to validate that all models have unique identifiers using the correct field.

apps/ui/src/types/activity.ts (1)

2-2: LGTM! Type definition correctly updated for the refactored model schema.

The property rename from model to id in the ActivityModelUsage interface properly aligns with the broader refactor to standardize model identification across the codebase. This ensures type safety and consistency for activity-related data structures.

apps/ui/src/lib/api/v1.d.ts (1)

606-606: Property rename aligns with refactor goals.

The change from model to id in the modelBreakdown object is consistent with the broader refactor to standardize model identification across the codebase. However, note that this file is auto-generated (as indicated in the header), so changes should ideally be made in the source OpenAPI specification rather than directly in this file.

apps/ui/src/components/activity/recent-logs.tsx (1)

137-138: Model identifier updated consistently in filter dropdown.

The changes correctly update both the SelectItem key/value and display text from m.model to m.id, maintaining consistency in the model filter dropdown. This aligns with the broader refactor to standardize model identification using the id property.

apps/next/src/lib/api/v1.d.ts (1)

606-606: Consistent property rename across applications.

The change from model to id in the modelBreakdown object maintains consistency with the identical change in the UI application and aligns with the model identification refactor. As with the UI version, this file is auto-generated, so changes should ideally originate from the source OpenAPI specification.

packages/models/src/helpers.ts (1)

11-11: Model lookup updated to use standardized identifier.

The change correctly updates the model lookup from m.model to m.id, aligning with the broader refactor to standardize model identification. The function behavior remains the same while using the new property structure.

apps/next/src/components/activity/recent-logs.tsx (1)

269-270: LGTM! Model property refactoring correctly applied.

The changes properly update the model filter dropdown to use the new id property instead of model for both the SelectItem key and displayed text, maintaining consistency with the broader refactoring effort.

apps/api/src/routes/activity.ts (2)

12-12: LGTM! Schema property correctly updated.

The modelUsageSchema is properly updated to use id instead of model, maintaining consistency with the model identifier refactoring.


211-211: LGTM! Data aggregation updated consistently.

The model data aggregation correctly assigns the model identifier to the id property instead of model, ensuring the API response matches the updated schema.

apps/gateway/src/lib/costs.ts (1)

31-31: LGTM! Model lookup correctly updated.

The model lookup logic is properly updated to use the new id property instead of model, consistent with the refactored ModelDefinition interface shown in the relevant code snippets.

apps/next/src/components/models-supported.tsx (4)

39-39: LGTM! Interface properly updated.

The ProviderModel interface correctly changes from model: string to id: string, aligning with the model identifier refactoring.


87-87: LGTM! Data aggregation correctly updated.

The model data aggregation properly uses id: def.id instead of model: def.model, maintaining consistency with the new model schema.


103-103: LGTM! Sorting logic correctly updated.

The model sorting comparison is properly updated to use a.id.localeCompare(b.id) instead of the old model property.


319-319: LGTM! UI rendering consistently updated.

All UI-related references are correctly updated to use model.id instead of model.model for React keys, display text, clipboard operations, and state comparisons, ensuring the component works properly with the refactored model schema.

Also applies to: 326-326, 336-336, 339-339

apps/ui/src/components/dashboard/activity-chart.tsx (2)

45-45: LGTM! Unique models collection correctly updated.

The model collection logic is properly updated to use model.id instead of model.model for gathering unique models in the chart data.


287-287: LGTM! Chart data processing consistently updated.

All breakdown field assignments (cost, tokens, requests) are correctly updated to use model.id as the property key instead of model.model, ensuring the stacked bar chart renders properly with the refactored model schema.

Also applies to: 290-290, 294-294

packages/models/src/provider-api.ts (2)

245-245: LGTM! Model identifier property updated correctly.

The change from m.model to m.id aligns with the broader refactor to standardize model identification using the id property.


370-370: LGTM! Model mapping updated to use new identifier property.

The property mapping correctly updates from model: model.model to model: model.id to align with the new model schema structure.

apps/ui/src/components/usage/model-usage-table.tsx (5)

19-19: LGTM! Sort column type updated for new model identifier.

The SortColumn type correctly updates from "model" to "id" to match the new model property structure.


51-51: LGTM! Default sort direction logic updated correctly.

The condition properly updates from "model" to "id" while maintaining the same sorting behavior for string-based columns.


112-112: LGTM! Model aggregation key updated to use new identifier.

The aggregation key correctly uses model.id instead of model.model for proper model grouping in the usage table.


170-174: LGTM! Model column sort handlers updated correctly.

The sort handlers properly update to use "id" instead of "model" for the Model column sorting functionality.


217-218: LGTM! Table rendering updated to use new model identifier.

Both the row key and displayed model identifier correctly update from model.model to model.id for proper table rendering with the new schema.

apps/next/src/components/usage/model-usage-table.tsx (1)

21-21: LGTM! All model identifier references updated consistently.

All changes correctly update from the model property to id throughout the component:

  • SortColumn type definition
  • Default sort direction logic
  • Model aggregation key generation
  • Sort handlers for the Model column
  • Table row keys and displayed content

These changes align perfectly with the broader model schema refactor and maintain all existing functionality.

Also applies to: 62-62, 123-123, 165-169, 212-213

apps/gateway/src/api.e2e.ts (3)

47-47: LGTM! Test model filtering updated to use new identifier property.

The filter condition correctly updates from model.model to model.id to exclude "custom" and "auto" models from the test suite.


67-67: LGTM! Test case generation updated for new model schema.

All test case generation correctly updates to use model.id:

  • Root model test cases use model.id for the model identifier
  • Provider-specific test cases use model.id in the provider/model format
  • Original model tracking properly uses model.id for reference

The test logic remains intact while adapting to the new model property structure.

Also applies to: 87-89, 121-123


468-468: LGTM! Remaining test references updated consistently.

The model lookups correctly update to use the new id property:

  • JSON output test filter uses def.id for model matching
  • Multi-provider model test uses multiProviderModel.id for the request

These changes complete the consistent update of model identifier references throughout the test suite.

Also applies to: 794-794

apps/gateway/src/chat/chat.ts (8)

947-947: LGTM: Model lookup updated to use id property

The change from m.model to m.id is consistent with the broader refactor to standardize model identification using the id property instead of model.


980-980: LGTM: Direct model lookup updated consistently

The model lookup logic correctly uses the id property for direct model matching, maintaining consistency with the refactor.


991-991: LGTM: Error message updated to use standardized model identifier

The error message correctly references model?.id instead of model?.model, providing users with the proper model identifier format.


1031-1031: LGTM: Model information lookup uses correct property

The model lookup for pricing and configuration information correctly uses the id property, maintaining consistency with the standardized model identification.


1193-1193: LGTM: Auto-routing logic updated consistently

The special model type filtering correctly uses the id property to identify "auto" and "custom" models that should be skipped during auto-routing.


1266-1266: LGTM: Pricing lookup updated to use standardized identifier

The model lookup for pricing comparison correctly uses the id property, ensuring consistent model identification in cost optimization logic.


1316-1316: LGTM: Final model lookup uses correct identifier

The final model information lookup correctly uses the id property, ensuring the proper model configuration is retrieved after routing decisions.


1321-1321: LGTM: Base model name assignment uses standardized identifier

The assignment of baseModelName correctly uses finalModelInfo?.id, ensuring consistent model identification for subsequent operations like streaming support checks.

apps/next/src/components/dashboard/activity-chart.tsx (4)

39-39: LGTM: getUniqueModels function updated consistently

The function parameter type and property access are both correctly updated from model to id, maintaining the logic for extracting unique model identifiers from activity data.

Also applies to: 49-49


87-87: LGTM: Tooltip interface updated to match data structure

The TooltipPayload interface correctly updates the model identifier property from model to id, ensuring type consistency with the refactored data structure.


312-312: LGTM: Chart data type annotation updated consistently

The type annotation in the chart data processing correctly uses id: string instead of model: string, maintaining type safety with the updated data structure.


326-326: LGTM: Model breakdown processing updated consistently

All three breakdown field cases (cost, tokens, requests) correctly use model.id instead of model.model, maintaining consistent property access across the switch statement for chart data generation.

Also applies to: 329-329, 333-333

@steebchen
steebchen added this pull request to the merge queue Jul 23, 2025
Merged via the queue into main with commit b5d3428 Jul 23, 2025
@steebchen
steebchen deleted the feat/models-ids branch July 23, 2025 19:33
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