Skip to content

feat(models): add canopywave provider for glm-5.1 - #2057

Closed
steebchen wants to merge 2 commits into
mainfrom
canopywave-glm-5.1
Closed

steebchen wants to merge 2 commits into
mainfrom
canopywave-glm-5.1

Conversation

@steebchen

@steebchen steebchen commented Apr 21, 2026 •

Copy link
Copy Markdown
Member

Summary

  • Adds the canopywave provider entry for glm-5.1 at $1.40/$4.40/$0.26 per MTok (in/out/cached), 200K context, discount 0.3.

Note

Canopywave currently lists this model as "Coming Soon" — the endpoint returns "No available workers (all circuits open or unhealthy)" on requests. Leaving this PR open until canopywave brings the model online so we don't ship a broken route.

🤖 Generated with Claude Code

Summary by CodeRabbit

  • New Features
    • Added a new provider option for the glm-5.1 model offering alternative pricing (including a 30% discount) and request pricing.
    • This provider supports streaming, extended context and output limits, reasoning and tool use, but does not support vision, JSON output, or web search features.

Copilot AI review requested due to automatic review settings April 21, 2026 15:48
@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.

@coderabbitai

coderabbitai Bot commented Apr 21, 2026 •

Copy link
Copy Markdown
Contributor

Important

Review skipped

Too many files!

This PR contains 263 files, which is 113 over the limit of 150.

⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: 6dc037ce-5998-4f45-a54a-a78821cefbba

📥 Commits

Reviewing files that changed from the base of the PR and between 6e1329e and e0ec171.

