feat: add qiniucloud provider (#202)

huaiyuWangh created

Change summary

internal/providers/configs/qiniucloud.json | 179 ++++++++++++++++++++++++
internal/providers/providers.go            |   8 +
pkg/catwalk/provider.go                    |   2 
3 files changed, 189 insertions(+)

Detailed changes

internal/providers/configs/qiniucloud.json 🔗

@@ -0,0 +1,179 @@
+{
+  "name": "QiniuCloud",
+  "id": "qiniucloud",
+  "type": "openai-compat",
+  "api_key": "$QINIUCLOUD_API_KEY",
+  "api_endpoint": "https://api.qnaigc.com/v1",
+  "default_large_model_id": "minimax/minimax-m2.5",
+  "default_small_model_id": "glm-4.5",
+  "models": [
+    {
+      "id": "minimax/minimax-m2.5",
+      "name": "Minimax/Minimax-M2.5",
+      "cost_per_1m_in": 0.29,
+      "cost_per_1m_out": 1.17,
+      "cost_per_1m_in_cached": 0.29,
+      "cost_per_1m_out_cached": 1.17,
+      "context_window": 204800,
+      "default_max_tokens": 128000,
+      "can_reason": false,
+      "supports_attachments": false
+    },
+    {
+      "id": "z-ai/glm-5",
+      "name": "Z-Ai/GLM 5",
+      "cost_per_1m_in": 0.56,
+      "cost_per_1m_out": 2.5,
+      "cost_per_1m_in_cached": 0.56,
+      "cost_per_1m_out_cached": 2.5,
+      "context_window": 200000,
+      "default_max_tokens": 128000,
+      "can_reason": false,
+      "supports_attachments": false
+    },
+    {
+      "id": "minimax/minimax-m2.1",
+      "name": "Minimax/Minimax-M2.1",
+      "cost_per_1m_in": 0.29,
+      "cost_per_1m_out": 1.17,
+      "cost_per_1m_in_cached": 0.29,
+      "cost_per_1m_out_cached": 1.17,
+      "context_window": 204800,
+      "default_max_tokens": 4096,
+      "can_reason": true,
+      "supports_attachments": false
+    },
+    {
+      "id": "moonshotai/kimi-k2-thinking",
+      "name": "Kimi K2 Thinking",
+      "cost_per_1m_in": 0.56,
+      "cost_per_1m_out": 2.22,
+      "cost_per_1m_in_cached": 0.56,
+      "cost_per_1m_out_cached": 2.22,
+      "context_window": 256000,
+      "default_max_tokens": 100000,
+      "can_reason": true,
+      "supports_attachments": false
+    },
+    {
+      "id": "z-ai/glm-4.7",
+      "name": "Z-Ai/GLM 4.7",
+      "cost_per_1m_in": 0.44,
+      "cost_per_1m_out": 1.74,
+      "cost_per_1m_in_cached": 0.44,
+      "cost_per_1m_out_cached": 1.74,
+      "context_window": 200000,
+      "default_max_tokens": 4096,
+      "can_reason": true,
+      "supports_attachments": false
+    },
+    {
+      "id": "minimax/minimax-m2",
+      "name": "Minimax/Minimax-M2",
+      "cost_per_1m_in": 0.29,
+      "cost_per_1m_out": 1.17,
+      "cost_per_1m_in_cached": 0.29,
+      "cost_per_1m_out_cached": 1.17,
+      "context_window": 200000,
+      "default_max_tokens": 4096,
+      "can_reason": true,
+      "supports_attachments": false
+    },
+    {
+      "id": "z-ai/glm-4.6",
+      "name": "Z-AI/GLM 4.6",
+      "cost_per_1m_in": 1,
+      "cost_per_1m_out": 1.75,
+      "cost_per_1m_in_cached": 1,
+      "cost_per_1m_out_cached": 1.75,
+      "context_window": 200000,
+      "default_max_tokens": 4096,
+      "can_reason": true,
+      "supports_attachments": false
+    },
+    {
+      "id": "deepseek/deepseek-v3.1-terminus",
+      "name": "DeepSeek/DeepSeek-V3.1-Terminus",
+      "cost_per_1m_in": 0.56,
+      "cost_per_1m_out": 1.67,
+      "cost_per_1m_in_cached": 0.56,
+      "cost_per_1m_out_cached": 1.67,
+      "context_window": 128000,
+      "default_max_tokens": 32000,
+      "can_reason": false,
+      "supports_attachments": false
+    },
+    {
+      "id": "deepseek-v3.1",
+      "name": "DeepSeek-V3.1",
+      "cost_per_1m_in": 0.56,
+      "cost_per_1m_out": 1.67,
+      "cost_per_1m_in_cached": 0.56,
+      "cost_per_1m_out_cached": 1.67,
+      "context_window": 128000,
+      "default_max_tokens": 32000,
+      "can_reason": false,
+      "supports_attachments": false
+    },
+    {
+      "id": "doubao-seed-2.0-pro",
+      "name": "Doubao Seed 2.0 Pro",
+      "cost_per_1m_in": 0.44,
+      "cost_per_1m_out": 2.22,
+      "cost_per_1m_in_cached": 0.44,
+      "cost_per_1m_out_cached": 2.22,
+      "context_window": 256000,
+      "default_max_tokens": 128000,
+      "can_reason": false,
+      "supports_attachments": true
+    },
+    {
+      "id": "doubao-seed-2.0-code",
+      "name": "Doubao Seed 2.0 Code",
+      "cost_per_1m_in": 0.44,
+      "cost_per_1m_out": 2.22,
+      "cost_per_1m_in_cached": 0.44,
+      "cost_per_1m_out_cached": 2.22,
+      "context_window": 256000,
+      "default_max_tokens": 128000,
+      "can_reason": false,
+      "supports_attachments": true
+    },
+    {
+      "id": "qwen3-coder-480b-a35b-instruct",
+      "name": "Qwen3 Coder 480B A35B Instruct",
+      "cost_per_1m_in": 0.83,
+      "cost_per_1m_out": 3.33,
+      "cost_per_1m_in_cached": 0.83,
+      "cost_per_1m_out_cached": 3.33,
+      "context_window": 262000,
+      "default_max_tokens": 4096,
+      "can_reason": false,
+      "supports_attachments": false
+    },
+    {
+      "id": "glm-4.5",
+      "name": "GLM 4.5",
+      "cost_per_1m_in": 0.56,
+      "cost_per_1m_out": 2.22,
+      "cost_per_1m_in_cached": 0.56,
+      "cost_per_1m_out_cached": 2.22,
+      "context_window": 131072,
+      "default_max_tokens": 98304,
+      "can_reason": false,
+      "supports_attachments": false
+    },
+    {
+      "id": "moonshotai/kimi-k2-0905",
+      "name": "Kimi K2 0905",
+      "cost_per_1m_in": 0.56,
+      "cost_per_1m_out": 2.22,
+      "cost_per_1m_in_cached": 0.56,
+      "cost_per_1m_out_cached": 2.22,
+      "context_window": 256000,
+      "default_max_tokens": 100000,
+      "can_reason": true,
+      "supports_attachments": false
+    }
+  ]
+}

internal/providers/providers.go 🔗

@@ -84,6 +84,9 @@ var miniMaxChinaConfig []byte
 //go:embed configs/ionet.json
 var ioNetConfig []byte
 
+//go:embed configs/qiniucloud.json
+var qiniuCloudConfig []byte
+
 // ProviderFunc is a function that returns a Provider.
 type ProviderFunc func() catwalk.Provider
 
@@ -113,6 +116,7 @@ var providerRegistry = []ProviderFunc{
 	miniMaxProvider,
 	miniMaxChinaProvider,
 	ioNetProvider,
+	qiniuCloudProvider,
 }
 
 // GetAll returns all registered providers.
@@ -232,3 +236,7 @@ func miniMaxChinaProvider() catwalk.Provider {
 func ioNetProvider() catwalk.Provider {
 	return loadProviderFromConfig(ioNetConfig)
 }
+
+func qiniuCloudProvider() catwalk.Provider {
+	return loadProviderFromConfig(qiniuCloudConfig)
+}

pkg/catwalk/provider.go 🔗

@@ -45,6 +45,7 @@ const (
 	InferenceProviderMiniMax      InferenceProvider = "minimax"
 	InferenceProviderMiniMaxChina InferenceProvider = "minimax-china"
 	InferenceProviderIoNet        InferenceProvider = "ionet"
+	InferenceProviderQiniuCloud   InferenceProvider = "qiniucloud"
 )
 
 // Provider represents an AI provider configuration.
@@ -113,6 +114,7 @@ func KnownProviders() []InferenceProvider {
 		InferenceProviderVercel,
 		InferenceProviderMiniMax,
 		InferenceProviderMiniMaxChina,
+		InferenceProviderQiniuCloud,
 	}
 }