Skip to content

feat: add script for troubleshooting bedrock

Manoj M J requested to merge mmj-bedrock into main

What does this merge request do and why?

IMPORTANT: Dependant on the changes in feat: fixes self-provided claude_3 prompt (!1444 - merged)

Why?

For gitlab-org/gitlab#495057 (closed)

Now that we are providing support for Bedrock as a provider, it is necessary to verify that the connection to Bedrock is authenticated successfully during the troubleshooting process:

For this, we extend the troubleshooting script in this MR, such that:

  • We verify that the ENV variables required for Bedrock, ie, AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY, AWS_REGION_NAME are present.
  • We also trigger a request to Bedrock to authenticate that the credentials set in the above ENV variables are indeed valid.

Screenshots

Scenario Screenshot
When the ENV variables are set correctly, and the credentials can be authenticated Screenshot_2024-10-11_at_12.42.08_PM
When any ENV variable is missing Screenshot_2024-10-11_at_1.11.06_PM
When all ENV variables are set, but the credentials that are set are invalid Screenshot_2024-10-11_at_1.12.08_PM

Usage

Locally, with all the required variables set on my terminal window:

poetry run scripts/troubleshoot_selfhosted_installation.py --model-name claude_3 --model-identifier bedrock/anthropic.claude-3-5-sonnet-20240620-v1:0

Required variables are: AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY, AWS_REGION_NAME, AIGW_CUSTOM_MODELS__ENABLED: true, AIGW_AUTH__BYPASS_EXTERNAL: true

How to set up and validate locally

Numbered steps to set up and validate the change are strongly suggested.

Merge request checklist

  • Tests added for new functionality. If not, please raise an issue to follow up.
  • Documentation added/updated, if needed.
Edited by Manoj M J

Merge request reports

Loading