Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Automatically use cross-region inference on supported models in Amazon Bedrock #1113

Closed
wants to merge 4 commits into from

Conversation

srdas
Copy link
Collaborator

@srdas srdas commented Nov 20, 2024

Description

This PR automatically uses cross-region inference (CRI) on all models supporting CRI on Amazon Bedrock. To do so, the BedrockChat provider maintains a list of all models which support CRI in the us region area, and automatically prepends us. to the model ID internally.

Testing instructions

  • Clone this branch and comment out this section in aws.py:
        if model_id in self.cri_models:
            model_id = "us." + model_id
  • Send a message Llama 3.2 on Bedrock, and verify the request fails with the exception:
    ValueError: Error raised by bedrock service: An error occurred (ValidationException) when calling the InvokeModelWithResponseStream operation: Invocation of model ID meta.llama3-2-3b-instruct-v1:0 with on-demand throughput isn’t supported. Retry your request with the ID or ARN of an inference profile that contains this model.
    
  • Uncomment the aforementioned section and restart Jupyter AI.
  • Send another message to Llama 3.2 on Bedrock, and verify the request succeeds.

Demo

Screen.Recording.2024-11-25.at.10.42.13.AM.mov

@srdas srdas added the enhancement New feature or request label Nov 20, 2024
@srdas srdas assigned srdas and dlqqq Nov 20, 2024
@dlqqq dlqqq changed the title Add Cross-Region Inference for Bedrock Chat Models Automatically use cross-region inference on supported models and add Llama 3.2 on Amazon Bedrock Nov 25, 2024
@dlqqq dlqqq changed the title Automatically use cross-region inference on supported models and add Llama 3.2 on Amazon Bedrock Automatically use cross-region inference on supported models in Amazon Bedrock Nov 25, 2024
@dlqqq
Copy link
Member

dlqqq commented Nov 25, 2024

Implemented automatic CRI as recommended by latest comment in #1114. Updated the description of this PR accordingly.

@dlqqq dlqqq marked this pull request as ready for review November 25, 2024 18:43
@dlqqq
Copy link
Member

dlqqq commented Nov 25, 2024

Closing this PR, as we cannot default to the US region area due to data residency restrictions set by GDPR in the EU. See #1114 for additional context.

@dlqqq dlqqq closed this Nov 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Support cross-region inference for Amazon Bedrock
2 participants