Skip to content

feat(models): add Qwen3.8 Max on Alibaba - #3392

Merged
steebchen merged 3 commits into
mainfrom
feat/qwen3.8-max
Aug 3, 2026
Merged

steebchen merged 3 commits into
mainfrom
feat/qwen3.8-max

Conversation

@smakosh

@smakosh smakosh commented Aug 3, 2026 •

Copy link
Copy Markdown
Member

Summary

Adds Qwen3.8 Max (qwen3.8-max), Alibaba's new flagship 2.4-trillion-parameter MoE model released Aug 2, 2026, hosted on Alibaba Cloud Model Studio.

Model details

  • Pricing: input $2/M, output $6/M, implicit cache $0.25/M, explicit cache read $0.17/M, explicit cache creation $2.5/M (source)
  • Context: 1M tokens, max output: 131K (131072)
  • Capabilities: adaptive thinking with budget control (reasoningMaxTokens, reasoningOutput: "omit" since thinking may be skipped for simple prompts), native vision, tools, web search ($0.01/call), structured outputs
  • Mirrors the qwen3.7-max mapping conventions; region-agnostic mapping (defaults to Singapore) matching how qwen3.7-max launched — regional pricing overrides can be added once verified

Verification

Verified live against the Singapore endpoint (dashscope-intl):

  • Basic chat works and returns reasoning_content by default (adaptive thinking)
  • Vision input works (image correctly described, image_tokens billed)
  • response_format: json_object and reasoning_effort accepted
  • enable_thinking: false disables thinking → supports the none effort translation
  • enable_search: true accepted
  • tool_choice: "required" rejected in thinking mode ("The tool_choice parameter does not support being set to required or object in thinking mode"), confirming the standard trimmed Qwen thinking-model supportedParameters

US/Beijing region availability could not be verified (local key is Singapore-bound), hence no regions declared.

  • TEST_MODELS="alibaba/qwen3.8-max" pnpm test:e2e — 99 passed, 0 failed
  • Model package specs (113 tests), pnpm build, pnpm format all pass

🤖 Generated with Claude Code

https://claude.ai/code/session_01FtNvmWsGcGwGPPSdsaYN1y

Summary by CodeRabbit

  • New Features
    • Added support for Alibaba’s qwen3.8-max model.
    • Enables reasoning, vision, tool use, web search, JSON output, and extended context handling.
    • Includes model pricing and supported configuration options.

Add qwen3.8-max, Alibaba's new flagship 2.4T-parameter MoE model
(released Aug 2, 2026): 1M context, 131K max output, adaptive
thinking with budget control, native vision, tools, web search,
and structured outputs. $2/M input, $6/M output, implicit cache
$0.25/M, explicit cache read $0.17/M, cache creation $2.5/M.

Verified live on the Singapore endpoint: chat, vision input,
json_object, reasoning_effort, enable_thinking toggle, and
enable_search all work; tool_choice "required"/object is
rejected in thinking mode (standard Qwen thinking constraint),
so the mapping keeps the trimmed supportedParameters list.

Claude-Session: https://claude.ai/code/session_01FtNvmWsGcGwGPPSdsaYN1y
@coderabbitai

coderabbitai Bot commented Aug 3, 2026 •

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 19558736-d9c4-4d24-8287-2e8977234924

📥 Commits

Reviewing files that changed from the base of the PR and between e534e36 and b1c0044.

📒 Files selected for processing (2)
  • apps/gateway/src/lib/alibaba-pricing.spec.ts
  • packages/models/src/models/alibaba.ts

Walkthrough

The Alibaba model registry now includes qwen3.8-max. Alibaba pricing tests accept its published nonstandard cache rates and retain multiplier-based validation for other models.

Changes

Alibaba Qwen model

Layer / File(s) Summary
Add qwen3.8-max model definition
packages/models/src/models/alibaba.ts
Adds Alibaba provider metadata, pricing, token limits, reasoning, vision, tools, web search, JSON output, and supported parameters.
Validate published cache rates
apps/gateway/src/lib/alibaba-pricing.spec.ts
Adds cache-rate overrides for off-ratio Alibaba prices and applies them to implicit and explicit cache pricing assertions.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Possibly related PRs

Suggested reviewers: steebchen, ratchaw, vicovaro

🚥 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 identifies the addition of the Qwen3.8 Max model on Alibaba, which is the main change.
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.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/qwen3.8-max

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.

@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: 2

🧹 Nitpick comments (2)
packages/models/src/models/alibaba.ts (2)

1621-1625: 🗄️ Data Integrity & Integration | 🔵 Trivial | 💤 Low value

Add a comment documenting Alibaba Token Plan pricing semantics.

Alibaba Token Plan consumption is Cred-its-based and depends on model type, token usage, thinking mode, and tool calls; it does not expose a fixed per-token USD formula. These inputPrice, outputPrice, and cache prices are gateway estimates only and should state that source.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@packages/models/src/models/alibaba.ts` around lines 1621 - 1625, Add a
concise comment adjacent to the Alibaba pricing fields in the model definition
explaining that Token Plan consumption is credit-based and varies by model type,
token usage, thinking mode, and tool calls; clarify that input, output, and
cache prices are gateway estimates rather than a fixed per-token USD formula.

1619-1620: 🗄️ Data Integrity & Integration | 🔵 Trivial

Document the Token Plan route for qwen3.8-max.

This model is Token Plan-only, but it is exposed as an international mapping without noting the Token Plan endpoint/credentials. Add documentation or a region label so deployers distinguish Token Plan routing from the existing Model Studio provider.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@packages/models/src/models/alibaba.ts` around lines 1619 - 1620, Update the
qwen3.8-max mapping near providerId "alibaba" to document that it uses Alibaba’s
Token Plan route and credentials, or add the established region label that
distinguishes Token Plan routing from the international Model Studio provider.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@packages/models/src/models/alibaba.ts`:
- Around line 1638-1649: Update the Alibaba Qwen model mapping around
supportedParameters to match the Token Plan contract: either restrict
reasoning_effort to the documented supported range, or remove it from the
mapping if "none" would disable thinking and is invalid for this endpoint.
Ensure the exposed gateway parameters cannot request unsupported non-thinking
behavior.
- Around line 1619-1620: Update the Alibaba model mapping identified by
providerId "alibaba" to set externalId to the documented upstream model name
"qwen3.8-max-preview", preserving the rest of the mapping unchanged.

---

Nitpick comments:
In `@packages/models/src/models/alibaba.ts`:
- Around line 1621-1625: Add a concise comment adjacent to the Alibaba pricing
fields in the model definition explaining that Token Plan consumption is
credit-based and varies by model type, token usage, thinking mode, and tool
calls; clarify that input, output, and cache prices are gateway estimates rather
than a fixed per-token USD formula.
- Around line 1619-1620: Update the qwen3.8-max mapping near providerId
"alibaba" to document that it uses Alibaba’s Token Plan route and credentials,
or add the established region label that distinguishes Token Plan routing from
the international Model Studio provider.
🪄 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 Plus

Run ID: b71d3c22-582f-4029-9e1a-2527543be75f

📥 Commits

Reviewing files that changed from the base of the PR and between 44da286 and e534e36.

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

Comment thread packages/models/src/models/alibaba.ts
Comment thread packages/models/src/models/alibaba.ts
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.

2 participants