Skip to content

Conversation

christian-bromann
Copy link
Member

Add support for APAC region prefix in Bedrock models

  • Add "apac" to AWS_REGIONS list in both chat models and LLMs
  • Add comprehensive test suite for model provider detection
  • Test various regional model prefixes (eu, apac, us-gov, us)
  • Ensure proper handling of different model ID formats and providers
  • Add validation for unsupported custom model ARNs

This enables support for APAC-specific Bedrock model IDs like: apac.anthropic.claude-3-5-sonnet-20240620-v1:0

This change resolves the issue where users in APAC regions couldn't use region-specific Bedrock model identifiers. Previously, attempting to use models with the apac. prefix would result in an "Unknown model provider" error because the APAC region prefix wasn't recognized in the AWS_REGIONS configuration.

The fix includes:

  • Adding "apac" to the supported AWS regions in both BedrockChat and Bedrock LLM classes
  • Comprehensive test coverage for all regional model prefixes including edge cases
  • Validation that ensures proper error handling for unsupported custom model ARNs

Fixes #8408

- Add "apac" to AWS_REGIONS list in both chat models and LLMs
- Add comprehensive test suite for model provider detection
- Test various regional model prefixes (eu, apac, us-gov, us)
- Ensure proper handling of different model ID formats and providers
- Add validation for unsupported custom model ARNs

This enables support for APAC-specific Bedrock model IDs like:
apac.anthropic.claude-3-5-sonnet-20240620-v1:0
Copy link

vercel bot commented Jun 27, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
langchainjs-docs ✅ Ready (Inspect) Visit Preview Jun 27, 2025 5:37pm
1 Skipped Deployment
Name Status Preview Comments Updated (UTC)
langchainjs-api-refs ⬜️ Ignored (Inspect) Jun 27, 2025 5:37pm

@dosubot dosubot bot added the size:M This PR changes 30-99 lines, ignoring generated files. label Jun 27, 2025
@dosubot dosubot bot added the auto:bug Related to a bug, vulnerability, unexpected error with an existing feature label Jun 27, 2025
Copy link
Member

@hntrl hntrl left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @christian-bromann! Just one change to add Mexico to the supported regions, but otherwise LGTM

@dosubot dosubot bot added the lgtm PRs that are ready to be merged as-is label Jun 28, 2025
@hntrl hntrl merged commit 451f456 into langchain-ai:main Jun 28, 2025
32 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

auto:bug Related to a bug, vulnerability, unexpected error with an existing feature lgtm PRs that are ready to be merged as-is size:M This PR changes 30-99 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Using inferred model to Bedrock chat does not support APAC

2 participants