feat(providers): add Alibaba Cloud Token Plan provider - #35347
Conversation
Add support for Alibaba Cloud Token Plan (Team Edition), a subscription-based billing model hitting a separate endpoint (token-plan.cn-beijing.maas.aliyuncs.com). Changes: - Register 'alibaba-token-plan' in PROVIDER_REGISTRY (auth.py) - Add provider overlay with openai_chat transport (providers.py) - Add curated model list: qwen3.7-max, deepseek-v4-pro, kimi-k2.6, glm-5.1, etc. - Add aliases: alibaba_token_plan, alibaba-token, aliyun-token-plan, token-plan - Add doctor check for ALIBABA_TOKEN_PLAN_API_KEY / DASHSCOPE_API_KEY - Add URL-to-provider mapping in model_metadata.py - Extend system prompt model identity workaround to cover token-plan provider - Add bundled plugin profile (plugins/model-providers/alibaba-token-plan/) - Add spot-check in test_plugin_discovery.py Docs: https://help.aliyun.com/zh/model-studio/token-plan-overview
|
Note: This appears to be a resubmission of #33109 (same feature, closed 2026-05-28). If the prior PR was closed for specific reasons, please address that feedback in this PR description. |
|
Thanks for picking this up, the wiring here looks clean and the transport call is right. For context on who is commenting: I have been working on the Alibaba Token Plan metadata across the wider ecosystem. On models.dev I added the newest model to the Global Token Plan provider and created the separate On the open question from @alt-glitch about #33109: this PR already resolves the two reasons that one was closed. #33109 was self-closed for branch drift and for leaving the transport choice undocumented (it defaulted to the Anthropic-compatible surface, which the author flagged as needing to be "documented more clearly"). This PR settles that by using Two suggestions: 1. Ship both regions, with Global as the default. Token Plan is two separate gateways (Singapore and Beijing) with different consoles, catalogs, and keys, so it is cleanest to model them the way the repo already models MiniMax (
2. Add "alibaba-token-plan": [
"qwen3.7-max",
"qwen3.7-plus",
"qwen3.6-plus",
...I've gone ahead and left a PR on your branch with both changes: cudasuan#1. It targets (Drafted with AI assistance and reviewed by me before posting.) |
|
Opened #52915, which carries this work forward onto current |
|
Thanks for the careful provider wiring and for documenting the Token Plan endpoint and transport choice. This automated hermes-sweeper review is closing this under the standing in-tree provider-integration policy.
Please publish the Alibaba Token Plan integration as a standalone model-provider plugin repository and share it in Closed as not-planned per standing maintainer policy ( |
Summary
Add support for Alibaba Cloud Token Plan (Team Edition) — a subscription-based billing model with a separate API endpoint (
token-plan.cn-beijing.maas.aliyuncs.com).Docs: https://help.aliyun.com/zh/model-studio/token-plan-overview
Changes
alibaba-token-planinPROVIDER_REGISTRYwithapi_keyauth type and base URLHermesOverlaywithopenai_chattransport + alias mappingsALIBABA_TOKEN_PLAN_API_KEY/DASHSCOPE_API_KEYAliases
alibaba_token_plan,alibaba-token,aliyun-token-plan,token-planall resolve toalibaba-token-plan.Testing
pytest tests/providers/test_plugin_discovery.py— 4 passedhermes sendon weixin channel — LLM responds correctly