Conversation
WalkthroughThe pull request adds three new AI model definitions to the LLM gateway platform: GLM-4.6, Qwen3 Coder, and MiniMax M2, integrated with the CanopyWave provider. These model definitions include pricing, context windows, and feature metadata. A changelog documenting these model additions with usage examples and discount information is also included. Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~12 minutes
Possibly related PRs
Suggested reviewers
Pre-merge checks and finishing touches✅ Passed checks (3 passed)
✨ Finishing touches
🧪 Generate unit tests (beta)
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. Comment |
|
Images automagically compressed by Calibre's image-actions ✨ Compression reduced images by 74%, saving 2.9 MB.
|
There was a problem hiding this comment.
Actionable comments posted: 1
🧹 Nitpick comments (1)
apps/ui/src/content/changelog/2025-11-08-canopywave-new-models.md (1)
24-24: Consider hyphenating "tool-calling" for consistency.While "tool calling capabilities" is grammatically acceptable, "tool-calling capabilities" (with hyphen) follows the more formal convention for compound adjectives and may improve readability.
Apply this diff if desired:
-- Enhanced reasoning and tool calling capabilities +- Enhanced reasoning and tool-calling capabilities
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
⛔ Files ignored due to path filters (1)
apps/ui/public/changelog/canopywave75.pngis excluded by!**/*.png
📒 Files selected for processing (5)
apps/ui/src/content/changelog/2025-11-08-canopywave-new-models.md(1 hunks)packages/models/src/models.ts(2 hunks)packages/models/src/models/alibaba.ts(1 hunks)packages/models/src/models/minimax.ts(1 hunks)packages/models/src/models/zai.ts(1 hunks)
🧰 Additional context used
📓 Path-based instructions (2)
**/*.{ts,tsx,js,jsx}
📄 CodeRabbit inference engine (AGENTS.md)
Always use top-level import; never use require() or dynamic import()
Files:
packages/models/src/models/minimax.tspackages/models/src/models/alibaba.tspackages/models/src/models/zai.tspackages/models/src/models.ts
**/*.{ts,tsx}
📄 CodeRabbit inference engine (CLAUDE.md)
**/*.{ts,tsx}: Never useanyoras anyin this TypeScript project unless absolutely necessary
Always use top-levelimport; do not userequireor dynamicimport()
Files:
packages/models/src/models/minimax.tspackages/models/src/models/alibaba.tspackages/models/src/models/zai.tspackages/models/src/models.ts
🧬 Code graph analysis (2)
packages/models/src/models/minimax.ts (1)
packages/models/src/models.ts (1)
ModelDefinition(125-166)
packages/models/src/models.ts (1)
packages/models/src/models/minimax.ts (1)
minimaxModels(3-25)
🪛 Gitleaks (8.28.0)
apps/ui/src/content/changelog/2025-11-08-canopywave-new-models.md
[high] 47-48: Discovered a potential authorization token provided in a curl command header, which could compromise the curl accessed resource.
(curl-auth-header)
🪛 LanguageTool
apps/ui/src/content/changelog/2025-11-08-canopywave-new-models.md
[grammar] ~24-~24: Use a hyphen to join words.
Context: ... (75% off) - Enhanced reasoning and tool calling capabilities ### *Qwen3 Coder...
(QB_NEW_EN_HYPHEN)
⏰ 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). (9)
- GitHub Check: e2e-shards (4)
- GitHub Check: e2e-shards (3)
- GitHub Check: e2e-shards (5)
- GitHub Check: e2e-shards (1)
- GitHub Check: e2e-shards (2)
- GitHub Check: test / run
- GitHub Check: build / run
- GitHub Check: lint / run
- GitHub Check: autofix
🔇 Additional comments (5)
packages/models/src/models.ts (2)
8-8: LGTM!The import follows coding guidelines using top-level import syntax and is consistent with the existing pattern for other model imports.
179-179: LGTM!The
minimaxModelsspread is correctly integrated into the models array with proper alphabetical positioning.apps/ui/src/content/changelog/2025-11-08-canopywave-new-models.md (1)
1-63: LGTM! Well-structured changelog entry.The changelog is clear, informative, and well-organized. The pricing details, context windows, and feature descriptions align with the code changes (note: see pricing/discount calculation concern flagged in the minimax.ts review).
The static analysis warning about the curl auth header is a false positive—
YOUR_API_KEYis clearly a placeholder for documentation purposes.packages/models/src/models/alibaba.ts (1)
581-601: LGTM! Model definition is well-structured.The Qwen3 Coder model entry follows the established pattern and correctly implements the
ModelDefinitioninterface. All feature flags and metadata are properly defined.Note: This model shares the same pricing/discount calculation concern flagged in the minimax.ts review regarding the interpretation of the
discount: 0.75field.packages/models/src/models/zai.ts (1)
158-172: LGTM! Provider entry correctly extends glm-4.6 model.The canopywave provider entry is properly structured and follows the pattern for multi-provider model support. The feature flag differences (particularly
reasoning: falsevstruefor the zai provider) and slight context size variation (202,752 vs 200,000 tokens) are expected when different providers offer the same model with varying capabilities.Note: This provider shares the same pricing/discount calculation concern flagged in the minimax.ts review.
| export const minimaxModels = [ | ||
| { | ||
| id: "minimax-m2", | ||
| name: "MiniMax M2", | ||
| family: "minimax", | ||
| providers: [ | ||
| { | ||
| providerId: "canopywave", | ||
| modelName: "minimax/minimax-m2", | ||
| inputPrice: 0.25 / 1e6, | ||
| outputPrice: 1.0 / 1e6, | ||
| discount: 0.75, | ||
| requestPrice: 0, | ||
| contextSize: 196608, | ||
| maxOutput: undefined, | ||
| streaming: true, | ||
| vision: false, | ||
| tools: true, | ||
| jsonOutput: true, | ||
| }, | ||
| ], | ||
| }, | ||
| ] as const satisfies ModelDefinition[]; |
There was a problem hiding this comment.
🧩 Analysis chain
Verify pricing and discount calculation consistency.
The discount: 0.75 field combined with the current inputPrice and outputPrice values creates a potential inconsistency with the changelog. According to the ProviderModelMapping interface comment in packages/models/src/models.ts (line 48-50), discount represents the discount percentage where 0.5 = 50% off. This means discount: 0.75 indicates 75% off, so the final user-facing price should be base * (1 - 0.75) = base * 0.25.
With the current values:
- Input: 0.25 / 1e6 with 75% discount = $0.0625 per 1M tokens (final)
- Output: 1.0 / 1e6 with 75% discount = $0.25 per 1M tokens (final)
However, the changelog (lines 39, 40) states: "$0.25 per 1M input tokens / $1.00 per 1M output tokens (75% off)", which matches the base prices in the code, not the discounted prices.
This same issue affects all three models (GLM-4.6, Qwen3 Coder, and MiniMax M2).
Either:
- The
inputPrice/outputPriceshould be 4x higher (base prices before discount), OR - The changelog should show the lower final prices after discount, OR
- The interpretation/calculation of the
discountfield needs clarification
Please clarify the intended pricing model and ensure consistency between code and documentation. You may want to verify this with the team or check how the discount field is actually applied in the pricing calculation logic elsewhere in the codebase.
🏁 Script executed:
#!/bin/bash
# Search for how the discount field is used in pricing calculations
rg -n -C 5 'discount' --type ts -g '!**/models/**' -g '!**/*.test.ts'Length of output: 27987
🏁 Script executed:
#!/bin/bash
# Check model definitions with discount field to see if pattern is consistent
rg -n 'discount:' packages/models/src/models --type ts -A 1 -B 1Length of output: 11177
🏁 Script executed:
#!/bin/bash
# Search for changelog to verify what "$0.25" refers to (base vs final price)
find . -name 'CHANGELOG*' -o -name 'changelog*' -o -name 'CHANGES*' | head -5Length of output: 327
🏁 Script executed:
#!/bin/bash
# Find and display the changelog entry for minimax pricing
grep -r "0.25\|minimax\|Minimax" ./apps/ui/src/content/changelog -A 5 -B 5 | head -100Length of output: 2558
🏁 Script executed:
#!/bin/bash
# Also check if there's a specific date/entry mentioning the pricing changes
find ./apps/ui/src/content/changelog -type f -name "*.md*" -o -name "*.ts*" | head -5 | xargs ls -laLength of output: 604
The pricing calculation is incorrect and will undercharge users by approximately 75%.
The changelog entry for MiniMax M2 explicitly states "$0.25 per 1M input tokens / $1.00 per 1M output tokens (75% off)" — these are the final prices users should pay. However, the code applies the discount as a second multiplier:
final_price = base_price × (1 - discount)
= (0.25 / 1e6) × (1 - 0.75)
= (0.25 / 1e6) × 0.25
= 0.0625 / 1e6
Users would be charged $0.0625 per 1M tokens, not the documented $0.25.
Fix: Adjust inputPrice and outputPrice to represent base prices before discount:
inputPriceshould be1.0 / 1e6(so 1.0 × 0.25 = 0.25 final)outputPriceshould be4.0 / 1e6(so 4.0 × 0.25 = 1.0 final)
This same issue affects other models with discounts in the codebase (alibaba, zai, etc.).
🤖 Prompt for AI Agents
In packages/models/src/models/minimax.ts around lines 3 to 25, the configured
inputPrice/outputPrice are already discounted but the code applies the discount
again, resulting in undercharging; change inputPrice to the pre-discount base of
1.0 / 1e6 and outputPrice to 4.0 / 1e6 so that applying discount: base ×
discount (0.25) yields the advertised $0.25/$1.00 per 1M tokens, and audit other
model entries that set a discount to ensure their input/output prices are the
undiscounted base values.
Summary by CodeRabbit
New Features
Documentation