feat: add ModelScope API support (#3773)

Co-authored-by: Steven Enamakel <enamakel@tinyhumans.ai>
This commit is contained in:
Rongkun Yan
2026-06-22 14:29:05 -07:00
committed by GitHub
co-authored by Steven Enamakel
parent 7f5a746c19
commit 9e5d0329bf
5 changed files with 25 additions and 1 deletions
+1
View File
@@ -5401,6 +5401,7 @@ dependencies = [
"image",
"keyring",
"lettre",
"libc",
"log",
"mail-parser",
"motosan-ai-oauth",
@@ -17,6 +17,7 @@ describe('builtinCloudProviders', () => {
['deepseek', 'https://api.deepseek.com/v1', 'bearer'],
['minimax', 'https://api.minimax.io/v1', 'bearer'],
['sumopod', 'https://ai.sumopod.com/v1', 'bearer'],
['modelscope', 'https://api-inference.modelscope.cn/v1', 'bearer'],
] as const)('maps %s to its endpoint and auth style', (slug, endpoint, authStyle) => {
expect(defaultEndpointForBuiltinCloudProvider(slug)).toBe(endpoint);
expect(authStyleForBuiltinCloudProvider(slug)).toBe(authStyle);
@@ -43,6 +44,7 @@ describe('builtinCloudProviders', () => {
'venice',
'vercel-ai-gateway',
'sumopod',
'modelscope',
])
);
});
@@ -216,6 +216,14 @@ export const BUILTIN_CLOUD_PROVIDERS: BuiltinCloudProvider[] = [
tone: TONE.amber,
keyPlaceholder: 'sk-...',
},
{
slug: 'modelscope',
label: 'ModelScope',
endpoint: 'https://api-inference.modelscope.cn/v1',
authStyle: 'bearer',
tone: TONE.indigo,
keyPlaceholder: 'ms-...',
},
];
// NOTE: Claude Code CLI is intentionally NOT a builtin chip. It is a
+2 -1
View File
@@ -25,7 +25,7 @@ through a custom provider entry; this table is the first-class chip catalog.
| `huggingface` | Hugging Face | `https://router.huggingface.co/v1` | bearer | Shipped |
| `nvidia` | NVIDIA | `https://integrate.api.nvidia.com/v1` | bearer | Shipped |
| `zai` | Z.AI | `https://api.z.ai/api/paas/v4` | bearer | Shipped |
| `minimax` | MiniMax | `https://api.minimax.io/anthropic` | anthropic | Shipped |
| `minimax` | MiniMax | `https://api.minimax.io/v1` | bearer | Shipped |
| `stepfun` | StepFun | `https://api.stepfun.ai/step_plan/v1` | bearer | Shipped |
| `kilocode` | Kilo Code | `https://api.kilo.ai/api/gateway` | bearer | Shipped |
| `deepinfra` | DeepInfra | `https://api.deepinfra.com/v1/openai` | bearer | Shipped |
@@ -33,6 +33,7 @@ through a custom provider entry; this table is the first-class chip catalog.
| `venice` | Venice | `https://api.venice.ai/api/v1` | bearer | Shipped |
| `vercel-ai-gateway` | Vercel AI Gateway | `https://ai-gateway.vercel.sh/v1` | bearer | Shipped |
| `sumopod` | SumoPod | `https://ai.sumopod.com/v1` | bearer | Shipped |
| `modelscope` | ModelScope | `https://api-inference.modelscope.cn/v1` | bearer | Shipped |
API keys are stored through the auth-profile store under `provider:<slug>`;
they are not read from environment variables by the desktop Settings flow.
@@ -185,6 +185,12 @@ pub const BUILTIN_CLOUD_PROVIDERS: &[BuiltinCloudProvider] = &[
endpoint: "https://ai.sumopod.com/v1",
auth_style: AuthStyle::Bearer,
},
BuiltinCloudProvider {
slug: "modelscope",
label: "ModelScope",
endpoint: "https://api-inference.modelscope.cn/v1",
auth_style: AuthStyle::Bearer,
},
];
fn builtin_cloud_provider(type_str: &str) -> Option<&'static BuiltinCloudProvider> {
@@ -524,6 +530,12 @@ mod tests {
"https://ai.sumopod.com/v1",
AuthStyle::Bearer,
),
(
"modelscope",
"ModelScope",
"https://api-inference.modelscope.cn/v1",
AuthStyle::Bearer,
),
] {
let mut entry = CloudProviderCreds {
id: format!("p_{slug}"),