feat(models): refactor model id and add model names - #515
Conversation
|
""" WalkthroughThis change standardizes model identification across the codebase by replacing the Changes
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)
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Possibly related PRs
✨ Finishing Touches
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. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed 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)
Other keywords and placeholders
CodeRabbit Configuration File (
|
There was a problem hiding this comment.
Actionable comments posted: 1
🔭 Outside diff range comments (1)
packages/models/src/models.ts (1)
68-93: Refactor RemainingmodelReferences toidThe core interface change from
model→idhasn’t been fully applied—there are still extensive references to.modelacross the codebase. This will cause build/type errors and inconsistent behavior at runtime. Please update all of these to use the newidproperty, and leveragenamefor any human-readable labels.Key areas needing updates (non-exhaustive):
packages/models/src/provider-api.ts
• remove or replacerequestBody.modelusages
• updatemodels.find((m) => m.model === model)→(m.id === model)
• replacemodel.modelin serialization tomodel.idpackages/models/src/models.spec.ts & packages/models/src/helpers.ts
• change.map(model => model.model)→.map(model => model.id)
• updatefind((m) => m.model === …)to usem.idapps/ui (components, routes, playground, usage tables, dashboards)
• replace allmodel.model→model.id
• usemodel.name(ordisplayName) for UI labels instead of the old string
• update key generation and sorting logic to useidapps/api/src/routes (chats.ts, logs.ts)
• replacebody.model,query.model,chat.model→body.id, etc.
• update DB queries and sanitization to reference the correct column/propertyapps/gateway/src (chat.ts, models/models.ts, api.e2e.ts)
• migrate everydef.model,data.model,multiProviderModel.model→.id
• update error messages and formatting that mention “model”apps/next & apps/next/src/app/providers
• the same.model→.idupdates in pages, components, and API callsAfter these replacements, run a full compile/type-check to ensure no lingering
modelproperties remain.
Fix all occurrences to solidify this breaking change and maintain consistent usage ofid+ optionalname.
🧹 Nitpick comments (2)
apps/ui/src/components/playground/model-selector.tsx (1)
18-19: Consider updating interface to reflect actual data structure.The
LocalModelinterface still usesmodel: stringbut this property now contains the model'sid. Consider renaming it toid: stringfor 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
modelproperty. 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
📒 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.idand implement appropriate fallback logic for display names usingmodel.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
modelwithidand adding a human-readablenameproperty. 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
modelwithidand adding appropriate human-readablenameproperties. 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
modelwithidandnameproperties is correctly implemented. Theidpreserves the technical identifier whilenameprovides 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+namerefactoring 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.modeltotypedModel.idcorrectly 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+namepattern. 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+namerefactoring. 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
modeltoidand addition ofnameproperty is consistently applied across all OpenAI model definitions. The technical identifiers are preserved inidwhile human-readable names are provided inname.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.idfor unique identification- Implements fallback logic (
model.name || model.id) for display names- Updates description and parameter lookup to use the new
idfieldThe fallback logic ensures robustness when the optional
nameproperty 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
LocalModelinterface properly mirrors the updatedModelDefinitionstructure withidand optionalnameproperties.
64-69: Proper mapping from ModelDefinition to LocalModel.The transformation correctly extracts
idandnamefrom the typed model definition while maintaining all other necessary properties.
71-71: Correct usage of id for model identification.The lookup logic properly uses
idinstead of the previousmodelproperty 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.idfor identification while displayingmodel.name || model.idfor 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
modeltoidwith the addition of the human-readablename"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"andname: "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
idandnameproperties. The naming convention is consistent across all Perplexity models.
2563dc1 to
8076690
Compare
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.
8076690 to
f388663
Compare
There was a problem hiding this comment.
Actionable comments posted: 0
🧹 Nitpick comments (1)
apps/next/src/app/providers/[id]/page.tsx (1)
48-48: Consider using thenameproperty for user-facing display.The changes correctly update the React key and title to use
model.idinstead ofmodel.model, aligning with the refactored model schema. However, since the refactor introduces an optionalnameproperty for human-readable display names, consider usingmodel.name || model.idfor 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
📒 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
grepinstead 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
modelproperty to checking theidproperty, 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.modeltomodel.idproperly 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
modeltoidin theActivityModelUsageinterface 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
modeltoidin themodelBreakdownobject 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
SelectItemkey/value and display text fromm.modeltom.id, maintaining consistency in the model filter dropdown. This aligns with the broader refactor to standardize model identification using theidproperty.apps/next/src/lib/api/v1.d.ts (1)
606-606: Consistent property rename across applications.The change from
modeltoidin themodelBreakdownobject 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.modeltom.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
idproperty instead ofmodelfor 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
modelUsageSchemais properly updated to useidinstead ofmodel, 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
idproperty instead ofmodel, 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
idproperty instead ofmodel, consistent with the refactoredModelDefinitioninterface shown in the relevant code snippets.apps/next/src/components/models-supported.tsx (4)
39-39: LGTM! Interface properly updated.The
ProviderModelinterface correctly changes frommodel: stringtoid: string, aligning with the model identifier refactoring.
87-87: LGTM! Data aggregation correctly updated.The model data aggregation properly uses
id: def.idinstead ofmodel: 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 oldmodelproperty.
319-319: LGTM! UI rendering consistently updated.All UI-related references are correctly updated to use
model.idinstead ofmodel.modelfor 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.idinstead ofmodel.modelfor 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.idas the property key instead ofmodel.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.modeltom.idaligns with the broader refactor to standardize model identification using theidproperty.
370-370: LGTM! Model mapping updated to use new identifier property.The property mapping correctly updates from
model: model.modeltomodel: model.idto 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
SortColumntype 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.idinstead ofmodel.modelfor 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.modeltomodel.idfor 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
modelproperty toidthroughout the component:
SortColumntype 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.modeltomodel.idto 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.idfor the model identifier- Provider-specific test cases use
model.idin the provider/model format- Original model tracking properly uses
model.idfor referenceThe 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
idproperty:
- JSON output test filter uses
def.idfor model matching- Multi-provider model test uses
multiProviderModel.idfor the requestThese 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 useidpropertyThe change from
m.modeltom.idis consistent with the broader refactor to standardize model identification using theidproperty instead ofmodel.
980-980: LGTM: Direct model lookup updated consistentlyThe model lookup logic correctly uses the
idproperty for direct model matching, maintaining consistency with the refactor.
991-991: LGTM: Error message updated to use standardized model identifierThe error message correctly references
model?.idinstead ofmodel?.model, providing users with the proper model identifier format.
1031-1031: LGTM: Model information lookup uses correct propertyThe model lookup for pricing and configuration information correctly uses the
idproperty, maintaining consistency with the standardized model identification.
1193-1193: LGTM: Auto-routing logic updated consistentlyThe special model type filtering correctly uses the
idproperty to identify "auto" and "custom" models that should be skipped during auto-routing.
1266-1266: LGTM: Pricing lookup updated to use standardized identifierThe model lookup for pricing comparison correctly uses the
idproperty, ensuring consistent model identification in cost optimization logic.
1316-1316: LGTM: Final model lookup uses correct identifierThe final model information lookup correctly uses the
idproperty, ensuring the proper model configuration is retrieved after routing decisions.
1321-1321: LGTM: Base model name assignment uses standardized identifierThe assignment of
baseModelNamecorrectly usesfinalModelInfo?.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 consistentlyThe function parameter type and property access are both correctly updated from
modeltoid, 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 structureThe
TooltipPayloadinterface correctly updates the model identifier property frommodeltoid, ensuring type consistency with the refactored data structure.
312-312: LGTM: Chart data type annotation updated consistentlyThe type annotation in the chart data processing correctly uses
id: stringinstead ofmodel: string, maintaining type safety with the updated data structure.
326-326: LGTM: Model breakdown processing updated consistentlyAll three breakdown field cases (cost, tokens, requests) correctly use
model.idinstead ofmodel.model, maintaining consistent property access across the switch statement for chart data generation.Also applies to: 329-329, 333-333
Refactored model schema to use
idand optionalnameinstead ofmodel. Updated relevant components, providers, and logic to handle changes. Improved readability and maintainability of model handling code.Summary by CodeRabbit
New Features
Refactor
modeltoid, introducing anameproperty for clearer model display throughout the app.idandnamefields consistently.idfor improved data accuracy and consistency.