Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🧩 Analysis chain
🏁 Script executed:
Repository: QuantumNous/new-api
Length of output: 66
🏁 Script executed:
# Check the file size and examine the specific lines wc -l setting/ratio_setting/model_ratio.goRepository: QuantumNous/new-api
Length of output: 103
🏁 Script executed:
Repository: QuantumNous/new-api
Length of output: 1374
🏁 Script executed:
Repository: QuantumNous/new-api
Length of output: 451
🏁 Script executed:
Repository: QuantumNous/new-api
Length of output: 114
🏁 Script executed:
Repository: QuantumNous/new-api
Length of output: 1649
🏁 Script executed:
Repository: QuantumNous/new-api
Length of output: 45
🏁 Script executed:
Repository: QuantumNous/new-api
Length of output: 505
🏁 Script executed:
Repository: QuantumNous/new-api
Length of output: 387
🏁 Script executed:
Repository: QuantumNous/new-api
Length of output: 411
🏁 Script executed:
Repository: QuantumNous/new-api
Length of output: 397
🏁 Script executed:
Repository: QuantumNous/new-api
Length of output: 458
🏁 Script executed:
Repository: QuantumNous/new-api
Length of output: 622
🏁 Script executed:
Repository: QuantumNous/new-api
Length of output: 182
🏁 Script executed:
Repository: QuantumNous/new-api
Length of output: 536
Fix suffix-stripping logic to avoid breaking legitimate model names.
The suffix-stripping logic breaks pricing lookup for legitimate models that end with reasoning-effort suffixes. Specifically,
yi-mediumgets normalized toyi, which doesn't exist in the pricing map, causing lookup failures.The issue is that the logic strips suffixes from ANY model, not just reasoning-effort variants. The o3-mini variants work because they're explicitly defined with each suffix variant, but models like
yi-mediumare legitimate standalone models with their own pricing and should not be normalized.Fix: Only strip reasoning-effort suffixes from models that support reasoning (e.g., o3-mini variants), or verify the base model exists in the pricing map before stripping. Otherwise, add explicit model entries for the non-suffixed variants, or use a more selective approach that doesn't affect existing models.
🤖 Prompt for AI Agents