⛔ Files ignored due to path filters (13)
  • apps/code/public/integrations/soulforge.png is excluded by !**/*.png
  • apps/code/src/lib/api/v1.d.ts is excluded by !**/v1.d.ts
  • apps/gateway/src/test-fixtures/test-image.png is excluded by !**/*.png
  • apps/playground/src/lib/api/v1.d.ts is excluded by !**/v1.d.ts
  • apps/ui/public/blog/how-to-estimate-llm-token-costs.png is excluded by !**/*.png
  • apps/ui/public/blog/llm-gateway-vs-direct-api.png is excluded by !**/*.png
  • apps/ui/public/blog/llm-gateway-vs-litellm.png is excluded by !**/*.png
  • apps/ui/public/blog/prompt-caching-explained.png is excluded by !**/*.png
  • apps/ui/public/changelog/devpass-product-hunt-launch.png is excluded by !**/*.png
  • apps/ui/public/integrations/soulforge.png is excluded by !**/*.png
  • apps/ui/src/lib/api/v1.d.ts is excluded by !**/v1.d.ts
  • ee/admin/src/lib/api/v1.d.ts is excluded by !**/v1.d.ts
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (263)
  • .env.example
  • .env.unified.example
  • .github/workflows/e2e.yml
  • .github/workflows/images.yml
  • .github/workflows/publish.yml
  • .github/workflows/run.yml
  • .gitignore
  • AGENTS.md
  • apps/api/package.json
  • apps/api/src/auth/config.spec.ts
  • apps/api/src/auth/config.ts
  • apps/api/src/routes/activity.ts
  • apps/api/src/routes/admin.ts
  • apps/api/src/routes/dev-plans.ts
  • apps/api/src/routes/internal-models.ts
  • apps/api/src/routes/keys-provider.spec.ts
  • apps/api/src/routes/keys-provider.ts
  • apps/api/src/routes/logs.spec.ts
  • apps/api/src/routes/logs.ts
  • apps/api/src/routes/organization.ts
  • apps/api/src/routes/payments.ts
  • apps/api/src/routes/subscriptions.ts
  • apps/api/src/stripe.ts
  • apps/api/src/testing.ts
  • apps/api/src/utils/email.ts
  • apps/code/package.json
  • apps/code/src/app/dashboard/DashboardClient.tsx
  • apps/code/src/app/dashboard/components/CodingAgents.tsx
  • apps/code/src/app/dashboard/components/InactivePlanChooser.tsx
  • apps/code/src/app/dashboard/components/QuickStart.tsx
  • apps/code/src/app/dashboard/components/UsageOverview.tsx
  • apps/code/src/app/forgot-password/page.tsx
  • apps/code/src/app/globals.css
  • apps/code/src/app/layout.tsx
  • apps/code/src/app/legal/layout.tsx
  • apps/code/src/app/legal/privacy/page.tsx
  • apps/code/src/app/legal/terms/page.tsx
  • apps/code/src/app/login/page.tsx
  • apps/code/src/app/page.tsx
  • apps/code/src/app/pricing/page.tsx
  • apps/code/src/app/reset-password/page.tsx
  • apps/code/src/app/robots.ts
  • apps/code/src/app/signup/page.tsx
  • apps/code/src/app/sitemap.ts
  • apps/code/src/components/CodingModelsShowcase.tsx
  • apps/code/src/components/Faq.tsx
  • apps/code/src/components/Footer.tsx
  • apps/code/src/components/Header.tsx
  • apps/code/src/components/PricingPlans.tsx
  • apps/code/src/components/ProductHuntIcon.tsx
  • apps/code/src/components/SoulForgeBoost.tsx
  • apps/code/src/components/TerminalPreview.tsx
  • apps/code/src/components/ui/accordion.tsx
  • apps/code/src/components/ui/chart.tsx
  • apps/docs/content/features/image-generation.mdx
  • apps/docs/content/features/routing.mdx
  • apps/docs/content/guides/cursor.mdx
  • apps/docs/content/guides/opencode.mdx
  • apps/docs/content/learn/api-keys.mdx
  • apps/docs/content/learn/billing.mdx
  • apps/docs/content/learn/policies.mdx
  • apps/docs/content/migrations/litellm.mdx
  • apps/docs/content/resources/rate-limits.mdx
  • apps/docs/package.json
  • apps/gateway/package.json
  • apps/gateway/src/anthropic/anthropic.ts
  • apps/gateway/src/api.spec.ts
  • apps/gateway/src/chat-helpers.e2e.ts
  • apps/gateway/src/chat/chat.ts
  • apps/gateway/src/chat/schemas/completions.ts
  • apps/gateway/src/chat/tools/collapse-image-gen-sse.spec.ts
  • apps/gateway/src/chat/tools/collapse-image-gen-sse.ts
  • apps/gateway/src/chat/tools/create-log-entry.ts
  • apps/gateway/src/chat/tools/detect-coding-agent.spec.ts
  • apps/gateway/src/chat/tools/detect-coding-agent.ts
  • apps/gateway/src/chat/tools/estimate-tokens-from-content.ts
  • apps/gateway/src/chat/tools/estimate-tokens.ts
  • apps/gateway/src/chat/tools/extract-token-usage.spec.ts
  • apps/gateway/src/chat/tools/extract-token-usage.ts
  • apps/gateway/src/chat/tools/get-finish-reason-from-error.spec.ts
  • apps/gateway/src/chat/tools/get-finish-reason-from-error.ts
  • apps/gateway/src/chat/tools/normalize-streaming-error.spec.ts
  • apps/gateway/src/chat/tools/parse-provider-response.spec.ts
  • apps/gateway/src/chat/tools/parse-provider-response.ts
  • apps/gateway/src/chat/tools/resolve-provider-context.ts
  • apps/gateway/src/chat/tools/retry-with-fallback.spec.ts
  • apps/gateway/src/chat/tools/retry-with-fallback.ts
  • apps/gateway/src/chat/tools/tokenizer.ts
  • apps/gateway/src/chat/tools/transform-openai-streaming.ts
  • apps/gateway/src/chat/tools/transform-response-to-openai.spec.ts
  • apps/gateway/src/chat/tools/transform-response-to-openai.ts
  • apps/gateway/src/chat/tools/transform-streaming-to-openai.spec.ts
  • apps/gateway/src/chat/tools/transform-streaming-to-openai.ts
  • apps/gateway/src/chat/tools/types.ts
  • apps/gateway/src/fallback.spec.ts
  • apps/gateway/src/images.e2e.ts
  • apps/gateway/src/images/images.ts
  • apps/gateway/src/lib/anthropic-pricing.spec.ts
  • apps/gateway/src/lib/cached-queries.ts
  • apps/gateway/src/lib/coding-models.spec.ts
  • apps/gateway/src/lib/coding-models.ts
  • apps/gateway/src/lib/costs.spec.ts
  • apps/gateway/src/lib/costs.ts
  • apps/gateway/src/lib/logs.spec.ts
  • apps/gateway/src/lib/logs.ts
  • apps/gateway/src/lib/prompt-tokens.spec.ts
  • apps/gateway/src/lib/rate-limit.spec.ts
  • apps/gateway/src/models/models.ts
  • apps/gateway/src/moderations/moderations.ts
  • apps/gateway/src/native-anthropic-cache.e2e.ts
  • apps/gateway/src/responses.e2e.ts
  • apps/gateway/src/responses/openresponses-compliance.spec.ts
  • apps/gateway/src/responses/responses.spec.ts
  • apps/gateway/src/responses/responses.ts
  • apps/gateway/src/responses/schemas.ts
  • apps/gateway/src/responses/tools/convert-chat-to-responses.ts
  • apps/gateway/src/responses/tools/convert-responses-to-chat.ts
  • apps/gateway/src/responses/tools/convert-streaming-to-responses.ts
  • apps/gateway/src/test-utils/mock-openai-server.ts
  • apps/gateway/src/videos/videos.spec.ts
  • apps/gateway/src/videos/videos.ts
  • apps/playground/package.json
  • apps/playground/src/app/api/chat/route.ts
  • apps/playground/src/app/api/image/route.ts
  • apps/playground/src/components/credits/top-up-credits-dialog.tsx
  • apps/playground/src/components/model-selector.tsx
  • apps/playground/src/components/playground/chat-page-client.tsx
  • apps/playground/src/components/playground/chat-ui.tsx
  • apps/playground/src/components/playground/image-controls.tsx
  • apps/playground/src/components/playground/image-page-client.tsx
  • apps/playground/src/components/playground/video-page-client.tsx
  • apps/playground/src/lib/fetch-models.ts
  • apps/playground/src/lib/image-gen.ts
  • apps/playground/src/lib/stripe.ts
  • apps/playground/src/lib/video-gen.ts
  • apps/ui/next.config.ts
  • apps/ui/package.json
  • apps/ui/src/app/dashboard/[orgId]/[projectId]/activity/[logId]/log-detail-client.tsx
  • apps/ui/src/app/forgot-password/layout.tsx
  • apps/ui/src/app/forgot-password/page.tsx
  • apps/ui/src/app/login/page.tsx
  • apps/ui/src/app/migration/[slug]/page.tsx
  • apps/ui/src/app/models/[name]/page.tsx
  • apps/ui/src/app/models/[name]/uptime/page.tsx
  • apps/ui/src/app/page.tsx
  • apps/ui/src/app/providers/[id]/page.tsx
  • apps/ui/src/app/reset-password/layout.tsx
  • apps/ui/src/app/reset-password/page.tsx
  • apps/ui/src/app/sitemap.ts
  • apps/ui/src/components/activity/recent-logs.tsx
  • apps/ui/src/components/billing/auto-topup-settings.tsx
  • apps/ui/src/components/credits/top-up-credits-dialog.tsx
  • apps/ui/src/components/dashboard/log-card.tsx
  • apps/ui/src/components/integrations/integration-cards.tsx
  • apps/ui/src/components/landing/faq.tsx
  • apps/ui/src/components/landing/footer.tsx
  • apps/ui/src/components/landing/hero.tsx
  • apps/ui/src/components/landing/navbar.tsx
  • apps/ui/src/components/landing/product-hunt-popup.tsx
  • apps/ui/src/components/models-supported.tsx
  • apps/ui/src/components/models/adapt-model.ts
  • apps/ui/src/components/models/all-models.tsx
  • apps/ui/src/components/models/model-benchmarks.tsx
  • apps/ui/src/components/models/model-card.tsx
  • apps/ui/src/components/models/model-uptime-charts.tsx
  • apps/ui/src/components/pricing/pricing-table.tsx
  • apps/ui/src/components/provider-keys/provider-logo.ts
  • apps/ui/src/content/blog/2025-11-28-black-friday-credits-promo.md
  • apps/ui/src/content/blog/2025-12-01-cyber-monday-credits-promo.md
  • apps/ui/src/content/blog/2025-12-18-q4-2025.md
  • apps/ui/src/content/blog/2026-04-23-llm-gateway-vs-litellm.md
  • apps/ui/src/content/blog/2026-04-24-how-to-estimate-llm-token-costs.md
  • apps/ui/src/content/blog/2026-04-25-prompt-caching-explained.md
  • apps/ui/src/content/blog/2026-04-26-llm-gateway-vs-direct-api.md
  • apps/ui/src/content/changelog/2025-05-01-gateway-v1-launch.md
  • apps/ui/src/content/changelog/2025-06-15-pro-subscription-launch.md
  • apps/ui/src/content/changelog/2026-01-21-pro-features-now-free.md
  • apps/ui/src/content/changelog/2026-01-29-dev-plans-web-search-minimax.md
  • apps/ui/src/content/changelog/2026-03-23-video-gen-sessions-and-more.md
  • apps/ui/src/content/changelog/2026-05-07-devpass-product-hunt-launch.md
  • apps/ui/src/content/legal/privacy.md
  • apps/ui/src/lib/fetch-models.ts
  • apps/ui/src/lib/utils/markdown-code-block.tsx
  • apps/ui/src/types/activity.ts
  • apps/worker/src/services/follow-up-emails.ts
  • apps/worker/src/services/project-stats-aggregator.ts
  • apps/worker/src/services/stats-calculator.spec.ts
  • apps/worker/src/services/stats-calculator.ts
  • apps/worker/src/services/sync-models.ts
  • apps/worker/src/services/video-jobs.ts
  • apps/worker/src/shutdown.spec.ts
  • apps/worker/src/shutdown.ts
  • apps/worker/src/worker.ts
  • docs/providers/openai/gpt-image-2/openai-gpt-image-2.md
  • ee/admin/package.json
  • ee/admin/src/app/devpass/[orgId]/page.tsx
  • ee/admin/src/app/devpass/page.tsx
  • ee/admin/src/app/model-provider-mappings/page.tsx
  • ee/admin/src/app/models/page.tsx
  • ee/admin/src/app/organizations/[orgId]/org-metrics.tsx
  • ee/admin/src/app/organizations/[orgId]/projects/[projectId]/model-provider-mappings/page.tsx
  • ee/admin/src/app/organizations/[orgId]/projects/[projectId]/project-logs.tsx
  • ee/admin/src/app/organizations/[orgId]/projects/[projectId]/project-metrics.tsx
  • ee/admin/src/app/organizations/page.tsx
  • ee/admin/src/app/providers/page.tsx
  • ee/admin/src/components/admin-shell.tsx
  • ee/admin/src/components/delete-user-button.tsx
  • ee/admin/src/components/org-status-toggle-button.tsx
  • ee/admin/src/components/project-mappings-table.tsx
  • ee/admin/src/components/time-window-selector.tsx
  • ee/admin/src/lib/admin-history.ts
  • ee/admin/src/lib/admin-organizations.ts
  • ee/admin/src/lib/page-window.ts
  • eslint.config.mjs
  • package.json
  • packages/actions/src/get-cheapest-from-available-providers.ts
  • packages/actions/src/get-provider-endpoint.spec.ts
  • packages/actions/src/get-provider-endpoint.ts
  • packages/actions/src/get-provider-headers.ts
  • packages/actions/src/models.spec.ts
  • packages/actions/src/prepare-request-body.spec.ts
  • packages/actions/src/prepare-request-body.ts
  • packages/actions/src/process-image-url.ts
  • packages/actions/src/transform-anthropic-messages.ts
  • packages/cache/src/swr.ts
  • packages/db/migrations/1777241148_zippy_impossible_man.sql
  • packages/db/migrations/1777809234_unique_madame_hydra.sql
  • packages/db/migrations/1778083846_early_excalibur.sql
  • packages/db/migrations/meta/1777241148_snapshot.json
  • packages/db/migrations/meta/1777809234_snapshot.json
  • packages/db/migrations/meta/1778083846_snapshot.json
  • packages/db/migrations/meta/_journal.json
  • packages/db/package.json
  • packages/db/src/provider-metrics.spec.ts
  • packages/db/src/provider-metrics.ts
  • packages/db/src/schema.ts
  • packages/db/src/seed.ts
  • packages/models/src/models.ts
  • packages/models/src/models/alibaba.ts
  • packages/models/src/models/anthropic.ts
  • packages/models/src/models/deepseek.ts
  • packages/models/src/models/google.ts
  • packages/models/src/models/meta.ts
  • packages/models/src/models/mimo.ts
  • packages/models/src/models/minimax.ts
  • packages/models/src/models/mistral.ts
  • packages/models/src/models/moonshot.ts
  • packages/models/src/models/openai.ts
  • packages/models/src/models/xai.ts
  • packages/models/src/models/zai.ts
  • packages/models/src/providers.ts
  • packages/models/src/types.ts
  • packages/shared/src/components/integration-icons.tsx
  • packages/shared/src/components/log-card.tsx
  • packages/shared/src/components/provider-icons.tsx
  • packages/shared/src/dev-plans.ts
  • packages/shared/src/fees.spec.ts
  • packages/shared/src/fees.ts
  • packages/shared/src/index.ts
  • packages/shared/src/token-estimate.spec.ts
  • packages/shared/src/token-estimate.ts
  • scripts/image-edit.sh
  • scripts/load.sh

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

