Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
import { cachedEnhancedDirectByokModelList } from '@/lib/ai-gateway/providers/direct-byok/model-list';
import type { DirectByokProvider } from '@/lib/ai-gateway/providers/direct-byok/types';

export default {
id: 'alibaba-token-plan',
base_url: 'https://token-plan.ap-southeast-1.maas.aliyuncs.com/compatible-mode/v1',
supported_chat_apis: ['chat_completions'],
default_ai_sdk_provider: 'openai-compatible',
transformRequest() {},
models: cachedEnhancedDirectByokModelList({
providerId: 'alibaba-token-plan',
recommendedModels: [
{
id: 'qwen3.7-plus',
name: 'Qwen3.7 Plus',
flags: ['vision'],
context_length: 1_000_000,
max_completion_tokens: 64_000,
},
],
}),
} satisfies DirectByokProvider;
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import type { DirectByokProvider } from './types';
import alibabaTokenPlan from './alibaba-token-plan';
import byteplusCoding from './byteplus-coding';
import chutesByok from './chutes-byok';
import crofai from './crofai';
Expand All @@ -15,6 +16,7 @@ import xiaomiTokenPlanSgp from './xiaomi-token-plan-sgp';
import zaiCoding from './zai-coding';

export default [
alibabaTokenPlan,
byteplusCoding,
chutesByok,
crofai,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import type { DirectUserByokInferenceProviderId } from '@/lib/ai-gateway/provide

// Client-safe display names for direct BYOK providers.
export const DIRECT_BYOK_PROVIDERS_META = {
'alibaba-token-plan': 'Alibaba Token Plan (Singapore)',
'byteplus-coding': 'BytePlus Coding Plan',
'chutes-byok': 'Chutes BYOK',
crofai: 'CrofAI',
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { parseModelsDevProviderModels } from './sync-direct-byok';

describe('parseModelsDevProviderModels', () => {
test('excludes deprecated models while retaining other statuses', () => {
test('excludes deprecated and non-text-output models while retaining other statuses', () => {
const models = parseModelsDevProviderModels({
models: {
stable: {
Expand All @@ -27,6 +27,11 @@ describe('parseModelsDevProviderModels', () => {
name: 'MiMo V2 Omni',
status: 'deprecated',
},
imageOnly: {
id: 'wan2.7-image',
name: 'Wan2.7 Image',
modalities: { input: ['text'], output: ['image'] },
},
},
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,11 @@ function openAICompatibleFetcher(options: {
export function parseModelsDevProviderModels(entry: unknown): RawModel[] {
const provider = ModelsDevProviderSchema.parse(entry);
return Object.values(provider.models)
.filter(model => model.status !== 'deprecated')
.filter(
model =>
model.status !== 'deprecated' &&
(!model.modalities?.output || model.modalities.output.includes('text'))
)
.map(model => ({
id: model.id,
name: shortenDisplayName(model.name),
Expand Down Expand Up @@ -177,6 +181,7 @@ const FETCHERS: ReadonlyArray<ProviderFetcher> = [
label: 'Synthetic',
url: 'https://api.synthetic.new/v1/models',
}),
modelsDevFetcher('alibaba-token-plan', 'alibaba-token-plan'),
modelsDevFetcher('zai-coding', 'zai-coding-plan'),
modelsDevFetcher('ollama-cloud', 'ollama-cloud'),
modelsDevFetcher('opencode-go', 'opencode-go'),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,7 @@ export type VercelUserByokInferenceProviderId = z.infer<
>;

export const DirectUserByokInferenceProviderIdSchema = z.enum([
'alibaba-token-plan',
'byteplus-coding',
'chutes-byok',
'codestral',
Expand Down Expand Up @@ -138,6 +139,7 @@ export const UserByokTestModels = {
[VercelUserByokInferenceProviderIdSchema.enum.xai]: 'xai/grok-4.1-fast-non-reasoning',
[VercelUserByokInferenceProviderIdSchema.enum.xiaomi]: 'xiaomi/mimo-v2-flash',
[VercelUserByokInferenceProviderIdSchema.enum.zai]: 'zai/glm-4.7-flash',
[DirectUserByokInferenceProviderIdSchema.enum['alibaba-token-plan']]: 'deepseek-v3.2',
[DirectUserByokInferenceProviderIdSchema.enum['byteplus-coding']]: 'bytedance-seed-code',
[DirectUserByokInferenceProviderIdSchema.enum['chutes-byok']]: 'Qwen/Qwen3-30B-A3B',
[DirectUserByokInferenceProviderIdSchema.enum.codestral]: 'mistral/codestral',
Expand Down