From dc6dde4d7ba90eb7b5f6d54fb0fcdebc48307263 Mon Sep 17 00:00:00 2001 From: David Irvine Date: Fri, 3 Jul 2026 22:56:08 +0200 Subject: [PATCH 1/2] bedrock: Fix Claude Sonnet 5 and Fable 5 routing outside US regions These models cannot be invoked with on-demand throughput and only have us.* and global.* cross-region inference profiles. Requesting them via the eu.* profile fails with ResourceNotFoundException, and falling back to the bare model ID fails with 'on-demand throughput isn't supported'. Route them through the global inference profile when no regional profile is available. --- crates/bedrock/src/models.rs | 29 ++++++++++++++++++++++++----- 1 file changed, 24 insertions(+), 5 deletions(-) diff --git a/crates/bedrock/src/models.rs b/crates/bedrock/src/models.rs index 57c1eea01663c2..1496d68fe2bf9e 100644 --- a/crates/bedrock/src/models.rs +++ b/crates/bedrock/src/models.rs @@ -765,11 +765,9 @@ impl Model { // EU region inference profiles ( - Self::ClaudeFable5 - | Self::ClaudeOpus4_8 + Self::ClaudeOpus4_8 | Self::ClaudeOpus4_7 | Self::ClaudeOpus4_6 - | Self::ClaudeSonnet5 | Self::ClaudeSonnet4_6 | Self::ClaudeSonnet4_5 | Self::ClaudeSonnet4 @@ -811,6 +809,11 @@ impl Model { "apac", ) => Ok(format!("{}.{}", region_group, model_id)), + // Models that require an inference profile (no on-demand direct invocation) + // and only have US and global profiles. Fall back to the global profile + // when no regional profile is available. + (Self::ClaudeFable5 | Self::ClaudeSonnet5, _) => Ok(format!("global.{}", model_id)), + // Default: use model ID directly _ => Ok(model_id.into()), } @@ -876,13 +879,29 @@ mod tests { Model::ClaudeOpus4_8.cross_region_inference_id("eu-west-1", false)?, "eu.anthropic.claude-opus-4-8" ); + Ok(()) + } + + #[test] + fn test_inference_profile_only_models_fall_back_to_global() -> anyhow::Result<()> { + // Claude Fable 5 and Claude Sonnet 5 cannot be invoked with on-demand + // throughput and only have US and global inference profiles, so regions + // without a regional profile must fall back to the global profile. assert_eq!( Model::ClaudeFable5.cross_region_inference_id("eu-west-1", false)?, - "eu.anthropic.claude-fable-5" + "global.anthropic.claude-fable-5" ); assert_eq!( Model::ClaudeSonnet5.cross_region_inference_id("eu-west-1", false)?, - "eu.anthropic.claude-sonnet-5" + "global.anthropic.claude-sonnet-5" + ); + assert_eq!( + Model::ClaudeFable5.cross_region_inference_id("ap-southeast-2", false)?, + "global.anthropic.claude-fable-5" + ); + assert_eq!( + Model::ClaudeSonnet5.cross_region_inference_id("ap-northeast-1", false)?, + "global.anthropic.claude-sonnet-5" ); Ok(()) } From cc66ee2298391599bfb499db5283a8fdea515708 Mon Sep 17 00:00:00 2001 From: Neel Date: Sat, 4 Jul 2026 13:06:50 +0100 Subject: [PATCH 2/2] fixup --- crates/bedrock/src/models.rs | 6 ------ 1 file changed, 6 deletions(-) diff --git a/crates/bedrock/src/models.rs b/crates/bedrock/src/models.rs index 1496d68fe2bf9e..ce5241a2dbb02a 100644 --- a/crates/bedrock/src/models.rs +++ b/crates/bedrock/src/models.rs @@ -809,9 +809,6 @@ impl Model { "apac", ) => Ok(format!("{}.{}", region_group, model_id)), - // Models that require an inference profile (no on-demand direct invocation) - // and only have US and global profiles. Fall back to the global profile - // when no regional profile is available. (Self::ClaudeFable5 | Self::ClaudeSonnet5, _) => Ok(format!("global.{}", model_id)), // Default: use model ID directly @@ -884,9 +881,6 @@ mod tests { #[test] fn test_inference_profile_only_models_fall_back_to_global() -> anyhow::Result<()> { - // Claude Fable 5 and Claude Sonnet 5 cannot be invoked with on-demand - // throughput and only have US and global inference profiles, so regions - // without a regional profile must fall back to the global profile. assert_eq!( Model::ClaudeFable5.cross_region_inference_id("eu-west-1", false)?, "global.anthropic.claude-fable-5"