Skip to content

Commit 16425bc

Browse files
zoomote[bot]roomoteedelauna
authored
[Feat] Add Claude Haiku 5.5 to the AWS Bedrock model dropdown (#2100)
* feat(providers): add Anthropic Claude Haiku 5.5 to AWS Bedrock model catalog * test(bedrock): strengthen Haiku 5.5 request coverage --------- Co-authored-by: Roomote <[email protected]> Co-authored-by: Elliott de Launay <[email protected]>
1 parent 6c76f90 commit 16425bc

3 files changed

Lines changed: 188 additions & 23 deletions

File tree

‎packages/types/src/providers/bedrock.ts‎

Lines changed: 41 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -277,6 +277,35 @@ export const bedrockModels = {
277277
description:
278278
"Claude Opus 5.5 is Anthropic's most capable model for complex agentic coding and enterprise work.",
279279
},
280+
"anthropic.claude-haiku-5-5": {
281+
// 128K max output tokens, 1M native context window, 512-token minimum per
282+
// cache checkpoint, and 4 max cache checkpoints per the AWS Bedrock model card:
283+
// https://docs.aws.amazon.com/bedrock/latest/userguide/model-card-anthropic-claude-haiku-5-5.html
284+
maxTokens: 128_000,
285+
supportsMaxTokens: true,
286+
contextWindow: 1_000_000, // 1M context window native (no beta header required)
287+
supportsImages: true,
288+
supportsPromptCache: true,
289+
supportsReasoningBudget: true,
290+
supportsReasoningBinary: true,
291+
supportsTemperature: false,
292+
// Standard pricing (prompts of 100,000 tokens or fewer) from Anthropic's
293+
// pricing page, which lists the same Claude list prices billed on Bedrock:
294+
// https://platform.claude.com/docs/en/about-claude/pricing
295+
// These fields price the standard tier only. This entry does not model
296+
// the tiered long-context rates that prompts over 100,000 tokens bill at.
297+
inputPrice: 0.1, // $0.10 per million input tokens
298+
outputPrice: 0.5, // $0.50 per million output tokens
299+
cacheWritesPrice: 0.125, // $0.125 per million tokens (5m cache writes)
300+
cacheReadsPrice: 0.01, // $0.01 per million tokens (cache hits / refreshes)
301+
// The same Bedrock model card lists 512 as the minimum tokens per cache
302+
// checkpoint for Haiku 5.5 (matching the Opus 5.5 entry above).
303+
minTokensPerCachePoint: 512,
304+
maxCachePoints: 4,
305+
cachableFields: ["system", "messages", "tools"],
306+
description:
307+
"Claude Haiku 5.5 is the fastest, most efficient Claude 5.5 model, built for high-volume, latency-sensitive coding and agent work.",
308+
},
280309
"anthropic.claude-fable-5-1": {
281310
maxTokens: 128_000,
282311
contextWindow: 1_000_000,
@@ -681,7 +710,16 @@ export const BEDROCK_1M_CONTEXT_MODEL_IDS = [
681710
// intentionally absent.
682711
// https://docs.aws.amazon.com/bedrock/latest/userguide/model-card-anthropic-claude-sonnet-5.html
683712
// https://docs.aws.amazon.com/bedrock/latest/userguide/model-card-anthropic-claude-opus-5.html
684-
export const BEDROCK_THINKING_DISABLE_MODEL_IDS = ["anthropic.claude-sonnet-5", "anthropic.claude-opus-5"] as const
713+
// https://docs.aws.amazon.com/bedrock/latest/userguide/model-card-anthropic-claude-haiku-5-5.html
714+
export const BEDROCK_THINKING_DISABLE_MODEL_IDS = [
715+
"anthropic.claude-sonnet-5",
716+
"anthropic.claude-opus-5",
717+
// Unlike adaptive-only Opus 5.5, Haiku 5.5 accepts an explicit
718+
// `thinking: { type: "disabled" }` and turns its default adaptive thinking
719+
// off. AWS caps effort at "high" while thinking is disabled.
720+
// https://docs.aws.amazon.com/bedrock/latest/userguide/claude-messages-adaptive-thinking.html
721+
"anthropic.claude-haiku-5-5",
722+
] as const
685723

686724
// Amazon Bedrock models that support Global Inference profiles
687725
// As of Nov 2025, AWS supports Global Inference for:
@@ -695,6 +733,7 @@ export const BEDROCK_THINKING_DISABLE_MODEL_IDS = ["anthropic.claude-sonnet-5",
695733
// - Claude Opus 4.7
696734
// - Claude Opus 5
697735
// - Claude Opus 5.5
736+
// - Claude Haiku 5.5
698737
// - Claude Fable 5 and 5.1 (cross-region inference only — can only be used through an inference profile)
699738
export const BEDROCK_GLOBAL_INFERENCE_MODEL_IDS = [
700739
"anthropic.claude-sonnet-4-20250514-v1:0",
@@ -708,6 +747,7 @@ export const BEDROCK_GLOBAL_INFERENCE_MODEL_IDS = [
708747
"anthropic.claude-opus-4-8",
709748
"anthropic.claude-opus-5",
710749
"anthropic.claude-opus-5-5",
750+
"anthropic.claude-haiku-5-5",
711751
"anthropic.claude-fable-5-1",
712752
"anthropic.claude-fable-5",
713753
] as const

‎src/api/providers/__tests__/bedrock.spec.ts‎

Lines changed: 139 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -146,6 +146,7 @@ describe("AwsBedrockHandler", () => {
146146
["anthropic.claude-opus-4-8", 128_000],
147147
["anthropic.claude-opus-5", 128_000],
148148
["anthropic.claude-opus-5-5", 128_000],
149+
["anthropic.claude-haiku-5-5", 128_000],
149150
] as const)("exposes %s output ceiling without raising request defaults", async (apiModelId, ceiling) => {
150151
for (const enableReasoningEffort of [true, false]) {
151152
for (const modelMaxTokens of [undefined, ceiling]) {
@@ -1047,6 +1048,72 @@ describe("AwsBedrockHandler", () => {
10471048
const model = handler.getModel()
10481049
expect(model.id).toBe("global.anthropic.claude-opus-5-5")
10491050
})
1051+
1052+
it("should return Claude Haiku 5.5 model info", () => {
1053+
const handler = new AwsBedrockHandler({
1054+
apiModelId: "anthropic.claude-haiku-5-5",
1055+
awsAccessKey: "",
1056+
awsSecretKey: "",
1057+
awsRegion: "us-east-1",
1058+
})
1059+
1060+
const model = handler.getModel()
1061+
expect(model.id).toBe("anthropic.claude-haiku-5-5")
1062+
expect(model.info.maxTokens).toBe(128_000)
1063+
expect(model.info.contextWindow).toBe(1_000_000)
1064+
expect(model.info.inputPrice).toBe(0.1)
1065+
expect(model.info.outputPrice).toBe(0.5)
1066+
expect(model.info.cacheWritesPrice).toBe(0.125)
1067+
expect(model.info.cacheReadsPrice).toBe(0.01)
1068+
expect(model.info.minTokensPerCachePoint).toBe(512)
1069+
expect(model.info.maxCachePoints).toBe(4)
1070+
expect(model.info.supportsPromptCache).toBe(true)
1071+
expect(model.info.supportsReasoningBinary).toBe(true)
1072+
expect(model.info.supportsReasoningBudget).toBe(true)
1073+
expect(model.info.supportsTemperature).toBe(false)
1074+
expect(model.maxTokens).toBe(8192)
1075+
})
1076+
1077+
it.each([
1078+
{
1079+
label: "regional (us.)",
1080+
option: { awsUseCrossRegionInference: true },
1081+
expectedId: "us.anthropic.claude-haiku-5-5",
1082+
},
1083+
{
1084+
label: "global",
1085+
option: { awsUseGlobalInference: true },
1086+
expectedId: "global.anthropic.claude-haiku-5-5",
1087+
},
1088+
])("should apply the $label inference profile prefix for Claude Haiku 5.5", ({ option, expectedId }) => {
1089+
// The user-verified invocation path: regional and global prefixes
1090+
// must keep the known catalog entry's prompt-cache capability.
1091+
const handler = new AwsBedrockHandler({
1092+
apiModelId: "anthropic.claude-haiku-5-5",
1093+
awsAccessKey: "",
1094+
awsSecretKey: "",
1095+
awsRegion: "us-east-1",
1096+
...option,
1097+
})
1098+
1099+
const model = handler.getModel()
1100+
expect(model.id).toBe(expectedId)
1101+
expect(model.info.supportsPromptCache).toBe(true)
1102+
expect(model.info.minTokensPerCachePoint).toBe(512)
1103+
})
1104+
1105+
it("should resolve a stored us.-prefixed Claude Haiku 5.5 id to catalog info", () => {
1106+
const handler = new AwsBedrockHandler({
1107+
apiModelId: "us.anthropic.claude-haiku-5-5",
1108+
awsAccessKey: "",
1109+
awsSecretKey: "",
1110+
awsRegion: "us-east-1",
1111+
})
1112+
1113+
const model = handler.getModel()
1114+
expect(model.info.supportsPromptCache).toBe(true)
1115+
expect(model.info.inputPrice).toBe(0.1)
1116+
})
10501117
})
10511118

10521119
describe("1M context beta feature", () => {
@@ -1805,6 +1872,34 @@ describe("AwsBedrockHandler", () => {
18051872
expect(commandArg.inferenceConfig?.temperature).toBeUndefined()
18061873
})
18071874

1875+
it("should send adaptive thinking and omit temperature for Claude Haiku 5.5 when reasoning is enabled", async () => {
1876+
// Haiku 5.5 shares the Sonnet 5 / Opus 5 adaptive-thinking contract:
1877+
// budget_tokens causes a 400, so thinking.type must be "adaptive".
1878+
// effort and display are handler-internal defaults, not part of this
1879+
// scenario, so only the thinking type is pinned here.
1880+
const haiku55Handler = new AwsBedrockHandler({
1881+
apiModelId: "anthropic.claude-haiku-5-5",
1882+
awsAccessKey: "test-access-key",
1883+
awsSecretKey: "test-secret-key",
1884+
awsRegion: "us-east-1",
1885+
enableReasoningEffort: true,
1886+
})
1887+
1888+
const generator = haiku55Handler.createMessage("System prompt", messages)
1889+
await generator.next()
1890+
1891+
expect(mockConverseStreamCommand).toHaveBeenCalled()
1892+
const commandArg = mockConverseStreamCommand.mock.calls[0][0]
1893+
1894+
expect(commandArg.additionalModelRequestFields).toEqual(
1895+
expect.objectContaining({
1896+
thinking: expect.objectContaining({ type: "adaptive" }),
1897+
}),
1898+
)
1899+
// Haiku 5.5 rejects sampling parameters: temperature must be omitted.
1900+
expect(commandArg.inferenceConfig?.temperature).toBeUndefined()
1901+
})
1902+
18081903
it("should omit thinking and temperature for Claude Opus 4.8 when reasoning is disabled", async () => {
18091904
const provider = new AwsBedrockHandler({
18101905
apiModelId: "anthropic.claude-opus-4-8",
@@ -1817,23 +1912,26 @@ describe("AwsBedrockHandler", () => {
18171912
expect(commandArg.inferenceConfig?.temperature).toBeUndefined()
18181913
})
18191914

1820-
it.each(["anthropic.claude-sonnet-5", "anthropic.claude-opus-5", "us.anthropic.claude-opus-5"])(
1821-
"explicitly disables thinking for %s when reasoning is disabled",
1822-
async (apiModelId) => {
1823-
const provider = new AwsBedrockHandler({
1824-
apiModelId,
1825-
enableReasoningEffort: false,
1826-
modelMaxTokens: 32_000,
1827-
})
1828-
await collectStream(provider.createMessage("System prompt", messages))
1915+
it.each([
1916+
"anthropic.claude-sonnet-5",
1917+
"anthropic.claude-opus-5",
1918+
"us.anthropic.claude-opus-5",
1919+
"anthropic.claude-haiku-5-5",
1920+
"us.anthropic.claude-haiku-5-5",
1921+
])("explicitly disables thinking for %s when reasoning is disabled", async (apiModelId) => {
1922+
const provider = new AwsBedrockHandler({
1923+
apiModelId,
1924+
enableReasoningEffort: false,
1925+
modelMaxTokens: 32_000,
1926+
})
1927+
await collectStream(provider.createMessage("System prompt", messages))
18291928

1830-
const commandArg = mockConverseStreamCommand.mock.calls[0][0]
1831-
expect(commandArg.additionalModelRequestFields).toEqual(
1832-
expect.objectContaining({ thinking: { type: "disabled" } }),
1833-
)
1834-
expect(commandArg.inferenceConfig?.temperature).toBeUndefined()
1835-
},
1836-
)
1929+
const commandArg = mockConverseStreamCommand.mock.calls[0][0]
1930+
expect(commandArg.additionalModelRequestFields).toEqual(
1931+
expect.objectContaining({ thinking: { type: "disabled" } }),
1932+
)
1933+
expect(commandArg.inferenceConfig?.temperature).toBeUndefined()
1934+
})
18371935

18381936
it.each([
18391937
"anthropic.claude-fable-5",
@@ -1927,6 +2025,28 @@ describe("AwsBedrockHandler", () => {
19272025
expect(commandArg.inferenceConfig?.temperature).toBeUndefined()
19282026
})
19292027

2028+
it("completePrompt should omit temperature for Claude Haiku 5.5 (non-stream path)", async () => {
2029+
// Regression guard for the non-stream path: completePrompt must guard
2030+
// temperature the same way createMessage does, otherwise adaptive-thinking
2031+
// models like Haiku 5.5 return a 400 from Bedrock.
2032+
const mockConverseCommand = vi.mocked(ConverseCommand)
2033+
2034+
const haiku55Handler = new AwsBedrockHandler({
2035+
apiModelId: "anthropic.claude-haiku-5-5",
2036+
awsAccessKey: "test-access-key",
2037+
awsSecretKey: "test-secret-key",
2038+
awsRegion: "us-east-1",
2039+
})
2040+
2041+
await haiku55Handler.completePrompt("Test prompt")
2042+
2043+
expect(mockConverseCommand).toHaveBeenCalled()
2044+
const commandArg = mockConverseCommand.mock.calls[0][0]
2045+
2046+
// Haiku 5.5 must NOT receive temperature in the non-stream inferenceConfig.
2047+
expect(commandArg.inferenceConfig?.temperature).toBeUndefined()
2048+
})
2049+
19302050
it("completePrompt should still send temperature for older Claude Opus 4.6 (non-stream path)", async () => {
19312051
// 4.6 and earlier still accept sampling parameters, so completePrompt must
19322052
// continue to send temperature for them.
@@ -2135,6 +2255,7 @@ describe("AwsBedrockHandler", () => {
21352255
expect(isAdaptiveThinkingModel("anthropic.claude-sonnet-5")).toBe(true)
21362256
expect(isAdaptiveThinkingModel("anthropic.claude-opus-5")).toBe(true)
21372257
expect(isAdaptiveThinkingModel("anthropic.claude-opus-5-5")).toBe(true)
2258+
expect(isAdaptiveThinkingModel("anthropic.claude-haiku-5-5")).toBe(true)
21382259
// Future-proof Sonnet patterns — guarded even before a registry entry exists.
21392260
expect(isAdaptiveThinkingModel("anthropic.claude-sonnet-4-7")).toBe(true)
21402261
expect(isAdaptiveThinkingModel("anthropic.claude-sonnet-4-8")).toBe(true)
@@ -2146,6 +2267,7 @@ describe("AwsBedrockHandler", () => {
21462267
expect(isAdaptiveThinkingModel("global.anthropic.claude-sonnet-5")).toBe(true)
21472268
expect(isAdaptiveThinkingModel("global.anthropic.claude-opus-5")).toBe(true)
21482269
expect(isAdaptiveThinkingModel("global.anthropic.claude-opus-5-5")).toBe(true)
2270+
expect(isAdaptiveThinkingModel("global.anthropic.claude-haiku-5-5")).toBe(true)
21492271
expect(isAdaptiveThinkingModel("eu.anthropic.claude-sonnet-4-7")).toBe(true)
21502272
expect(isAdaptiveThinkingModel("global.anthropic.claude-opus-4-8")).toBe(true)
21512273
})
@@ -2155,6 +2277,7 @@ describe("AwsBedrockHandler", () => {
21552277
expect(isAdaptiveThinkingModel("anthropic.claude-opus-4-5-20251101-v1:0")).toBe(false)
21562278
expect(isAdaptiveThinkingModel("anthropic.claude-sonnet-4-6")).toBe(false)
21572279
expect(isAdaptiveThinkingModel("anthropic.claude-3-5-sonnet-20241022-v2:0")).toBe(false)
2280+
expect(isAdaptiveThinkingModel("anthropic.claude-haiku-4-5-20251001-v1:0")).toBe(false)
21582281
expect(isAdaptiveThinkingModel("amazon.nova-lite-v1:0")).toBe(false)
21592282
})
21602283
})

‎src/api/providers/bedrock.ts‎

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -331,12 +331,13 @@ export class AwsBedrockHandler extends BaseProvider implements SingleCompletionH
331331
* Detect models that require the adaptive-thinking API contract.
332332
*
333333
* Starting with Claude Opus 4.7 (and the matching Sonnet 4.7), and continuing
334-
* in Opus 4.8 / Sonnet 4.8, Claude Fable 5/5.1, Claude Sonnet 5, and Claude Opus 5,
335-
* Anthropic removed sampling parameters (temperature/top_p/top_k) and replaced
336-
* budget_tokens-based thinking with `thinking.type: "adaptive"` plus
334+
* in Opus 4.8 / Sonnet 4.8, Claude Fable 5/5.1, Claude Sonnet 5, Claude Opus 5,
335+
* and Claude Haiku 5.5, Anthropic removed sampling parameters (temperature/top_p/top_k)
336+
* and replaced budget_tokens-based thinking with `thinking.type: "adaptive"` plus
337337
* `output_config.effort`. The migration guide from 4.7 → 4.8 confirms there
338-
* are no further breaking API changes, and Fable 5+ / Sonnet 5 / Opus 5 keep the
339-
* same adaptive-thinking contract, so a single guard matches all generations.
338+
* are no further breaking API changes, and Fable 5+ / Sonnet 5 / Opus 5 /
339+
* Haiku 5.5 keep the same adaptive-thinking contract, so a single guard
340+
* matches all generations.
340341
* Shared by createMessage and completePrompt so both request paths omit
341342
* temperature for these models (sending it causes a 400).
342343
*
@@ -352,7 +353,8 @@ export class AwsBedrockHandler extends BaseProvider implements SingleCompletionH
352353
baseModelId.includes("fable-5") ||
353354
baseModelId.includes("sonnet-4-7") ||
354355
baseModelId.includes("sonnet-4-8") ||
355-
baseModelId.includes("sonnet-5")
356+
baseModelId.includes("sonnet-5") ||
357+
baseModelId.includes("haiku-5-5")
356358
)
357359
}
358360

0 commit comments

Comments
 (0)