From 20e315ba3f5f165602ec89a38e94b2c9249e7ab8 Mon Sep 17 00:00:00 2001 From: tiennm99 Date: Fri, 19 Jun 2026 17:36:06 +0700 Subject: [PATCH 1/2] fix(config): update provider default models --- config/base-glm.settings.json | 8 ++++---- config/base-glmt.settings.json | 8 ++++---- config/base-km.settings.json | 8 ++++---- config/base-mm.settings.json | 8 ++++---- src/shared/provider-preset-catalog.ts | 14 +++++++------- 5 files changed, 23 insertions(+), 23 deletions(-) diff --git a/config/base-glm.settings.json b/config/base-glm.settings.json index 0c9f2fb6..5436ff3a 100644 --- a/config/base-glm.settings.json +++ b/config/base-glm.settings.json @@ -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" } } diff --git a/config/base-glmt.settings.json b/config/base-glmt.settings.json index 4fe7da01..e7f29154 100644 --- a/config/base-glmt.settings.json +++ b/config/base-glmt.settings.json @@ -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", diff --git a/config/base-km.settings.json b/config/base-km.settings.json index c60892d5..bf74a6f1 100644 --- a/config/base-km.settings.json +++ b/config/base-km.settings.json @@ -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" } } diff --git a/config/base-mm.settings.json b/config/base-mm.settings.json index c3e9452d..15f096c5 100644 --- a/config/base-mm.settings.json +++ b/config/base-mm.settings.json @@ -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" } } diff --git a/src/shared/provider-preset-catalog.ts b/src/shared/provider-preset-catalog.ts index 5d934789..8f1d7705 100644 --- a/src/shared/provider-preset-catalog.ts +++ b/src/shared/provider-preset-catalog.ts @@ -159,7 +159,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', @@ -170,16 +170,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', }, { @@ -199,10 +199,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', From 34123a62a69c7e5acd621fc54da901a6975f1709 Mon Sep 17 00:00:00 2001 From: Tam Nhu Tran Date: Fri, 19 Jun 2026 09:57:49 -0400 Subject: [PATCH 2/2] fix(usage): price updated provider defaults --- src/web-server/model-pricing.ts | 24 ++++++++++++++++++++++-- tests/unit/api/provider-presets.test.ts | 14 +++++++++++++- tests/unit/model-pricing.test.ts | 24 ++++++++++++++++++++++++ 3 files changed, 59 insertions(+), 3 deletions(-) diff --git a/src/web-server/model-pricing.ts b/src/web-server/model-pricing.ts index 2f36e1a8..9a176882 100644 --- a/src/web-server/model-pricing.ts +++ b/src/web-server/model-pricing.ts @@ -531,8 +531,14 @@ const PRICING_REGISTRY: Record = { }, // --------------------------------------------------------------------------- - // 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 = { }, // --------------------------------------------------------------------------- - // 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, diff --git a/tests/unit/api/provider-presets.test.ts b/tests/unit/api/provider-presets.test.ts index 8d2dc167..75fef442 100644 --- a/tests/unit/api/provider-presets.test.ts +++ b/tests/unit/api/provider-presets.test.ts @@ -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); } }); diff --git a/tests/unit/model-pricing.test.ts b/tests/unit/model-pricing.test.ts index dfafe478..7502f674 100644 --- a/tests/unit/model-pricing.test.ts +++ b/tests/unit/model-pricing.test.ts @@ -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'];