|
| 1 | +import type { ModelInfo } from "../model.js" |
| 2 | + |
| 3 | +// https://help.aliyun.com/zh/model-studio/text-generation-model/ |
| 4 | +// https://help.aliyun.com/zh/model-studio/deep-thinking |
| 5 | +// |
| 6 | +// supportsPromptCache: per cachedoc.md — explicit cache (cache_control) support. |
| 7 | +// supportsImages: per imagedoc.md — vision model list. |
| 8 | +// |
| 9 | +// Pricing (USD per 1M tokens): Beijing CN defaults shown in UI. |
| 10 | +// Runtime pricing via getBailianPrice() in bailian-pricing.ts overrides per region endpoint. |
| 11 | +// Cache pricing per cachedoc.md: writes = input × 1.25, reads = input × 0.10. |
| 12 | +// |
| 13 | +// Thinking mode: |
| 14 | +// - Mixed mode: enable_thinking toggles on/off (Qwen, GLM, Kimi). |
| 15 | +// - Thinking-only: always thinks, enable_thinking not applicable (MiniMax-M2.5). |
| 16 | +// - DeepSeek V4: reasoning_effort parameter ("high" / "max"). |
| 17 | + |
| 18 | +export type BailianModelId = keyof typeof bailianModels |
| 19 | +export const bailianDefaultModelId: BailianModelId = "qwen3.6-plus" |
| 20 | + |
| 21 | +// Ordered: Qwen > DeepSeek > GLM > Kimi > MiniMax; higher version > lower; max > plus > flash > other |
| 22 | +export const bailianModels = { |
| 23 | + "qwen3.7-max": { |
| 24 | + maxTokens: 65_536, |
| 25 | + maxThinkingTokens: 262_144, |
| 26 | + contextWindow: 1_048_576, |
| 27 | + supportsImages: false, |
| 28 | + supportsPromptCache: true, |
| 29 | + supportsReasoningBinary: true, |
| 30 | + supportsTemperature: true, |
| 31 | + defaultTemperature: 0.6, |
| 32 | + inputPrice: 1.65, outputPrice: 4.951, |
| 33 | + cacheWritesPrice: 2.0625, cacheReadsPrice: 0.165, |
| 34 | + description: "Qwen3.7-Max flagship model with 1M-token context, deep thinking, and structured output.", |
| 35 | + }, |
| 36 | + "qwen3.6-plus": { |
| 37 | + maxTokens: 65_536, |
| 38 | + maxThinkingTokens: 81_920, |
| 39 | + contextWindow: 1_048_576, |
| 40 | + supportsImages: true, |
| 41 | + supportsPromptCache: true, |
| 42 | + supportsReasoningBinary: true, |
| 43 | + supportsTemperature: true, |
| 44 | + defaultTemperature: 0.7, |
| 45 | + inputPrice: 0.276, outputPrice: 1.651, |
| 46 | + cacheWritesPrice: 0.345, cacheReadsPrice: 0.0276, |
| 47 | + description: "Qwen3.6-Plus native vision-language model balancing capability and cost. Recommended default.", |
| 48 | + }, |
| 49 | + "qwen3.6-flash": { |
| 50 | + maxTokens: 65_536, |
| 51 | + maxThinkingTokens: 131_072, |
| 52 | + contextWindow: 1_048_576, |
| 53 | + supportsImages: true, |
| 54 | + supportsPromptCache: true, |
| 55 | + supportsReasoningBinary: true, |
| 56 | + supportsTemperature: true, |
| 57 | + defaultTemperature: 0.7, |
| 58 | + inputPrice: 0.165, outputPrice: 0.99, |
| 59 | + cacheWritesPrice: 0.20625, cacheReadsPrice: 0.0165, |
| 60 | + description: "Qwen3.6-Flash fast and economical vision-language model with near-flagship quality.", |
| 61 | + }, |
| 62 | + "deepseek-v4-pro": { |
| 63 | + maxTokens: 393_216, |
| 64 | + contextWindow: 1_048_576, |
| 65 | + supportsImages: false, |
| 66 | + supportsPromptCache: true, |
| 67 | + supportsReasoningEffort: ["disable", "high", "xhigh"], |
| 68 | + supportsTemperature: true, |
| 69 | + defaultTemperature: 0.6, |
| 70 | + inputPrice: 1.65, outputPrice: 3.301, |
| 71 | + cacheWritesPrice: 2.0625, cacheReadsPrice: 0.165, |
| 72 | + description: "DeepSeek V4 Pro flagship MoE model with 1M-token context and cutting-edge reasoning.", |
| 73 | + }, |
| 74 | + "deepseek-v4-flash": { |
| 75 | + maxTokens: 393_216, |
| 76 | + contextWindow: 1_048_576, |
| 77 | + supportsImages: false, |
| 78 | + supportsPromptCache: true, |
| 79 | + supportsReasoningEffort: ["disable", "high", "xhigh"], |
| 80 | + supportsTemperature: true, |
| 81 | + defaultTemperature: 0.6, |
| 82 | + inputPrice: 0.138, outputPrice: 0.275, |
| 83 | + cacheWritesPrice: 0.1725, cacheReadsPrice: 0.0138, |
| 84 | + description: "DeepSeek V4 Flash cost-effective MoE model with 1M-token context and fast inference.", |
| 85 | + }, |
| 86 | + "glm-5.1": { |
| 87 | + maxTokens: 131_072, |
| 88 | + maxThinkingTokens: 131_072, |
| 89 | + contextWindow: 202_752, |
| 90 | + supportsImages: false, |
| 91 | + supportsPromptCache: true, |
| 92 | + supportsReasoningBinary: true, |
| 93 | + supportsTemperature: true, |
| 94 | + defaultTemperature: 0.6, |
| 95 | + inputPrice: 0.825, outputPrice: 3.301, |
| 96 | + cacheWritesPrice: 1.03125, cacheReadsPrice: 0.0825, |
| 97 | + description: "Zhipu GLM-5.1 with structured output, optimized for agent workflows.", |
| 98 | + }, |
| 99 | + "kimi-k2.6": { |
| 100 | + maxTokens: 98_304, |
| 101 | + maxThinkingTokens: 81_920, |
| 102 | + contextWindow: 262_144, |
| 103 | + supportsImages: false, |
| 104 | + supportsPromptCache: true, |
| 105 | + supportsReasoningBinary: true, |
| 106 | + supportsTemperature: true, |
| 107 | + defaultTemperature: 0.6, |
| 108 | + inputPrice: 0.8939, outputPrice: 3.7131, |
| 109 | + cacheWritesPrice: 1.117375, cacheReadsPrice: 0.08939, |
| 110 | + description: "Moonshot Kimi K2.6 with thinking mode disabled by default. Supports Token Plan and Coding Plan.", |
| 111 | + }, |
| 112 | + // MiniMax-M2.5 is thinking-only — always thinks, enable_thinking not applicable. |
| 113 | + "MiniMax-M2.5": { |
| 114 | + maxTokens: 32_768, |
| 115 | + contextWindow: 196_608, |
| 116 | + supportsImages: false, |
| 117 | + supportsPromptCache: false, |
| 118 | + supportsTemperature: true, |
| 119 | + defaultTemperature: 1.0, |
| 120 | + inputPrice: 0.304, outputPrice: 1.213, |
| 121 | + description: "MiniMax M2.5 thinking-only model optimized for agent workflows. Supports Token Plan.", |
| 122 | + }, |
| 123 | +} as const satisfies Record<string, ModelInfo> |
| 124 | + |
| 125 | +export const BAILIAN_DEFAULT_TEMPERATURE = 0.7 |
0 commit comments