fix(ai): pin Kimi K3 Moonshot pricing and expect Haiku 5.5 adaptive thinking

models.dev now lists the input rate as Kimi K3's cache write cost on Moonshot, which does not bill cache writes. Claude Haiku 5.5 uses adaptive thinking, so the metadata test now expects it.
This commit is contained in:
Armin Ronacher 2026-10-07 22:41:41 +02:00
parent dce4ae6f79
commit a2eef9eb60
2 changed files with 13 additions and 7 deletions

View file

@ -2433,12 +2433,15 @@ async function loadModelsDevData(): Promise<Model<any>[]> {
baseUrl,
reasoning: isKimiK3 || m.reasoning === true,
input: m.modalities?.input?.includes("image") ? ["text", "image"] : ["text"],
cost: {
input: m.cost?.input || (isKimiK3 ? KIMI_K3_COST.input : 0),
output: m.cost?.output || (isKimiK3 ? KIMI_K3_COST.output : 0),
cacheRead: m.cost?.cache_read || (isKimiK3 ? KIMI_K3_COST.cacheRead : 0),
cacheWrite: m.cost?.cache_write || (isKimiK3 ? KIMI_K3_COST.cacheWrite : 0),
},
// Moonshot does not bill cache writes; models.dev lists the input rate as cache_write for Kimi K3.
cost: isKimiK3
? { ...KIMI_K3_COST }
: {
input: m.cost?.input || 0,
output: m.cost?.output || 0,
cacheRead: m.cost?.cache_read || 0,
cacheWrite: m.cost?.cache_write || 0,
},
contextWindow: m.limit?.context || 4096,
maxTokens: m.limit?.output || 4096,
compat,