Skip to content

feat: expand canopywave models - #1132

Merged
steebchen merged 3 commits into
mainfrom
feat/newm
Nov 8, 2025
Merged

steebchen merged 3 commits into
mainfrom
feat/newm

Conversation

@steebchen

@steebchen steebchen commented Nov 8, 2025

Copy link
Copy Markdown
Member

Summary by CodeRabbit

  • New Features

    • Added support for three new AI models: GLM-4.6, Qwen3 Coder, and MiniMax M2 with integrated pricing, context windows, and advanced capabilities (streaming, tool calling, JSON output support)
  • Documentation

    • Added changelog documenting new model availability with pricing details and usage examples

@coderabbitai

coderabbitai Bot commented Nov 8, 2025

Copy link
Copy Markdown
Contributor

Walkthrough

The 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

Cohort / File(s) Summary
Changelog Documentation
apps/ui/src/content/changelog/2025-11-08-canopywave-new-models.md
New markdown file documenting CanopyWave's three new models (GLM-4.6, Qwen3 Coder, MiniMax M2) with pricing, context windows, features, usage examples, and 75% discount details.
Model Definitions
packages/models/src/models/minimax.ts
New file defining MiniMax M2 model metadata with CanopyWave provider configuration including pricing (0.14/0.42 per million tokens) and feature flags.
Model Catalog Exports
packages/models/src/models.ts
Added import and export of minimaxModels to extend the exported models array.
Model Provider Extensions
packages/models/src/models/alibaba.ts
Added Qwen3 Coder provider entry under Alibaba models with CanopyWave provider details including pricing and feature support.
Model Provider Extensions
packages/models/src/models/zai.ts
Added CanopyWave provider entry for GLM-4.6 model with pricing (0.45/1.5 per million tokens), 75% discount, and feature flags.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~12 minutes

  • Verify pricing and context window values match CanopyWave specifications
  • Confirm all provider entries follow the existing ModelDefinition structure and type constraints
  • Validate feature flags (streaming, tools, jsonOutput, etc.) are correctly configured for each model

Possibly related PRs

Suggested reviewers

  • smakosh

Pre-merge checks and finishing touches

✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'feat: expand canopywave models' directly and accurately summarizes the main change: adding new CanopyWave models (GLM-4.6, Qwen3 Coder, MiniMax M2) across the codebase.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch feat/newm

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

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

@steebchen

Copy link
Copy Markdown
Member Author

Images automagically compressed by Calibre's image-actions

Compression reduced images by 74%, saving 2.9 MB.

Filename Before After Improvement Visual comparison
apps/ui/public/changelog/canopywave75.png 4.0 MB 1.0 MB 74.0% View diff

@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)
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

📥 Commits

Reviewing files that changed from the base of the PR and between ead1503 and daee5d0.

⛔ Files ignored due to path filters (1)
  • apps/ui/public/changelog/canopywave75.png is 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.ts
  • packages/models/src/models/alibaba.ts
  • packages/models/src/models/zai.ts
  • packages/models/src/models.ts
**/*.{ts,tsx}

📄 CodeRabbit inference engine (CLAUDE.md)

**/*.{ts,tsx}: Never use any or as any in this TypeScript project unless absolutely necessary
Always use top-level import; do not use require or dynamic import()

Files:

  • packages/models/src/models/minimax.ts
  • packages/models/src/models/alibaba.ts
  • packages/models/src/models/zai.ts
  • packages/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 minimaxModels spread 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_KEY is 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 ModelDefinition interface. 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.75 field.

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: false vs true for 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.

Comment on lines +3 to +25
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[];

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.

⚠️ Potential issue | 🔴 Critical

🧩 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:

  1. The inputPrice/outputPrice should be 4x higher (base prices before discount), OR
  2. The changelog should show the lower final prices after discount, OR
  3. The interpretation/calculation of the discount field 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 1

Length 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 -5

Length 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 -100

Length 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 -la

Length 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:

  • inputPrice should be 1.0 / 1e6 (so 1.0 × 0.25 = 0.25 final)
  • outputPrice should be 4.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.

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.

1 participant