aws-samples / aws-samples/foundational-llm-chat
Mishandling of model with single configured region
- Dominant language
- Python
- Stars
- 36
- Forks
- 11
- PR merge metrics
- No merged PRs in 30d
Description
I don't think the `else` block in the below section of Chainlit app.py is behaving as expected for users wanting to configure a single region:
https://github.com/aws-samples/foundational-llm-chat/blob/c502b461360833fa2d03f873b3a3680c4abd318d/chainlit_image/foundational-llm-chat_app/app.py#L291-L297
If the expected config for a single region is an array e.g. `"region": ["us-west-2"]`, then we should be passing `model_info["region"][0]` because [boto3 Config](https://boto3.amazonaws.com/v1/documentation/api/latest/guide/configuration.html) expects a single string not an array.
If the expected config would be `"region": "us-west-2"`, then the check will mis-behave because `len("us-west-2")` is 9. I think you'd want an explicit handler e.g. `isinstance(model_info["region"], str)`
Contributor guide
Research direction
Start with chainlit_image/foundational-llm-chat_app/app.py at lines 291-297 and compare the region handling with boto3 Config's single-string requirement. Confirm whether the configuration accepts a one-element array or a string, then verify that both the selected region and multi-region behavior are passed correctly. Done means single-region configuration no longer produces an invalid region value.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- aws, python
- Domain
- backend, cloud
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100