Skip to content

fix(anthropic): don't double-prefix Bedrock cross-region inference profile model IDs - #3

Open
aldouus wants to merge 1 commit into
taigrr:mainfrom
aldouus:fix/bedrock-inference-profile-prefix
Open

aldouus wants to merge 1 commit into
taigrr:mainfrom
aldouus:fix/bedrock-inference-profile-prefix

Conversation

@aldouus

@aldouus aldouus commented Sep 2, 2026

Copy link
Copy Markdown

Summary

  • bedrockPrefixModelWithRegion only skipped prefixing when the model ID already started with the caller region's two-letter prefix. Any other valid Bedrock cross-region inference profile got mangled: global.anthropic.claude-fable-5-1 in us-east-1 became us.global.anthropic.claude-fable-5-1, and apac.anthropic.* in ap-southeast-2 became ap.apac.anthropic.*.
  • Now any ID already carrying a known inference profile prefix (global., us., us-gov., eu., apac., ap., jp., au., ca., sa., il., mx.) is passed through untouched; bare anthropic.* IDs still get the region prefix.
  • Motivation: Claude Fable 5.1 ships on Bedrock as both us.anthropic.claude-fable-5-1 (Geo CRIS) and global.anthropic.claude-fable-5-1 (Global CRIS). The latter is unusable without this fix.

Test plan

  • New TestBedrockPrefixModelWithRegion covers bare IDs, matching geo, cross-geo, global., and apac.
  • go test -tags http2legacy ./providers/anthropic/

Note: -tags http2legacy is needed on Go 1.27 because golang.org/x/net/http2 is excluded there (errors.go references http2.GoAwayError). That build failure exists on main independent of this change.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant