Support Bedrock cross region inference #5508

Closed
opened 2026-02-21 18:11:21 -05:00 by yindo · 1 comment
Owner

Originally created by @SIN1109 on GitHub (Sep 10, 2024).

Self Checks

  • I have searched for existing issues search for existing issues, including closed ones.
  • I confirm that I am using English to submit this report (我已阅读并同意 Language Policy).
  • [FOR CHINESE USERS] 请务必使用英文提交 Issue,否则会被关闭。谢谢!:)
  • Please do not modify this template :) and fill in all the required fields.

1. Is this request related to a challenge you're experiencing? Tell me about your story.

Can you consider to support AWS bedrock cross region inference, like Claude 3.5 sonnet model
https://docs.aws.amazon.com/bedrock/latest/userguide/cross-region-inference.html

2. Additional context or comments

https://docs.aws.amazon.com/bedrock/latest/userguide/cross-region-inference.html

3. Can you help us with this feature?

  • I am interested in contributing to this feature.
Originally created by @SIN1109 on GitHub (Sep 10, 2024). ### Self Checks - [X] I have searched for existing issues [search for existing issues](https://github.com/langgenius/dify/issues), including closed ones. - [X] I confirm that I am using English to submit this report (我已阅读并同意 [Language Policy](https://github.com/langgenius/dify/issues/1542)). - [X] [FOR CHINESE USERS] 请务必使用英文提交 Issue,否则会被关闭。谢谢!:) - [X] Please do not modify this template :) and fill in all the required fields. ### 1. Is this request related to a challenge you're experiencing? Tell me about your story. Can you consider to support AWS bedrock cross region inference, like Claude 3.5 sonnet model https://docs.aws.amazon.com/bedrock/latest/userguide/cross-region-inference.html ### 2. Additional context or comments https://docs.aws.amazon.com/bedrock/latest/userguide/cross-region-inference.html ### 3. Can you help us with this feature? - [ ] I am interested in contributing to this feature.
yindo added the 💪 enhancement label 2026-02-21 18:11:21 -05:00
yindo closed this issue 2026-02-21 18:11:21 -05:00
Author
Owner

@dosubot[bot] commented on GitHub (Sep 10, 2024):

Dify currently supports AWS Bedrock as one of the Model-as-a-Service (MaaS) vendors, including the ability to specify the AWS region for model inference. However, there is no specific documentation or code available in the repository that outlines how to set up cross-region inference for AWS Bedrock models.

To support cross-region inference, you would need to configure the region_name in the Config object when setting up the Bedrock runtime client. Here is an example of how this can be done:

from botocore.config import Config
import boto3

client_config = Config(
    region_name='us-west-2'  # Specify the desired AWS region
)

bedrock_runtime = boto3.client(
    service_name='bedrock-runtime',
    config=client_config,
    aws_access_key_id='your_access_key',
    aws_secret_access_key='your_secret_access_key'
)

This configuration ensures that the Bedrock runtime client operates in the specified AWS region, which is crucial for cross-region inference [1].

For more detailed steps on deploying and configuring cross-region inference, you can refer to the AWS Bedrock documentation.

To continue talking to Dosu, mention @dosu.

@dosubot[bot] commented on GitHub (Sep 10, 2024): <!-- Answer --> Dify currently supports AWS Bedrock as one of the Model-as-a-Service (MaaS) vendors, including the ability to specify the AWS region for model inference. However, there is no specific documentation or code available in the repository that outlines how to set up cross-region inference for AWS Bedrock models. To support cross-region inference, you would need to configure the `region_name` in the `Config` object when setting up the Bedrock runtime client. Here is an example of how this can be done: ```python from botocore.config import Config import boto3 client_config = Config( region_name='us-west-2' # Specify the desired AWS region ) bedrock_runtime = boto3.client( service_name='bedrock-runtime', config=client_config, aws_access_key_id='your_access_key', aws_secret_access_key='your_secret_access_key' ) ``` This configuration ensures that the Bedrock runtime client operates in the specified AWS region, which is crucial for cross-region inference <sup>[[1]](https://github.com/langgenius/dify/blob/main/api/core/model_runtime/model_providers/bedrock/llm/llm.py)</sup>. For more detailed steps on deploying and configuring cross-region inference, you can refer to the [AWS Bedrock documentation](https://docs.aws.amazon.com/bedrock/latest/userguide/cross-region-inference.html). <!-- Dosu Comment Footer --> *To continue talking to [Dosu](https://dosu.dev), mention @dosu.*
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: langgenius/dify#5508