feat(models): add new Alibaba and Moonshot model entries - #624
Conversation
WalkthroughAdds four new Alibaba Qwen models with NEBIUS provider configurations and appends a NEBIUS provider to the Moonshot Kimi-K2 model. No existing providers or exports are modified. Fields include pricing, context/output limits, streaming, vision, tools, jsonOutput, and one model with reasoning enabled. Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Possibly related PRs
Suggested reviewers
Tip 🔌 Remote MCP (Model Context Protocol) integration is now available!Pro plan users can now connect to remote MCP servers from the Integrations page. Connect with popular remote MCPs such as Notion and Linear to add more context to your reviews and chats. ✨ Finishing Touches
🧪 Generate unit tests
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. CodeRabbit Commands (Invoked using PR/Issue comments)Type Other keywords and placeholders
CodeRabbit Configuration File (
|
Added support for new models: 1. Qwen3 Coder 480B A35B Instruct 2. Qwen3 Coder 30B A3B Instruct 3. Qwen3 30B A3B Instruct 2507 4. Qwen3 30B A3B Thinking 2507 5. Moonshot Kimi-K2 Instruct These models include metadata for pricing, features, and configurations.
bf74173 to
beeb5d7
Compare
There was a problem hiding this comment.
Actionable comments posted: 1
🧹 Nitpick comments (4)
packages/models/src/models/alibaba.ts (4)
290-311: Use 262144 (power-of-two) for contextSize unless 262000 is provider-accurate262000 looks like a rounded 256k. If NEBIUS advertises 262144 tokens, prefer exact. If 262000 is the documented limit, keep as-is and add a brief comment.
- contextSize: 262000, + contextSize: 262144,
312-333: Same contextSize precision check for qwen3-coder-30b-a3b-instructMirror the precision fix here as well if applicable.
- contextSize: 262000, + contextSize: 262144,
334-355: Same contextSize precision check for qwen3-30b-a3b-instruct-2507Apply the exact 256k token window if that’s the real limit.
- contextSize: 262000, + contextSize: 262144,
356-378: Reasoning flag: verify ModelDefinition support and runtime handling
- You’ve added reasoning: true for the “Thinking 2507” variant—nice. Please confirm ModelDefinition includes this field and that downstream routing enables “reasoning” paths (e.g., tool-use restrictions, token accounting, or special headers).
- Same contextSize note as above.
- contextSize: 262000, + contextSize: 262144,Optional follow-up: if reasoning requires additional metadata (e.g., reasoningMaxTokens, reasoningPrice), ensure those are modeled consistently across “thinking” models in this repo.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
💡 Knowledge Base configuration:
- MCP integration is disabled by default for public repositories
- Jira integration is disabled by default for public repositories
- Linear integration is disabled by default for public repositories
You can enable these sources in your CodeRabbit configuration.
📒 Files selected for processing (2)
packages/models/src/models/alibaba.ts(1 hunks)packages/models/src/models/moonshot.ts(1 hunks)
🧰 Additional context used
📓 Path-based instructions (3)
**/*.{js,jsx,ts,tsx}
📄 CodeRabbit inference engine (.github/copilot-instructions.md)
Use localStorage instead of cookies for client-side data persistence
Files:
packages/models/src/models/moonshot.tspackages/models/src/models/alibaba.ts
**/*.{js,ts}
📄 CodeRabbit inference engine (.github/copilot-instructions.md)
**/*.{js,ts}: Use drizzle with the latest object syntax for database operations
For read queries, always usedb().query.<table>.findMany()ordb().query.<table>.findFirst()
Files:
packages/models/src/models/moonshot.tspackages/models/src/models/alibaba.ts
**/*.{ts,tsx}
📄 CodeRabbit inference engine (.cursor/rules/general.mdc)
Never use
as anyor: anyin TypeScript files.
Files:
packages/models/src/models/moonshot.tspackages/models/src/models/alibaba.ts
⏰ 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). (2)
- GitHub Check: build / run
- GitHub Check: e2e / run
🔇 Additional comments (1)
packages/models/src/models/moonshot.ts (1)
49-60: Please verify NEBIUS K2 settings and CI gating
- Confirm that
maxOutputfor thenebiusprovider (currently 8192) is correct. Other K2 providers use 131072; if the lower cap is intentional, document it in the release notes, otherwise align them.- Ensure the
modelNameslug casing is accurate. It’s"moonshotai/Kimi-K2-Instruct"here vs."moonshotai/kimi-k2-instruct"for Novita—normalize if the endpoint is case-insensitive.- If your CI environment lacks NEBIUS credentials, add
test: "skip"to thenebiusentry to mirror Cloudrift’s approach and avoid flaky tests.No automatic patch applied—please review and adjust as needed:
{ providerId: "nebius", modelName: "moonshotai/Kimi-K2-Instruct", inputPrice: 0.5 / 1e6, outputPrice: 2.4 / 1e6, requestPrice: 0, contextSize: 131072, - maxOutput: 8192, + // TODO: confirm if this should be 131072 to match other K2 providers streaming: true, vision: false, tools: true, + // TODO: add `test: "skip"` if NEBIUS creds aren’t available in CI },
| { | ||
| id: "qwen3-coder-480b-a35b-instruct", | ||
| name: "Qwen3 Coder 480B A35B Instruct", | ||
| family: "alibaba", | ||
| deprecatedAt: undefined, | ||
| deactivatedAt: undefined, | ||
| providers: [ | ||
| { | ||
| providerId: "nebius", | ||
| modelName: "Qwen/Qwen3-Coder-480B-A35B-Instruct", | ||
| inputPrice: 0.4 / 1e6, | ||
| outputPrice: 1.8 / 1e6, | ||
| requestPrice: 0, | ||
| contextSize: 262000, | ||
| maxOutput: 8192, | ||
| streaming: true, | ||
| vision: false, | ||
| tools: true, | ||
| }, | ||
| ], | ||
| jsonOutput: true, | ||
| }, | ||
| { | ||
| id: "qwen3-coder-30b-a3b-instruct", | ||
| name: "Qwen3 Coder 30B A3B Instruct", | ||
| family: "alibaba", | ||
| deprecatedAt: undefined, | ||
| deactivatedAt: undefined, | ||
| providers: [ | ||
| { | ||
| providerId: "nebius", | ||
| modelName: "Qwen/Qwen3-Coder-30B-A3B-Instruct", | ||
| inputPrice: 0.1 / 1e6, | ||
| outputPrice: 0.3 / 1e6, | ||
| requestPrice: 0, | ||
| contextSize: 262000, | ||
| maxOutput: 8192, | ||
| streaming: true, | ||
| vision: false, | ||
| tools: true, | ||
| }, | ||
| ], | ||
| jsonOutput: true, | ||
| }, | ||
| { | ||
| id: "qwen3-30b-a3b-instruct-2507", | ||
| name: "Qwen3 30B A3B Instruct 2507", | ||
| family: "alibaba", | ||
| deprecatedAt: undefined, | ||
| deactivatedAt: undefined, | ||
| providers: [ | ||
| { | ||
| providerId: "nebius", | ||
| modelName: "Qwen/Qwen3-30B-A3B-Instruct-2507", | ||
| inputPrice: 0.1 / 1e6, | ||
| outputPrice: 0.3 / 1e6, | ||
| requestPrice: 0, | ||
| contextSize: 262000, | ||
| maxOutput: 8192, | ||
| streaming: true, | ||
| vision: false, | ||
| tools: true, | ||
| }, | ||
| ], | ||
| jsonOutput: true, | ||
| }, | ||
| { | ||
| id: "qwen3-30b-a3b-thinking-2507", | ||
| name: "Qwen3 30B A3B Thinking 2507", | ||
| family: "alibaba", | ||
| deprecatedAt: undefined, | ||
| deactivatedAt: undefined, | ||
| providers: [ | ||
| { | ||
| providerId: "nebius", | ||
| modelName: "Qwen/Qwen3-30B-A3B-Thinking-2507", | ||
| inputPrice: 0.1 / 1e6, | ||
| outputPrice: 0.3 / 1e6, | ||
| requestPrice: 0, | ||
| contextSize: 262000, | ||
| maxOutput: 8192, | ||
| streaming: true, | ||
| vision: false, | ||
| tools: true, | ||
| reasoning: true, | ||
| }, | ||
| ], | ||
| jsonOutput: true, | ||
| }, |
There was a problem hiding this comment.
💡 Verification agent
🧩 Analysis chain
Sanity checks for IDs, pricing units, and caps across new Qwen entries
Everything else reads clean (ids, names, pricing units per 1e6, jsonOutput/tooling flags). To avoid subtle drift, run the quick verifications below:
If all checks are green (no output for 1 and 3; no CAP MISMATCH in 2), we’re good to ship.
🏁 Script executed:
#!/bin/bash
set -euo pipefail
FILE="packages/models/src/models/alibaba.ts"
echo "1) Check for duplicate model ids in alibaba.ts"
rg -nP 'id:\s*"[A-Za-z0-9\.\-]+"' "$FILE" | \
awk -F'"' '{print $2}' | sort | uniq -d | sed 's/^/DUPLICATE ID: /' || true
echo "2) Ensure maxOutput <= contextSize for all providers"
python - <<'PY'
import re, sys, json
text=open("packages/models/src/models/alibaba.ts").read()
blocks=re.split(r'\},\s*\{', text)
for b in blocks:
idm=re.search(r'id:\s*"([^"]+)"', b)
if not idm: continue
mid=idm.group(1)
for prov in re.finditer(r'contextSize:\s*(\d+).+?maxOutput:\s*(\d+)', b, re.S):
ctx=int(prov.group(1)); out=int(prov.group(2))
if out>ctx:
print(f"CAP MISMATCH: {mid} maxOutput {out} exceeds contextSize {ctx}")
PY
echo "3) Flag non power-of-two-ish context sizes around 256k"
rg -nP 'contextSize:\s*262000' "$FILE" || true
echo "4) Quick scan of modelName slugs for new entries"
rg -nP -n -C1 'Qwen/Qwen3-(Coder-480B-A35B-Instruct|Coder-30B-A3B-Instruct|30B-A3B-(Instruct|Thinking)-2507)' "$FILE"Length of output: 1477
Verify non–power-of-two contextSize values in alibaba.ts
The sanity checks for IDs and pricing caps passed with no duplicates and no maxOutput exceeding contextSize. However, the script flagged four occurrences of contextSize: 262000, which is not a power-of-two (the typical 256 KiB value would be 262144):
• packages/models/src/models/alibaba.ts:303
• packages/models/src/models/alibaba.ts:325
• packages/models/src/models/alibaba.ts:347
• packages/models/src/models/alibaba.ts:369
Please confirm whether 262000 is intentional or if these should be updated to 262144 (or another exact power-of-two) to accurately reflect the supported context window.
🤖 Prompt for AI Agents
In packages/models/src/models/alibaba.ts around lines 290 to 378, four model
entries set contextSize: 262000 which is not a power-of-two and likely meant to
be 262144 (256 KiB); update the contextSize field for the entries at ~lines 303,
325, 347, and 369 from 262000 to 262144 (or confirm the intended exact
power-of-two and use that), then run typechecks/lint/tests to ensure no other
references need updating.
Added support for new models:
These models include metadata for pricing, features, and configurations.
Summary by CodeRabbit