Walkthrough

Added a new provider entry for providerId: "canopywave" under zaiModels for id: "glm-5.1", specifying pricing, limits, and capability flags (streaming, reasoning, tools enabled; vision and JSON output disabled; 0.3 discount).

Changes

Cohort / File(s) Summary
Provider Configuration
packages/models/src/models/zai.ts
Added canopywave provider for glm-5.1 with pricing (per-1e6 rates, discount: 0.3), limits (contextSize: 200000, maxOutput: 128000), capability flags (streaming, reasoning, tools = true; vision, jsonOutput = false), and no webSearch/webSearchPrice.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Possibly related PRs

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely describes the main change: adding a new provider configuration for the glm-5.1 model.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch canopywave-glm-5.1

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.

@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

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@packages/models/src/models/zai.ts`:
- Around line 30-45: The mapping for providerId "canopywave" and modelName
"zai/glm-5.1" must be gated until the upstream model is live: update that object
to mirror other unstable Canopywave entries by adding test: "skip" and
stability: "unstable" and include a deactivatedAt timestamp (or otherwise mark
it inactive) so runtime routing and E2E tests won’t hit the unavailable
endpoint; alternatively remove/hold this entry until the provider reports
healthy — locate the object with providerId "canopywave" and modelName
"zai/glm-5.1" and apply the gating fields (test, stability, deactivatedAt)
consistent with the patterns used for "glm-5" and "glm-4.7".
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: d6a0f141-21e0-4a96-b1c8-d39ab7bd42e1

📥 Commits

Reviewing files that changed from the base of the PR and between 931e7dd and 1e5c3de.

📒 Files selected for processing (1)
  • packages/models/src/models/zai.ts

Comment on lines +30 to +45
{
providerId: "canopywave",
modelName: "zai/glm-5.1",
inputPrice: 1.4 / 1e6,
cachedInputPrice: 0.26 / 1e6,
outputPrice: 4.4 / 1e6,
discount: 0.3,
requestPrice: 0,
contextSize: 200000,
maxOutput: 128000,
streaming: true,
reasoning: true,
vision: false,
tools: true,
jsonOutput: false,
},

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 | 🟠 Major

Gate this mapping until Canopywave brings glm-5.1 online.

Per the PR description, Canopywave currently lists glm-5.1 as "Coming Soon" and the endpoint returns No available workers (all circuits open or unhealthy). If this is merged before the upstream model is live, live traffic routed here (and E2E tests) will fail. Consider mirroring the pattern already used for other not-yet-stable Canopywave entries in this file — e.g. test: "skip" (as on canopywave glm-5 at line 75) and/or stability: "unstable" with a deactivatedAt (as on canopywave glm-4.7 at lines 451-453) — so the mapping can land safely and be flipped on once the provider is healthy. Alternatively, keep the PR unmerged until the endpoint is functional, as the description suggests.

🛡️ Suggested guard while upstream is unavailable
 			{
 				providerId: "canopywave",
+				test: "skip",
+				stability: "unstable",
 				modelName: "zai/glm-5.1",
 				inputPrice: 1.4 / 1e6,
 				cachedInputPrice: 0.26 / 1e6,
 				outputPrice: 4.4 / 1e6,
 				discount: 0.3,
 				requestPrice: 0,
 				contextSize: 200000,
 				maxOutput: 128000,
 				streaming: true,
 				reasoning: true,
 				vision: false,
 				tools: true,
 				jsonOutput: false,
 			},
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
{
providerId: "canopywave",
modelName: "zai/glm-5.1",
inputPrice: 1.4 / 1e6,
cachedInputPrice: 0.26 / 1e6,
outputPrice: 4.4 / 1e6,
discount: 0.3,
requestPrice: 0,
contextSize: 200000,
maxOutput: 128000,
streaming: true,
reasoning: true,
vision: false,
tools: true,
jsonOutput: false,
},
{
providerId: "canopywave",
test: "skip",
stability: "unstable",
modelName: "zai/glm-5.1",
inputPrice: 1.4 / 1e6,
cachedInputPrice: 0.26 / 1e6,
outputPrice: 4.4 / 1e6,
discount: 0.3,
requestPrice: 0,
contextSize: 200000,
maxOutput: 128000,
streaming: true,
reasoning: true,
vision: false,
tools: true,
jsonOutput: false,
},
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@packages/models/src/models/zai.ts` around lines 30 - 45, The mapping for
providerId "canopywave" and modelName "zai/glm-5.1" must be gated until the
upstream model is live: update that object to mirror other unstable Canopywave
entries by adding test: "skip" and stability: "unstable" and include a
deactivatedAt timestamp (or otherwise mark it inactive) so runtime routing and
E2E tests won’t hit the unavailable endpoint; alternatively remove/hold this
entry until the provider reports healthy — locate the object with providerId
"canopywave" and modelName "zai/glm-5.1" and apply the gating fields (test,
stability, deactivatedAt) consistent with the patterns used for "glm-5" and
"glm-4.7".

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds a new canopywave provider mapping for the ZAI glm-5.1 model so it can be routed/priced as an additional upstream option alongside the existing zai provider entry.

