|
| 1 | +import type { ModelInfo } from "../model.js" |
| 2 | + |
| 3 | +// Z AI |
| 4 | +// https://docs.z.ai/guides/llm/glm-4.5 |
| 5 | +// https://docs.z.ai/guides/overview/pricing |
| 6 | + |
| 7 | +export type InternationalZAiModelId = keyof typeof internationalZAiModels |
| 8 | +export const internationalZAiDefaultModelId: InternationalZAiModelId = "glm-4.5" |
| 9 | +export const internationalZAiModels = { |
| 10 | + "glm-4.5": { |
| 11 | + maxTokens: 98_304, |
| 12 | + contextWindow: 131_072, |
| 13 | + supportsImages: false, |
| 14 | + supportsPromptCache: true, |
| 15 | + inputPrice: 0.6, |
| 16 | + outputPrice: 2.2, |
| 17 | + cacheWritesPrice: 0, |
| 18 | + cacheReadsPrice: 0.11, |
| 19 | + description: |
| 20 | + "GLM-4.5 is Zhipu's latest featured model. Its comprehensive capabilities in reasoning, coding, and agent reach the state-of-the-art (SOTA) level among open-source models, with a context length of up to 128k.", |
| 21 | + }, |
| 22 | + "glm-4.5-air": { |
| 23 | + maxTokens: 98_304, |
| 24 | + contextWindow: 131_072, |
| 25 | + supportsImages: false, |
| 26 | + supportsPromptCache: true, |
| 27 | + inputPrice: 0.2, |
| 28 | + outputPrice: 1.1, |
| 29 | + cacheWritesPrice: 0, |
| 30 | + cacheReadsPrice: 0.03, |
| 31 | + description: |
| 32 | + "GLM-4.5-Air is the lightweight version of GLM-4.5. It balances performance and cost-effectiveness, and can flexibly switch to hybrid thinking models.", |
| 33 | + }, |
| 34 | +} as const satisfies Record<string, ModelInfo> |
| 35 | + |
| 36 | +export type MainlandZAiModelId = keyof typeof mainlandZAiModels |
| 37 | +export const mainlandZAiDefaultModelId: MainlandZAiModelId = "glm-4.5" |
| 38 | +export const mainlandZAiModels = { |
| 39 | + "glm-4.5": { |
| 40 | + maxTokens: 98_304, |
| 41 | + contextWindow: 131_072, |
| 42 | + supportsImages: false, |
| 43 | + supportsPromptCache: true, |
| 44 | + inputPrice: 0.29, |
| 45 | + outputPrice: 1.14, |
| 46 | + cacheWritesPrice: 0, |
| 47 | + cacheReadsPrice: 0.057, |
| 48 | + description: |
| 49 | + "GLM-4.5 is Zhipu's latest featured model. Its comprehensive capabilities in reasoning, coding, and agent reach the state-of-the-art (SOTA) level among open-source models, with a context length of up to 128k.", |
| 50 | + tiers: [ |
| 51 | + { |
| 52 | + contextWindow: 32_000, |
| 53 | + inputPrice: 0.21, |
| 54 | + outputPrice: 1.0, |
| 55 | + cacheReadsPrice: 0.043, |
| 56 | + }, |
| 57 | + { |
| 58 | + contextWindow: 128_000, |
| 59 | + inputPrice: 0.29, |
| 60 | + outputPrice: 1.14, |
| 61 | + cacheReadsPrice: 0.057, |
| 62 | + }, |
| 63 | + { |
| 64 | + contextWindow: Infinity, |
| 65 | + inputPrice: 0.29, |
| 66 | + outputPrice: 1.14, |
| 67 | + cacheReadsPrice: 0.057, |
| 68 | + }, |
| 69 | + ], |
| 70 | + }, |
| 71 | + "glm-4.5-air": { |
| 72 | + maxTokens: 98_304, |
| 73 | + contextWindow: 131_072, |
| 74 | + supportsImages: false, |
| 75 | + supportsPromptCache: true, |
| 76 | + inputPrice: 0.1, |
| 77 | + outputPrice: 0.6, |
| 78 | + cacheWritesPrice: 0, |
| 79 | + cacheReadsPrice: 0.02, |
| 80 | + description: |
| 81 | + "GLM-4.5-Air is the lightweight version of GLM-4.5. It balances performance and cost-effectiveness, and can flexibly switch to hybrid thinking models.", |
| 82 | + tiers: [ |
| 83 | + { |
| 84 | + contextWindow: 32_000, |
| 85 | + inputPrice: 0.07, |
| 86 | + outputPrice: 0.4, |
| 87 | + cacheReadsPrice: 0.014, |
| 88 | + }, |
| 89 | + { |
| 90 | + contextWindow: 128_000, |
| 91 | + inputPrice: 0.1, |
| 92 | + outputPrice: 0.6, |
| 93 | + cacheReadsPrice: 0.02, |
| 94 | + }, |
| 95 | + { |
| 96 | + contextWindow: Infinity, |
| 97 | + inputPrice: 0.1, |
| 98 | + outputPrice: 0.6, |
| 99 | + cacheReadsPrice: 0.02, |
| 100 | + }, |
| 101 | + ], |
| 102 | + }, |
| 103 | +} as const satisfies Record<string, ModelInfo> |
| 104 | + |
| 105 | +export const ZAI_DEFAULT_TEMPERATURE = 0 |
0 commit comments