summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorMatt Gillard <[email protected]>2025-10-17 15:48:41 +1100
committerGitHub <[email protected]>2025-10-16 23:48:41 -0500
commitddb2e6957c7e19d1ef7eb3c2da6da2c7d08eaf64 (patch)
tree9ad6e6b09e3f3ce963fdcd0bd799d884395df192
parenta590b32a100472f2ed1673660c5235006a87d86b (diff)
downloadopencode-ddb2e6957c7e19d1ef7eb3c2da6da2c7d08eaf64.tar.gz
opencode-ddb2e6957c7e19d1ef7eb3c2da6da2c7d08eaf64.zip
added AU inference for bedrock haiku 4.5 (#3206)
Co-authored-by: Matt Gillard <[email protected]>
-rw-r--r--packages/opencode/src/provider/provider.ts39
1 files changed, 21 insertions, 18 deletions
diff --git a/packages/opencode/src/provider/provider.ts b/packages/opencode/src/provider/provider.ts
index 6e78ccbc0..c895c9316 100644
--- a/packages/opencode/src/provider/provider.ts
+++ b/packages/opencode/src/provider/provider.ts
@@ -121,8 +121,11 @@ export namespace Provider {
}
case "ap": {
const isAustraliaRegion = ["ap-southeast-2", "ap-southeast-4"].includes(region)
- if (isAustraliaRegion && modelID.startsWith("anthropic.claude-sonnet-4-5")) {
- modelID = `au.${modelID}`
+ if (isAustraliaRegion && ["anthropic.claude-sonnet-4-5", "anthropic.claude-haiku"].some((m) =>
+ modelID.includes(m),
+ )) {
+ regionPrefix = "au"
+ modelID = `${regionPrefix}.${modelID}`
} else {
const modelRequiresPrefix = ["claude", "nova-lite", "nova-micro", "nova-pro"].some((m) =>
modelID.includes(m),
@@ -270,31 +273,31 @@ export namespace Provider {
cost:
!model.cost && !existing?.cost
? {
- input: 0,
- output: 0,
- cache_read: 0,
- cache_write: 0,
- }
+ input: 0,
+ output: 0,
+ cache_read: 0,
+ cache_write: 0,
+ }
: {
- cache_read: 0,
- cache_write: 0,
- ...existing?.cost,
- ...model.cost,
- },
+ cache_read: 0,
+ cache_write: 0,
+ ...existing?.cost,
+ ...model.cost,
+ },
options: {
...existing?.options,
...model.options,
},
limit: model.limit ??
existing?.limit ?? {
- context: 0,
- output: 0,
- },
+ context: 0,
+ output: 0,
+ },
modalities: model.modalities ??
existing?.modalities ?? {
- input: ["text"],
- output: ["text"],
- },
+ input: ["text"],
+ output: ["text"],
+ },
provider: model.provider ?? existing?.provider,
}
if (model.id && model.id !== modelID) {