fix(ai): keep models.dev pricing tiers for Amazon Bedrock models

Bedrock OpenAI models were costed at the short-context rate above 272k
input tokens because the generator dropped the models.dev tiers.

closes #10326
This commit is contained in:
David Brailovsky 2026-10-02 18:25:43 +02:00
parent 319fecb89b
commit 4665fafb4d
2 changed files with 3 additions and 6 deletions

View file

@ -1790,12 +1790,8 @@ async function loadModelsDevData(): Promise<Model<any>[]> {
baseUrl: getBedrockBaseUrl(id),
reasoning: m.reasoning === true,
input: (m.modalities?.input?.includes("image") ? ["text", "image"] : ["text"]) as ("text" | "image")[],
cost: {
input: m.cost?.input || 0,
output: m.cost?.output || 0,
cacheRead: m.cost?.cache_read || 0,
cacheWrite: m.cost?.cache_write || 0,
},
// Includes models.dev pricing tiers, e.g. the long-context tier for OpenAI models (#10326).
cost: getModelsDevCost(m.cost),
contextWindow: m.limit?.context || 4096,
maxTokens: m.limit?.output || 4096,
...(m.structured_output === true && { compat: { supportsStrictMode: true } }),