Skip to content

Commit 7e63d2e

Browse files
committed
feat: add alibaba-token-plan-intl provider for international token plan
- Add ALIBABA_INTL_TOKEN_PLAN_BASE_URL and region choices in base-url-choices.ts - Add alibaba-token-plan-intl registry entry with international model list, reasoning efforts, input modalities, and baseUrlChoices (intl-default/payg/custom) - Add icon, display name, brand color mappings for all alibaba* providers - Update provider-registry-parity test with new provider ID and allowBaseUrlOverride list
1 parent e246b9d commit 7e63d2e

4 files changed

Lines changed: 88 additions & 5 deletions

File tree

gui/src/provider-icons.ts

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,9 @@ const PROVIDER_ICON_ALIASES: Record<string, string> = {
3333
"opencode-zen": "opencode.svg",
3434
openrouter: "openrouter-color.svg",
3535
qianfan: "qianfan-color.svg",
36+
alibaba: "alibaba-color.svg",
37+
"alibaba-token-plan": "alibaba-color.svg",
38+
"alibaba-token-plan-intl": "alibaba-color.svg",
3639
"qwen-cloud": "qwen-portal-color.svg",
3740
"vercel-ai-gateway": "vercel-ai-gateway-color.svg",
3841
vllm: "vllm-color.svg",
@@ -58,8 +61,11 @@ const PROVIDER_BRAND_COLORS: Record<string, string> = {
5861
mistral: "#FF7000",
5962
openrouter: "#6566F1",
6063
google: "#8E75B2",
61-
"google-vertex": "#8E75B2",
62-
kimi: "#1A6CFF",
64+
"google-vertex": "#8E75B2",
65+
alibaba: "#FF6A00",
66+
"alibaba-token-plan": "#FF6A00",
67+
"alibaba-token-plan-intl": "#FF6A00",
68+
kimi: "#1A6CFF",
6369
"kimi-code": "#1A6CFF",
6470
moonshot: "#1A6CFF",
6571
};
@@ -94,6 +100,9 @@ const PROVIDER_DISPLAY_NAMES: Record<string, string> = {
94100
"opencode-zen": "OpenCode Zen",
95101
mistral: "Mistral",
96102
groq: "Groq",
103+
alibaba: "Alibaba Coding Plan",
104+
"alibaba-token-plan": "Alibaba Token Plan",
105+
"alibaba-token-plan-intl": "Alibaba Token Plan (Intl)",
97106
kimi: "Kimi",
98107
"kimi-code": "Kimi",
99108
moonshot: "Moonshot",

src/providers/base-url-choices.ts

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,21 @@ export const QWEN_CLOUD_BASE_URL_CHOICES: readonly ProviderBaseUrlChoice[] = [
2121
{ id: "custom", label: "Custom" },
2222
];
2323

24+
/**
25+
* Alibaba Token Plan International (ap-southeast-1) endpoint presets.
26+
* Same product as the Beijing Token Plan but for international accounts.
27+
*/
28+
export const ALIBABA_INTL_TOKEN_PLAN_BASE_URL =
29+
"https://token-plan.ap-southeast-1.maas.aliyuncs.com/compatible-mode/v1";
30+
export const ALIBABA_INTL_PAYG_BASE_URL =
31+
"https://dashscope-intl.aliyuncs.com/compatible-mode/v1";
32+
33+
export const ALIBABA_INTL_BASE_URL_CHOICES: readonly ProviderBaseUrlChoice[] = [
34+
{ id: "token-plan", label: "Token plan", baseUrl: ALIBABA_INTL_TOKEN_PLAN_BASE_URL },
35+
{ id: "payg", label: "Pay as you go", baseUrl: ALIBABA_INTL_PAYG_BASE_URL },
36+
{ id: "custom", label: "Custom" },
37+
];
38+
2439
/** Match a saved baseUrl to a known choice id (`custom` when it does not match). */
2540
export function matchBaseUrlChoice(
2641
choices: readonly ProviderBaseUrlChoice[],

src/providers/registry.ts

Lines changed: 60 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,10 @@ import type { CodexAccountMode, OcxProviderConfig } from "../types";
22
import { KIRO_MODELS, KIRO_MODEL_CONTEXT_WINDOWS, KIRO_MODEL_REASONING_EFFORTS } from "./kiro-models";
33
import { ANTIGRAVITY_MODELS, ANTIGRAVITY_MODEL_CONTEXT_WINDOWS } from "./antigravity-models";
44
import type { ProviderBaseUrlChoice } from "./base-url-choices";
5-
import { QWEN_CLOUD_BASE_URL_CHOICES, QWEN_CLOUD_TOKEN_PLAN_BASE_URL } from "./base-url-choices";
5+
import {
6+
QWEN_CLOUD_BASE_URL_CHOICES, QWEN_CLOUD_TOKEN_PLAN_BASE_URL,
7+
ALIBABA_INTL_BASE_URL_CHOICES, ALIBABA_INTL_TOKEN_PLAN_BASE_URL,
8+
} from "./base-url-choices";
69
import {
710
CURSOR_STATIC_MODELS,
811
cursorModelContextWindows,
@@ -199,6 +202,33 @@ const ALIBABA_TOKEN_PLAN_INPUT_MODALITIES: Record<string, string[]> = {
199202
"glm-5.2": ["text"],
200203
"deepseek-v4-pro": ["text"],
201204
};
205+
206+
// 260721 Alibaba Token Plan International (ap-southeast-1 / Singapore).
207+
// Multi-vendor lineup distinct from Beijing — includes DeepSeek V4 flash, Kimi K2.7, MiniMax.
208+
// Evidence: https://www.alibabacloud.com/help/en/model-studio/token-plan-overview
209+
const ALIBABA_INTL_TOKEN_PLAN_MODELS = [
210+
"qwen3.7-max", "qwen3.7-plus", "qwen3.6-plus", "qwen3.6-flash",
211+
"deepseek-v4-pro", "deepseek-v4-flash", "deepseek-v3.2",
212+
"kimi-k2.7-code",
213+
"glm-5.2",
214+
"MiniMax-M2.5",
215+
];
216+
const ALIBABA_INTL_TOKEN_PLAN_QWEN_MODELS = [
217+
"qwen3.7-max", "qwen3.7-plus", "qwen3.6-plus", "qwen3.6-flash",
218+
];
219+
const ALIBABA_INTL_TOKEN_PLAN_INPUT_MODALITIES: Record<string, string[]> = {
220+
"qwen3.7-max": ["text"],
221+
"qwen3.7-plus": ["text", "image"],
222+
"qwen3.6-plus": ["text", "image"],
223+
"qwen3.6-flash": ["text", "image"],
224+
"deepseek-v4-pro": ["text"],
225+
"deepseek-v4-flash": ["text"],
226+
"deepseek-v3.2": ["text"],
227+
"kimi-k2.7-code": ["text"],
228+
"glm-5.2": ["text"],
229+
"MiniMax-M2.5": ["text"],
230+
};
231+
202232
// 260717 Kimi K3: the subscription endpoint uses one upstream id (`k3`) for both
203233
// entitlement tiers. Bare `k3` advertises the Moderato 256K ceiling; the local `[1m]`
204234
// alias advertises Allegretto's 1M ceiling and is stripped before the upstream request.
@@ -741,6 +771,35 @@ export const PROVIDER_REGISTRY: readonly ProviderRegistryEntry[] = [
741771
thinkingBudgetModels: ALIBABA_TOKEN_PLAN_QWEN_MODELS,
742772
preserveReasoningContentModels: ["glm-5.2", "deepseek-v4-pro", "qwen3.8-max-preview"],
743773
},
774+
{
775+
id: "alibaba-token-plan-intl",
776+
label: "Alibaba Token Plan (International)",
777+
baseUrl: ALIBABA_INTL_TOKEN_PLAN_BASE_URL,
778+
adapter: "openai-chat",
779+
authKind: "key",
780+
allowBaseUrlOverride: true,
781+
baseUrlChoices: ALIBABA_INTL_BASE_URL_CHOICES,
782+
dashboardUrl: "https://modelstudio.console.alibabacloud.com/?tab=api#/api",
783+
defaultModel: "qwen3.7-max",
784+
models: ALIBABA_INTL_TOKEN_PLAN_MODELS,
785+
liveModels: false,
786+
note: "Token Plan Team Edition · Singapore (ap-southeast-1)",
787+
modelInputModalities: ALIBABA_INTL_TOKEN_PLAN_INPUT_MODALITIES,
788+
modelContextWindows: { "deepseek-v4-pro": 1_000_000, "deepseek-v4-flash": 1_000_000, "glm-5.2": 1_000_000 },
789+
modelReasoningEfforts: {
790+
...Object.fromEntries(ALIBABA_INTL_TOKEN_PLAN_QWEN_MODELS.map(id => [id, THINKING_BUDGET_EFFORTS])),
791+
"glm-5.2": ZAI_GLM_52_REASONING_EFFORTS,
792+
"deepseek-v4-pro": DEEPSEEK_THINKING_EFFORTS,
793+
"deepseek-v4-flash": DEEPSEEK_THINKING_EFFORTS,
794+
},
795+
modelReasoningEffortMap: {
796+
"deepseek-v4-pro": DEEPSEEK_THINKING_REASONING_MAP,
797+
"deepseek-v4-flash": DEEPSEEK_THINKING_REASONING_MAP,
798+
},
799+
thinkingBudgetModels: ALIBABA_INTL_TOKEN_PLAN_QWEN_MODELS,
800+
preserveReasoningContentModels: ["glm-5.2", "deepseek-v4-pro", "deepseek-v4-flash", "qwen3.7-max"],
801+
noVisionModels: ["deepseek-v4-pro", "deepseek-v4-flash", "deepseek-v3.2", "kimi-k2.7-code", "glm-5.2", "MiniMax-M2.5", "qwen3.7-max"],
802+
},
744803
// NEEDS_HUMAN 2026-07-10: kept for config compatibility, but this is a dashboard URL,
745804
// no /models endpoint is documented, and tools are silently ignored upstream per docs.parallel.ai.
746805
// Evidence: devlog/_plan/260710_provider_hardening/003_research_aggregators.md.

tests/provider-registry-parity.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ const EXPECTED_KEY_PROVIDER_IDS = [
3232
"anthropic-apikey", "openai-apikey", "umans", "opencode-go", "neuralwatt", "openrouter", "orcarouter", "groq", "google", "google-vertex", "azure-openai",
3333
"deepseek", "cerebras", "together", "fireworks", "firepass", "moonshot",
3434
"huggingface", "nvidia", "venice", "zai", "nanogpt", "synthetic", "qwen-cloud",
35-
"qianfan", "alibaba", "alibaba-token-plan", "parallel", "zenmux", "litellm", "ollama-cloud", "mistral",
35+
"qianfan", "alibaba", "alibaba-token-plan", "alibaba-token-plan-intl", "parallel", "zenmux", "litellm", "ollama-cloud", "mistral",
3636
"minimax", "minimax-cn", "kimi-code", "opencode-zen", "vercel-ai-gateway",
3737
"opencode-free", "xiaomi", "kilo", "mimo-free", "cloudflare-ai-gateway", "cloudflare-workers-ai", "gitlab-duo",
3838
];
@@ -418,7 +418,7 @@ describe("provider registry parity", () => {
418418
test("base URL override permission is registry-only and limited to opted-in providers", () => {
419419
const optedIn = PROVIDER_REGISTRY.filter(entry => entry.allowBaseUrlOverride);
420420

421-
expect(optedIn.map(entry => entry.id)).toEqual(["ollama", "vllm", "lm-studio", "qwen-cloud", "litellm"]);
421+
expect(optedIn.map(entry => entry.id)).toEqual(["ollama", "vllm", "lm-studio", "qwen-cloud", "alibaba-token-plan-intl", "litellm"]);
422422
for (const entry of optedIn) {
423423
expect(providerConfigSeed(entry)).not.toHaveProperty("allowBaseUrlOverride");
424424
}

0 commit comments

Comments
 (0)