From 73c58a21a0f2716c63a23d279da06986a75cd258 Mon Sep 17 00:00:00 2001 From: Andrey Nering Date: Mon, 18 May 2026 15:10:58 -0300 Subject: [PATCH] feat: add alibaba (singapore) provider * Closes #200 * Closes #203 * Closes #239 --- .../providers/configs/alibaba-singapore.json | 117 ++++++++++++++++++ internal/providers/providers.go | 8 ++ pkg/catwalk/provider.go | 65 +++++----- 3 files changed, 158 insertions(+), 32 deletions(-) create mode 100644 internal/providers/configs/alibaba-singapore.json diff --git a/internal/providers/configs/alibaba-singapore.json b/internal/providers/configs/alibaba-singapore.json new file mode 100644 index 00000000..4f5105e8 --- /dev/null +++ b/internal/providers/configs/alibaba-singapore.json @@ -0,0 +1,117 @@ +{ + "name": "Alibaba (Singapore)", + "id": "alibaba-singapore", + "api_key": "$ALIBABA_SINGAPORE_API_KEY", + "api_endpoint": "https://dashscope-intl.aliyuncs.com/compatible-mode/v1", + "type": "openai-compat", + "default_large_model_id": "qwen3.6-plus", + "default_small_model_id": "qwen3.6-flash", + "models": [ + { + "id": "qwen3.6-35b-a3b", + "name": "Qwen3.6-35B-A3B", + "cost_per_1m_in": 0.6, + "cost_per_1m_out": 3.6, + "cost_per_1m_in_cached": 0, + "cost_per_1m_out_cached": 0, + "context_window": 256000, + "default_max_tokens": 64000, + "can_reason": true, + "supports_attachments": true + }, + { + "id": "qwen3.6-27b", + "name": "Qwen3.6-27B", + "cost_per_1m_in": 0.248, + "cost_per_1m_out": 1.486, + "cost_per_1m_in_cached": 0, + "cost_per_1m_out_cached": 0, + "context_window": 256000, + "default_max_tokens": 64000, + "can_reason": true, + "supports_attachments": true + }, + { + "id": "qwen3.6-flash", + "name": "Qwen3.6-Flash", + "cost_per_1m_in": 0.25, + "cost_per_1m_out": 1.5, + "cost_per_1m_in_cached": 0.025, + "cost_per_1m_out_cached": 0.3125, + "context_window": 1000000, + "default_max_tokens": 64000, + "can_reason": true, + "supports_attachments": true + }, + { + "id": "qwen3.6-plus", + "name": "Qwen3.6-Plus", + "cost_per_1m_in": 0.5, + "cost_per_1m_out": 0.3, + "cost_per_1m_in_cached": 0.05, + "cost_per_1m_out_cached": 0.625, + "context_window": 1000000, + "default_max_tokens": 64000, + "can_reason": true, + "supports_attachments": true + }, + { + "id": "qwen3.6-max-preview", + "name": "Qwen3.6-Max", + "cost_per_1m_in": 1.3, + "cost_per_1m_out": 7.8, + "cost_per_1m_in_cached": 0.13, + "cost_per_1m_out_cached": 1.165, + "context_window": 256000, + "default_max_tokens": 64000, + "can_reason": true, + "supports_attachments": false + }, + { + "id": "deepseek-v4-pro", + "name": "DeepSeek-V4-Pro", + "cost_per_1m_in": 2.4, + "cost_per_1m_out": 4.8, + "cost_per_1m_in_cached": 0.2, + "cost_per_1m_out_cached": 0, + "context_window": 1000000, + "default_max_tokens": 384000, + "can_reason": true, + "reasoning_levels": [ + "high", + "xhigh" + ], + "default_reasoning_effort": "high", + "supports_attachments": false + }, + { + "id": "deepseek-v4-flash", + "name": "DeepSeek-V4-Flash", + "cost_per_1m_in": 0.2, + "cost_per_1m_out": 0.4, + "cost_per_1m_in_cached": 0.04, + "cost_per_1m_out_cached": 0, + "context_window": 1000000, + "default_max_tokens": 384000, + "can_reason": true, + "reasoning_levels": [ + "high", + "xhigh" + ], + "default_reasoning_effort": "high", + "supports_attachments": false + }, + { + "id": "deepseek-v3.2", + "name": "DeepSeek-V3.2", + "cost_per_1m_in": 0.57, + "cost_per_1m_out": 1.71, + "cost_per_1m_in_cached": 0.114, + "cost_per_1m_out_cached": 0.713, + "context_window": 128000, + "default_max_tokens": 64000, + "can_reason": true, + "supports_attachments": false + } + ] +} diff --git a/internal/providers/providers.go b/internal/providers/providers.go index 4ba9d43f..10609b51 100644 --- a/internal/providers/providers.go +++ b/internal/providers/providers.go @@ -12,6 +12,9 @@ import ( //go:embed configs/aihubmix.json var aiHubMixConfig []byte +//go:embed configs/alibaba-singapore.json +var alibabaSingaporeConfig []byte + //go:embed configs/anthropic.json var anthropicConfig []byte @@ -122,6 +125,7 @@ var providerRegistry = []ProviderFunc{ // The remaining will be in alphabetical order. aiHubMixProvider, + alibabaSingaporeProvider, avianProvider, azureProvider, bedrockProvider, @@ -168,6 +172,10 @@ func aiHubMixProvider() catwalk.Provider { return loadProviderFromConfig(aiHubMixConfig) } +func alibabaSingaporeProvider() catwalk.Provider { + return loadProviderFromConfig(alibabaSingaporeConfig) +} + func anthropicProvider() catwalk.Provider { return loadProviderFromConfig(anthropicConfig) } diff --git a/pkg/catwalk/provider.go b/pkg/catwalk/provider.go index 1458a381..021e6f32 100644 --- a/pkg/catwalk/provider.go +++ b/pkg/catwalk/provider.go @@ -21,38 +21,39 @@ type InferenceProvider string // All the inference providers supported by the system. const ( - InferenceProviderOpenAI InferenceProvider = "openai" - InferenceProviderAnthropic InferenceProvider = "anthropic" - InferenceProviderSynthetic InferenceProvider = "synthetic" - InferenceProviderGemini InferenceProvider = "gemini" - InferenceProviderAzure InferenceProvider = "azure" - InferenceProviderBedrock InferenceProvider = "bedrock" - InferenceProviderVertexAI InferenceProvider = "vertexai" - InferenceProviderXAI InferenceProvider = "xai" - InferenceProviderZAI InferenceProvider = "zai" - InferenceProviderDeepSeek InferenceProvider = "deepseek" - InferenceProviderZhipu InferenceProvider = "zhipu" - InferenceProviderZhipuCoding InferenceProvider = "zhipu-coding" - InferenceProviderGROQ InferenceProvider = "groq" - InferenceProviderOpenRouter InferenceProvider = "openrouter" - InferenceProviderCerebras InferenceProvider = "cerebras" - InferenceProviderVenice InferenceProvider = "venice" - InferenceProviderChutes InferenceProvider = "chutes" - InferenceProviderHuggingFace InferenceProvider = "huggingface" - InferenceAIHubMix InferenceProvider = "aihubmix" - InferenceKimiCoding InferenceProvider = "kimi-coding" - InferenceProviderCopilot InferenceProvider = "copilot" - InferenceProviderCortecs InferenceProvider = "cortecs" - InferenceProviderVercel InferenceProvider = "vercel" - InferenceProviderMiniMax InferenceProvider = "minimax" - InferenceProviderMiniMaxChina InferenceProvider = "minimax-china" - InferenceProviderIoNet InferenceProvider = "ionet" - InferenceProviderQiniuCloud InferenceProvider = "qiniucloud" - InferenceProviderAvian InferenceProvider = "avian" - InferenceProviderNebius InferenceProvider = "nebius" - InferenceProviderNeuralwatt InferenceProvider = "neuralwatt" - InferenceProviderOpenCodeZen InferenceProvider = "opencode-zen" - InferenceProviderOpenCodeGo InferenceProvider = "opencode-go" + InferenceProviderOpenAI InferenceProvider = "openai" + InferenceProviderAnthropic InferenceProvider = "anthropic" + InferenceProviderSynthetic InferenceProvider = "synthetic" + InferenceProviderGemini InferenceProvider = "gemini" + InferenceProviderAzure InferenceProvider = "azure" + InferenceProviderBedrock InferenceProvider = "bedrock" + InferenceProviderVertexAI InferenceProvider = "vertexai" + InferenceProviderXAI InferenceProvider = "xai" + InferenceProviderZAI InferenceProvider = "zai" + InferenceProviderDeepSeek InferenceProvider = "deepseek" + InferenceProviderZhipu InferenceProvider = "zhipu" + InferenceProviderZhipuCoding InferenceProvider = "zhipu-coding" + InferenceProviderGROQ InferenceProvider = "groq" + InferenceProviderOpenRouter InferenceProvider = "openrouter" + InferenceProviderCerebras InferenceProvider = "cerebras" + InferenceProviderVenice InferenceProvider = "venice" + InferenceProviderChutes InferenceProvider = "chutes" + InferenceProviderHuggingFace InferenceProvider = "huggingface" + InferenceAIHubMix InferenceProvider = "aihubmix" + InferenceKimiCoding InferenceProvider = "kimi-coding" + InferenceProviderCopilot InferenceProvider = "copilot" + InferenceProviderCortecs InferenceProvider = "cortecs" + InferenceProviderVercel InferenceProvider = "vercel" + InferenceProviderMiniMax InferenceProvider = "minimax" + InferenceProviderMiniMaxChina InferenceProvider = "minimax-china" + InferenceProviderIoNet InferenceProvider = "ionet" + InferenceProviderQiniuCloud InferenceProvider = "qiniucloud" + InferenceProviderAvian InferenceProvider = "avian" + InferenceProviderNebius InferenceProvider = "nebius" + InferenceProviderNeuralwatt InferenceProvider = "neuralwatt" + InferenceProviderOpenCodeZen InferenceProvider = "opencode-zen" + InferenceProviderOpenCodeGo InferenceProvider = "opencode-go" + InferenceProviderAlibabaSingapore InferenceProvider = "alibaba-singapore" ) // Provider represents an AI provider configuration.