Changes:

  • Adds providerId: "canopywave" mapping for glm-5.1 with pricing, context/output limits, and capability flags.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

inputPrice: 1.4 / 1e6,
cachedInputPrice: 0.26 / 1e6,
outputPrice: 4.4 / 1e6,
discount: 0.3,

Copilot AI Apr 21, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This Canopywave mapping has a larger discount (0.3) than the existing zai mapping (0.1) while keeping the same base token prices, which makes Canopywave the cheapest route for glm-5.1. In production routing, getCheapestFromAvailableProviders() uses discount in its price calculation, and when metrics are missing it will pick the cheapest provider purely by price—so this entry is likely to become the default route even while the Canopywave endpoint is still returning "No available workers".

To avoid shipping a default route to an unavailable upstream, gate this mapping until the model is live (e.g., set stability: "experimental"/"unstable" so it’s excluded from auto-routing, or temporarily remove/zero the discount so it won’t win price-based selection).

Suggested change
discount: 0.3,
discount: 0,

Copilot uses AI. Check for mistakes.
Comment on lines +31 to +35
providerId: "canopywave",
modelName: "zai/glm-5.1",
inputPrice: 1.4 / 1e6,
cachedInputPrice: 0.26 / 1e6,
outputPrice: 4.4 / 1e6,

