feat(glm): add GLM 4.7 model support

- Update default GLM/GLMT model from glm-4.6 to glm-4.7
- Add glm-4.7 pricing entry
- Sync UI presets with CLI changes

Closes #179
This commit is contained in:
kaitranntt committed 2025-12-22 16:13:19 -05:00
1 parent 3da29e58e3
commit a827b73eef
4 files changed
+13 -7

No files matched your search

+3 -3
View File
@@ -47,10 +47,10 @@ export const PROVIDER_PRESETS: ProviderPreset[] = [
{ {
id: 'glm', id: 'glm',
name: 'GLM', name: 'GLM',
description: 'Claude via Z.AI (GitHub Copilot)', description: 'Claude via Z.AI',
baseUrl: 'https://api.z.ai/api/anthropic', baseUrl: 'https://api.z.ai/api/anthropic',
defaultProfileName: 'glm', defaultProfileName: 'glm',
defaultModel: 'glm-4.6', defaultModel: 'glm-4.7',
apiKeyPlaceholder: 'ghp_...', apiKeyPlaceholder: 'ghp_...',
apiKeyHint: 'Get your API key from Z.AI', apiKeyHint: 'Get your API key from Z.AI',
category: 'alternative', category: 'alternative',
@@ -61,7 +61,7 @@ export const PROVIDER_PRESETS: ProviderPreset[] = [
description: 'GLM with Thinking mode support', description: 'GLM with Thinking mode support',
baseUrl: 'https://api.z.ai/api/coding/paas/v4/chat/completions', baseUrl: 'https://api.z.ai/api/coding/paas/v4/chat/completions',
defaultProfileName: 'glmt', defaultProfileName: 'glmt',
defaultModel: 'glm-4.6', defaultModel: 'glm-4.7',
apiKeyPlaceholder: 'ghp_...', apiKeyPlaceholder: 'ghp_...',
apiKeyHint: 'Same API key as GLM', apiKeyHint: 'Same API key as GLM',
category: 'alternative', category: 'alternative',
+1 -1
View File
@@ -438,7 +438,7 @@ async function showHelp(): Promise<void> {
console.log( console.log(
` ${color('openrouter', 'command')} OpenRouter - 349+ models (Claude, GPT, Gemini, Llama)` ` ${color('openrouter', 'command')} OpenRouter - 349+ models (Claude, GPT, Gemini, Llama)`
); );
console.log(` ${color('glm', 'command')} GLM - Claude via Z.AI (GitHub Copilot)`); console.log(` ${color('glm', 'command')} GLM - Claude via Z.AI`);
console.log(` ${color('glmt', 'command')} GLMT - GLM with Thinking mode`); console.log(` ${color('glmt', 'command')} GLMT - GLM with Thinking mode`);
console.log(` ${color('kimi', 'command')} Kimi - Moonshot AI reasoning model`); console.log(` ${color('kimi', 'command')} Kimi - Moonshot AI reasoning model`);
console.log(` ${color('foundry', 'command')} Azure Foundry - Claude via Microsoft Azure`); console.log(` ${color('foundry', 'command')} Azure Foundry - Claude via Microsoft Azure`);
+6
View File
@@ -412,6 +412,12 @@ const PRICING_REGISTRY: Record<string, ModelPricing> = {
// --------------------------------------------------------------------------- // ---------------------------------------------------------------------------
// GLM Models (Zhipu AI / Z.AI) - Source: better-ccusage // GLM Models (Zhipu AI / Z.AI) - Source: better-ccusage
// --------------------------------------------------------------------------- // ---------------------------------------------------------------------------
'glm-4.7': {
inputPerMillion: 0.6,
outputPerMillion: 2.2,
cacheCreationPerMillion: 0.0,
cacheReadPerMillion: 0.11,
},
'glm-4.6': { 'glm-4.6': {
inputPerMillion: 0.6, inputPerMillion: 0.6,
outputPerMillion: 2.2, outputPerMillion: 2.2,
+3 -3
View File
@@ -44,11 +44,11 @@ export const PROVIDER_PRESETS: ProviderPreset[] = [
{ {
id: 'glm', id: 'glm',
name: 'GLM', name: 'GLM',
description: 'Claude via Z.AI (GitHub Copilot)', description: 'Claude via Z.AI',
baseUrl: 'https://api.z.ai/api/anthropic', baseUrl: 'https://api.z.ai/api/anthropic',
defaultProfileName: 'glm', defaultProfileName: 'glm',
badge: 'Z.AI', badge: 'Z.AI',
defaultModel: 'glm-4.6', defaultModel: 'glm-4.7',
requiresApiKey: true, requiresApiKey: true,
apiKeyPlaceholder: 'ghp_...', apiKeyPlaceholder: 'ghp_...',
apiKeyHint: 'Get your API key from Z.AI', apiKeyHint: 'Get your API key from Z.AI',
@@ -61,7 +61,7 @@ export const PROVIDER_PRESETS: ProviderPreset[] = [
baseUrl: 'https://api.z.ai/api/coding/paas/v4/chat/completions', baseUrl: 'https://api.z.ai/api/coding/paas/v4/chat/completions',
defaultProfileName: 'glmt', defaultProfileName: 'glmt',
badge: 'Thinking', badge: 'Thinking',
defaultModel: 'glm-4.6', defaultModel: 'glm-4.7',
requiresApiKey: true, requiresApiKey: true,
apiKeyPlaceholder: 'ghp_...', apiKeyPlaceholder: 'ghp_...',
apiKeyHint: 'Same API key as GLM', apiKeyHint: 'Same API key as GLM',