added AU inference for bedrock haiku 4.5 (#3206)

Co-authored-by: Matt Gillard <matt-github@gillard.biz>
This commit is contained in:
Matt Gillard
2025-10-17 15:48:41 +11:00
committed by GitHub
parent a590b32a10
commit ddb2e6957c

View File

@@ -121,8 +121,11 @@ export namespace Provider {
} }
case "ap": { case "ap": {
const isAustraliaRegion = ["ap-southeast-2", "ap-southeast-4"].includes(region) const isAustraliaRegion = ["ap-southeast-2", "ap-southeast-4"].includes(region)
if (isAustraliaRegion && modelID.startsWith("anthropic.claude-sonnet-4-5")) { if (isAustraliaRegion && ["anthropic.claude-sonnet-4-5", "anthropic.claude-haiku"].some((m) =>
modelID = `au.${modelID}` modelID.includes(m),
)) {
regionPrefix = "au"
modelID = `${regionPrefix}.${modelID}`
} else { } else {
const modelRequiresPrefix = ["claude", "nova-lite", "nova-micro", "nova-pro"].some((m) => const modelRequiresPrefix = ["claude", "nova-lite", "nova-micro", "nova-pro"].some((m) =>
modelID.includes(m), modelID.includes(m),
@@ -270,31 +273,31 @@ export namespace Provider {
cost: cost:
!model.cost && !existing?.cost !model.cost && !existing?.cost
? { ? {
input: 0, input: 0,
output: 0, output: 0,
cache_read: 0, cache_read: 0,
cache_write: 0, cache_write: 0,
} }
: { : {
cache_read: 0, cache_read: 0,
cache_write: 0, cache_write: 0,
...existing?.cost, ...existing?.cost,
...model.cost, ...model.cost,
}, },
options: { options: {
...existing?.options, ...existing?.options,
...model.options, ...model.options,
}, },
limit: model.limit ?? limit: model.limit ??
existing?.limit ?? { existing?.limit ?? {
context: 0, context: 0,
output: 0, output: 0,
}, },
modalities: model.modalities ?? modalities: model.modalities ??
existing?.modalities ?? { existing?.modalities ?? {
input: ["text"], input: ["text"],
output: ["text"], output: ["text"],
}, },
provider: model.provider ?? existing?.provider, provider: model.provider ?? existing?.provider,
} }
if (model.id && model.id !== modelID) { if (model.id && model.id !== modelID) {