aws-samples / bedrock-claude-chat

AWS-native chatbot using Bedrock + Claude (+Mistral)
MIT No Attribution
928 stars 328 forks source link

[BUG] [ThrottlingException] An error occurred while responding for Claude Sonnet 3.5 #553

Closed AdityaIndoori closed 1 month ago

AdityaIndoori commented 1 month ago

Describe the bug

Filling out this field will help us investigate the issue efficiently. Providing detailed information allows us to set the appropriate priority. We appreciate your cooperation.
Any messages I send to Claude Sonnet 3.5 get throttled and subsequently show the error in UI: "An error occurred while responding.". I see an error in Cloudwatch logs for the /aws/lambda/BedrockChatStack-WebSocketHandler logstream:

Failed to run stream handler: An error occurred (ThrottlingException) when calling the ConverseStream operation (reached max retries: 4): Too many requests, please wait before trying again.

To Reproduce

Filling out this field will help us investigate the issue efficiently. Providing detailed information allows us to set the appropriate priority. We appreciate your cooperation.
Steps to reproduce the behavior:

  1. Go to new chat
  2. Select Claude 3.5 Sonnet
  3. Send a message
  4. Expect a reply
  5. Send another message within 5 seconds after the reply
  6. See error: "An error occurred while responding."

Screenshots

image

If applicable, add screenshots to help explain your problem.

Additional context

Add any other context about the problem here.

statefb commented 1 month ago

Does it always happen? If not so, this issue is not related to this repository.

AdityaIndoori commented 1 month ago

Yes, it is a persistent issue that I am able to reproduce every time

statefb commented 1 month ago

Does it still occur when you use management console?

AdityaIndoori commented 1 month ago

Yup it does. Looks like Claude 3.5 Sonnet has provisioned throughput only in us-west-2, where as I deployed everything in us-east-1. Is there a way to use the us-west-2 sonnet 3.5 while everything is as-is in us-east-1?

statefb commented 1 month ago

See: bedrockRegion option

AdityaIndoori commented 1 month ago

Using us-west-2 solved it. Thank you!