mirror of
https://github.com/tiennm99/ccs.git
synced 2026-10-13 08:15:17 +00:00
Merge pull request #1573 from tiennm99/fix/update-provider-model-templates
fix(config): update provider default models
This commit is contained in:
8 files changed
+82
-26
No files matched your search
@@ -2,9 +2,9 @@
|
||||
"env": {
|
||||
"ANTHROPIC_BASE_URL": "https://api.z.ai/api/anthropic",
|
||||
"ANTHROPIC_AUTH_TOKEN": "YOUR_GLM_API_KEY_HERE",
|
||||
"ANTHROPIC_MODEL": "glm-5",
|
||||
"ANTHROPIC_DEFAULT_OPUS_MODEL": "glm-5",
|
||||
"ANTHROPIC_DEFAULT_SONNET_MODEL": "glm-5",
|
||||
"ANTHROPIC_DEFAULT_HAIKU_MODEL": "glm-5"
|
||||
"ANTHROPIC_MODEL": "glm-5.2",
|
||||
"ANTHROPIC_DEFAULT_OPUS_MODEL": "glm-5.2",
|
||||
"ANTHROPIC_DEFAULT_SONNET_MODEL": "glm-5.2",
|
||||
"ANTHROPIC_DEFAULT_HAIKU_MODEL": "glm-5.2"
|
||||
}
|
||||
}
|
||||
@@ -2,10 +2,10 @@
|
||||
"env": {
|
||||
"ANTHROPIC_BASE_URL": "https://api.z.ai/api/coding/paas/v4/chat/completions",
|
||||
"ANTHROPIC_AUTH_TOKEN": "YOUR_GLM_API_KEY_HERE",
|
||||
"ANTHROPIC_MODEL": "glm-5",
|
||||
"ANTHROPIC_DEFAULT_OPUS_MODEL": "glm-5",
|
||||
"ANTHROPIC_DEFAULT_SONNET_MODEL": "glm-5",
|
||||
"ANTHROPIC_DEFAULT_HAIKU_MODEL": "glm-5",
|
||||
"ANTHROPIC_MODEL": "glm-5.2",
|
||||
"ANTHROPIC_DEFAULT_OPUS_MODEL": "glm-5.2",
|
||||
"ANTHROPIC_DEFAULT_SONNET_MODEL": "glm-5.2",
|
||||
"ANTHROPIC_DEFAULT_HAIKU_MODEL": "glm-5.2",
|
||||
"ANTHROPIC_TEMPERATURE": "0.2",
|
||||
"ANTHROPIC_MAX_TOKENS": "65536",
|
||||
"MAX_THINKING_TOKENS": "32768",
|
||||
|
||||
@@ -2,9 +2,9 @@
|
||||
"env": {
|
||||
"ANTHROPIC_BASE_URL": "https://api.kimi.com/coding/",
|
||||
"ANTHROPIC_AUTH_TOKEN": "YOUR_KIMI_API_KEY_HERE",
|
||||
"ANTHROPIC_MODEL": "kimi-k2-thinking-turbo",
|
||||
"ANTHROPIC_DEFAULT_OPUS_MODEL": "kimi-k2-thinking-turbo",
|
||||
"ANTHROPIC_DEFAULT_SONNET_MODEL": "kimi-k2-thinking-turbo",
|
||||
"ANTHROPIC_DEFAULT_HAIKU_MODEL": "kimi-k2-thinking-turbo"
|
||||
"ANTHROPIC_MODEL": "kimi-for-coding",
|
||||
"ANTHROPIC_DEFAULT_OPUS_MODEL": "kimi-for-coding",
|
||||
"ANTHROPIC_DEFAULT_SONNET_MODEL": "kimi-for-coding",
|
||||
"ANTHROPIC_DEFAULT_HAIKU_MODEL": "kimi-for-coding"
|
||||
}
|
||||
}
|
||||
@@ -2,9 +2,9 @@
|
||||
"env": {
|
||||
"ANTHROPIC_BASE_URL": "https://api.minimax.io/anthropic",
|
||||
"ANTHROPIC_AUTH_TOKEN": "YOUR_MINIMAX_API_KEY_HERE",
|
||||
"ANTHROPIC_MODEL": "MiniMax-M2.1",
|
||||
"ANTHROPIC_DEFAULT_OPUS_MODEL": "MiniMax-M2.1",
|
||||
"ANTHROPIC_DEFAULT_SONNET_MODEL": "MiniMax-M2.1",
|
||||
"ANTHROPIC_DEFAULT_HAIKU_MODEL": "MiniMax-M2.1-lightning"
|
||||
"ANTHROPIC_MODEL": "MiniMax-M3",
|
||||
"ANTHROPIC_DEFAULT_OPUS_MODEL": "MiniMax-M3",
|
||||
"ANTHROPIC_DEFAULT_SONNET_MODEL": "MiniMax-M3",
|
||||
"ANTHROPIC_DEFAULT_HAIKU_MODEL": "MiniMax-M3"
|
||||
}
|
||||
}
|
||||
@@ -160,7 +160,7 @@ const RAW_PROVIDER_PRESET_DEFINITIONS: readonly ProviderPresetDefinition[] = [
|
||||
description: 'Direct Z.AI Anthropic-compatible API profile',
|
||||
baseUrl: 'https://api.z.ai/api/anthropic',
|
||||
defaultProfileName: 'glm',
|
||||
defaultModel: 'glm-5',
|
||||
defaultModel: 'glm-5.2',
|
||||
apiKeyPlaceholder: 'ghp_...',
|
||||
apiKeyHint: 'Get your API key from Z.AI',
|
||||
category: 'alternative',
|
||||
@@ -171,16 +171,16 @@ const RAW_PROVIDER_PRESET_DEFINITIONS: readonly ProviderPresetDefinition[] = [
|
||||
{
|
||||
id: 'km',
|
||||
name: 'Kimi',
|
||||
description: 'Moonshot AI - Fast reasoning model',
|
||||
description: 'Kimi Code membership API with stable latest-coding model alias',
|
||||
baseUrl: 'https://api.kimi.com/coding/',
|
||||
defaultProfileName: 'km',
|
||||
defaultModel: 'kimi-k2-thinking-turbo',
|
||||
defaultModel: 'kimi-for-coding',
|
||||
apiKeyPlaceholder: 'sk-...',
|
||||
apiKeyHint: 'Get your API key from Moonshot AI',
|
||||
apiKeyHint: 'Get your API key from the Kimi Code Console',
|
||||
category: 'alternative',
|
||||
requiresApiKey: true,
|
||||
alwaysThinkingEnabled: true,
|
||||
badge: 'Reasoning',
|
||||
badge: 'Kimi Code',
|
||||
icon: '/icons/kimi.svg',
|
||||
},
|
||||
{
|
||||
@@ -200,10 +200,10 @@ const RAW_PROVIDER_PRESET_DEFINITIONS: readonly ProviderPresetDefinition[] = [
|
||||
{
|
||||
id: 'mm',
|
||||
name: 'Minimax',
|
||||
description: 'M2.1/M2.1-lightning/M2 - multilang coding (1M context)',
|
||||
description: 'M3 frontier multimodal coding model with 1M context',
|
||||
baseUrl: 'https://api.minimax.io/anthropic',
|
||||
defaultProfileName: 'mm',
|
||||
defaultModel: 'MiniMax-M2.1',
|
||||
defaultModel: 'MiniMax-M3',
|
||||
apiKeyPlaceholder: 'YOUR_MINIMAX_API_KEY_HERE',
|
||||
apiKeyHint: 'Get your API key at platform.minimax.io',
|
||||
category: 'alternative',
|
||||
|
||||
@@ -531,8 +531,14 @@ const PRICING_REGISTRY: Record<string, ModelPricing> = {
|
||||
},
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
// GLM Models (Zhipu AI / Z.AI) - Source: OpenRouter verified pricing
|
||||
// GLM Models (Zhipu AI / Z.AI) - Source: Official Z.AI pricing
|
||||
// ---------------------------------------------------------------------------
|
||||
'glm-5.2': {
|
||||
inputPerMillion: 1.4,
|
||||
outputPerMillion: 4.4,
|
||||
cacheCreationPerMillion: 0.0,
|
||||
cacheReadPerMillion: 0.26,
|
||||
},
|
||||
'glm-5': {
|
||||
inputPerMillion: 1.0,
|
||||
outputPerMillion: 3.2,
|
||||
@@ -678,8 +684,22 @@ const PRICING_REGISTRY: Record<string, ModelPricing> = {
|
||||
},
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
// MiniMax Models - Source: https://platform.minimax.io/docs/pricing/pay-as-you-go
|
||||
// MiniMax Models - Source: https://platform.minimax.io/docs/guides/pricing-paygo
|
||||
// ---------------------------------------------------------------------------
|
||||
'MiniMax-M3': {
|
||||
inputPerMillion: 0.3,
|
||||
outputPerMillion: 1.2,
|
||||
cacheCreationPerMillion: 0.0,
|
||||
cacheReadPerMillion: 0.06,
|
||||
serviceTiers: {
|
||||
priority: {
|
||||
inputPerMillion: 0.45,
|
||||
outputPerMillion: 1.8,
|
||||
cacheCreationPerMillion: 0.0,
|
||||
cacheReadPerMillion: 0.09,
|
||||
},
|
||||
},
|
||||
},
|
||||
'MiniMax-M2.5': {
|
||||
inputPerMillion: 0.3,
|
||||
outputPerMillion: 1.2,
|
||||
|
||||
@@ -29,6 +29,14 @@ describe('provider-presets', () => {
|
||||
expect(preset?.id).toBe('km');
|
||||
});
|
||||
|
||||
it('tracks current provider default model updates', () => {
|
||||
expect(getPresetById('glm')?.defaultModel).toBe('glm-5.2');
|
||||
expect(getPresetById('glmt')?.defaultModel).toBe('glm-5.2');
|
||||
expect(getPresetById('km')?.defaultModel).toBe('kimi-for-coding');
|
||||
expect(getPresetById('kimi')?.defaultModel).toBe('kimi-for-coding');
|
||||
expect(getPresetById('mm')?.defaultModel).toBe('MiniMax-M3');
|
||||
});
|
||||
|
||||
it('resolves llama.cpp preset with local-provider sentinel token', () => {
|
||||
const preset = getPresetById('llamacpp');
|
||||
expect(preset?.id).toBe('llamacpp');
|
||||
@@ -110,7 +118,11 @@ describe('provider-presets', () => {
|
||||
for (const preset of PROVIDER_PRESETS) {
|
||||
if (!preset.icon) continue;
|
||||
|
||||
const iconPath = resolve(import.meta.dir, '../../../ui/public', preset.icon.replace(/^\/+/, ''));
|
||||
const iconPath = resolve(
|
||||
import.meta.dir,
|
||||
'../../../ui/public',
|
||||
preset.icon.replace(/^\/+/, '')
|
||||
);
|
||||
expect(existsSync(iconPath)).toBe(true);
|
||||
}
|
||||
});
|
||||
|
||||
@@ -65,6 +65,30 @@ describe('model-pricing', () => {
|
||||
expect(pricing.inputPerMillion).toBe(0.6);
|
||||
});
|
||||
|
||||
it('should price current provider preset defaults without fallback rates', () => {
|
||||
const fallback = getModelPricing('unknown-model-xyz');
|
||||
|
||||
expect(getModelPricing('glm-5.2')).toMatchObject({
|
||||
inputPerMillion: 1.4,
|
||||
outputPerMillion: 4.4,
|
||||
cacheReadPerMillion: 0.26,
|
||||
});
|
||||
expect(getModelPricing('MiniMax-M3')).toMatchObject({
|
||||
inputPerMillion: 0.3,
|
||||
outputPerMillion: 1.2,
|
||||
cacheReadPerMillion: 0.06,
|
||||
});
|
||||
expect(getModelPricing('MiniMax-M3', { serviceTier: 'priority' })).toMatchObject({
|
||||
inputPerMillion: 0.45,
|
||||
outputPerMillion: 1.8,
|
||||
cacheReadPerMillion: 0.09,
|
||||
});
|
||||
|
||||
expect(getModelPricing('glm-5.2')).not.toEqual(fallback);
|
||||
expect(getModelPricing('MiniMax-M3')).not.toEqual(fallback);
|
||||
expect(getModelPricing('kimi-for-coding')).not.toEqual(fallback);
|
||||
});
|
||||
|
||||
it('should not use fallback pricing for known Qwen catalog IDs', () => {
|
||||
const fallback = getModelPricing('unknown-model-xyz');
|
||||
const catalogIds = ['qwen3-235b', 'qwen3-vl-plus', 'qwen3-32b'];
|
||||
|
||||
Reference in new issue
Block a user