From a6d4381d15a8aef604123a6b71dc280fef72a6be Mon Sep 17 00:00:00 2001 From: Mitsuki Ogasahara Date: Fri, 21 Nov 2025 01:08:31 +0900 Subject: [PATCH] feat(anthropic): update and align Vertex AI model maxTokens values --- src/ax/ai/anthropic/info.ts | 86 +++++++++++++++++++++++++++++++++++- src/ax/ai/anthropic/types.ts | 17 ++++--- 2 files changed, 96 insertions(+), 7 deletions(-) diff --git a/src/ax/ai/anthropic/info.ts b/src/ax/ai/anthropic/info.ts index 0196e609..c22fe8a5 100644 --- a/src/ax/ai/anthropic/info.ts +++ b/src/ax/ai/anthropic/info.ts @@ -1,6 +1,6 @@ import type { AxModelInfo } from '../types.js'; -import { AxAIAnthropicModel } from './types.js'; +import { AxAIAnthropicModel, AxAIAnthropicVertexModel } from './types.js'; export const axModelInfoAnthropic: AxModelInfo[] = [ // 4.5 Sonnet (2025-09) @@ -13,6 +13,14 @@ export const axModelInfoAnthropic: AxModelInfo[] = [ maxTokens: 200000, supported: { thinkingBudget: true, showThoughts: true }, }, + { + name: AxAIAnthropicVertexModel.Claude45Sonnet, + currency: 'usd', + promptTokenCostPer1M: 3.0, + completionTokenCostPer1M: 15.0, + maxTokens: 200000, + supported: { thinkingBudget: true, showThoughts: true }, + }, // 4.5 Haiku (2025-10) { name: AxAIAnthropicModel.Claude45Haiku, @@ -23,6 +31,14 @@ export const axModelInfoAnthropic: AxModelInfo[] = [ maxTokens: 200000, // match modern context window similar to Sonnet 4.5 era supported: { thinkingBudget: true, showThoughts: true }, }, + { + name: AxAIAnthropicVertexModel.Claude45Haiku, + currency: 'usd', + promptTokenCostPer1M: 1.0, + completionTokenCostPer1M: 5.0, + maxTokens: 200000, + supported: { thinkingBudget: true, showThoughts: true }, + }, // 4 { name: AxAIAnthropicModel.Claude41Opus, @@ -32,6 +48,14 @@ export const axModelInfoAnthropic: AxModelInfo[] = [ maxTokens: 32000, supported: { thinkingBudget: true, showThoughts: true }, }, + { + name: AxAIAnthropicVertexModel.Claude41Opus, + currency: 'usd', + promptTokenCostPer1M: 15.0, + completionTokenCostPer1M: 75.0, + maxTokens: 32000, + supported: { thinkingBudget: true, showThoughts: true }, + }, { name: AxAIAnthropicModel.Claude4Opus, currency: 'usd', @@ -40,6 +64,14 @@ export const axModelInfoAnthropic: AxModelInfo[] = [ maxTokens: 32000, supported: { thinkingBudget: true, showThoughts: true }, }, + { + name: AxAIAnthropicVertexModel.Claude4Opus, + currency: 'usd', + promptTokenCostPer1M: 15.0, + completionTokenCostPer1M: 75.0, + maxTokens: 32000, + supported: { thinkingBudget: true, showThoughts: true }, + }, { name: AxAIAnthropicModel.Claude4Sonnet, currency: 'usd', @@ -48,6 +80,14 @@ export const axModelInfoAnthropic: AxModelInfo[] = [ maxTokens: 64000, supported: { thinkingBudget: true, showThoughts: true }, }, + { + name: AxAIAnthropicVertexModel.Claude4Sonnet, + currency: 'usd', + promptTokenCostPer1M: 3.0, + completionTokenCostPer1M: 15.0, + maxTokens: 64000, + supported: { thinkingBudget: true, showThoughts: true }, + }, // 3.7 { name: AxAIAnthropicModel.Claude37Sonnet, @@ -57,6 +97,14 @@ export const axModelInfoAnthropic: AxModelInfo[] = [ maxTokens: 64000, supported: { thinkingBudget: true, showThoughts: true }, }, + { + name: AxAIAnthropicVertexModel.Claude37Sonnet, + currency: 'usd', + promptTokenCostPer1M: 3.0, + completionTokenCostPer1M: 15.0, + maxTokens: 64000, + supported: { thinkingBudget: true, showThoughts: true }, + }, // 3.5 { name: AxAIAnthropicModel.Claude35Sonnet, @@ -65,6 +113,21 @@ export const axModelInfoAnthropic: AxModelInfo[] = [ completionTokenCostPer1M: 15.0, maxTokens: 8192, }, + { + name: AxAIAnthropicVertexModel.Claude35Sonnet, + currency: 'usd', + promptTokenCostPer1M: 3.0, + completionTokenCostPer1M: 15.0, + maxTokens: 8192, + }, + { + name: AxAIAnthropicVertexModel.Claude35SonnetV2, + currency: 'usd', + promptTokenCostPer1M: 3.0, + completionTokenCostPer1M: 15.0, + maxTokens: 8192, + supported: { thinkingBudget: true, showThoughts: true }, + }, { name: AxAIAnthropicModel.Claude35Haiku, currency: 'usd', @@ -72,6 +135,13 @@ export const axModelInfoAnthropic: AxModelInfo[] = [ completionTokenCostPer1M: 4.0, maxTokens: 8192, }, + { + name: AxAIAnthropicVertexModel.Claude35Haiku, + currency: 'usd', + promptTokenCostPer1M: 1.0, + completionTokenCostPer1M: 5.0, + maxTokens: 8192, + }, // 3 { name: AxAIAnthropicModel.Claude3Opus, @@ -80,6 +150,13 @@ export const axModelInfoAnthropic: AxModelInfo[] = [ completionTokenCostPer1M: 75.0, maxTokens: 4096, }, + { + name: AxAIAnthropicVertexModel.Claude3Opus, + currency: 'usd', + promptTokenCostPer1M: 15.0, + completionTokenCostPer1M: 75.0, + maxTokens: 4096, + }, { name: AxAIAnthropicModel.Claude3Sonnet, currency: 'usd', @@ -94,6 +171,13 @@ export const axModelInfoAnthropic: AxModelInfo[] = [ completionTokenCostPer1M: 1.25, maxTokens: 4096, }, + { + name: AxAIAnthropicVertexModel.Claude3Haiku, + currency: 'usd', + promptTokenCostPer1M: 0.25, + completionTokenCostPer1M: 1.25, + maxTokens: 4096, + }, // 2.1 { name: AxAIAnthropicModel.Claude21, diff --git a/src/ax/ai/anthropic/types.ts b/src/ax/ai/anthropic/types.ts index 0b70be34..c8387dee 100644 --- a/src/ax/ai/anthropic/types.ts +++ b/src/ax/ai/anthropic/types.ts @@ -20,12 +20,17 @@ export enum AxAIAnthropicModel { } export enum AxAIAnthropicVertexModel { - Claude37Sonnet = 'claude-3-7-sonnet', - Claude35Haiku = 'claude-3-5-haiku', - Claude35Sonnet = 'claude-3-5-sonnet', - Claude35SonnetV2 = 'claude-3-5-sonnet-v2', - Claude3Haiku = 'claude-3-haiku', - Claude3Opus = 'claude-3-opus', + Claude41Opus = 'claude-opus-4-1@20250805', + Claude4Opus = 'claude-opus-4@20250514', + Claude45Sonnet = 'claude-sonnet-4-5@20250929', + Claude4Sonnet = 'claude-sonnet-4@20250514', + Claude37Sonnet = 'claude-3-7-sonnet@20250219', + Claude35SonnetV2 = 'claude-3-5-sonnet-v2@20241022', + Claude45Haiku = 'claude-haiku-4.5@20251001', + Claude35Haiku = 'claude-3-5-haiku@20241022', + Claude35Sonnet = 'claude-3-5-sonnet@20240620', + Claude3Opus = 'claude-3-opus@20240229', + Claude3Haiku = 'claude-3-haiku@20240307', } export type AxAIAnthropicThinkingConfig = {