Copilot AI Apr 21, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This provider mapping is not marked with test: "skip". The gateway E2E suite enumerates provider-specific test cases from model.providers and will attempt requests for each provider unless test: "skip" (or stability exclusion in non-FULL_MODE) is set; given Canopywave currently returns "No available workers", this is likely to make CI/E2E fail if the suite reaches this model.

Consider adding test: "skip" (and/or stability: "experimental"/"unstable") until the upstream is actually available, then remove the skip flag when it’s ready to be exercised by tests.

Copilot uses AI. Check for mistakes.
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
@steebchen
steebchen force-pushed the canopywave-glm-5.1 branch from 1e5c3de to 6e1329e Compare April 22, 2026 11:04
Merged origin/main into canopywave-glm-5.1. Resolved conflict in
packages/models/src/models/zai.ts by keeping both the canopywave
provider entry (from PR) and the together-ai provider entry (from
main) for glm-5.1.

Also restored canopywave provider definition in providers.ts and
endpoint URL in get-provider-endpoint.ts, which were removed from
main (#2162) but are needed by this PR.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

Copy link
Copy Markdown
Collaborator

Resolved merge conflict with origin/main.

Conflict in packages/models/src/models/zai.ts:

  • PR added a canopywave provider entry for glm-5.1
  • main (via chore: remove canopywave provider and model mappings #2162) had removed canopywave entirely, and separately added a together-ai provider entry for glm-5.1
  • Resolution: kept both provider entries — canopywave (from this PR) and together-ai (from main)

Additional fixes needed:

  • Restored canopywave provider definition in packages/models/src/providers.ts (was removed in chore: remove canopywave provider and model mappings #2162 but required by this PR's model entry)
  • Restored canopywave endpoint URL (https://inference.canopywave.io) in packages/actions/src/get-provider-endpoint.ts
  • Added canopywave to the streaming transform fall-through cases in transform-streaming-to-openai.ts

TypeScript compilation passes. 94 unit tests pass.

@steebchen steebchen closed this May 7, 2026
@steebchen
steebchen deleted the canopywave-glm-5.1 branch May 7, 2026 14: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.

3 participants