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

feat: added support for A21 and Amazon Titan models via bedrock api #1101

Merged
merged 8 commits into from
Sep 17, 2024

Conversation

awsyshah
Copy link
Contributor

@awsyshah awsyshah commented May 8, 2024

Closes #1076

📑 Description

Included support for A21 & Amazon Titan Model through the bedrock api, using a case structure to enable future flexibility to continue adding other models available. As Bedrock supports quite a few models not adding them all in a single merge.

✅ Checks

  • My pull request adheres to the code style of this project
  • My code requires changes to the documentation
  • I have updated the documentation as required
  • All the tests have passed

ℹ Additional Information

Signed-off-by: Yomesh Shah <yomesh@gmail.com>
@awsyshah awsyshah requested review from a team as code owners May 8, 2024 14:27
pkg/ai/amazonbedrock.go Outdated Show resolved Hide resolved
pkg/ai/amazonbedrock.go Show resolved Hide resolved
Signed-off-by: Yomesh Shah <yomesh@gmail.com>
Signed-off-by: Yomesh Shah <yomesh@gmail.com>
@awsyshah
Copy link
Contributor Author

@AlexsJones did you get a chance to review this for the changes and if it is ok to merge now ?

@AlexsJones
Copy link
Member

I need to test it first, will try to get around to it ASAP

@awsyshah
Copy link
Contributor Author

I need to test it first, will try to get around to it ASAP

@AlexsJones just adding some screenshots of the runs if that helps.

image

image

image

@lenaxia
Copy link

lenaxia commented Jun 26, 2024

If you're looking for a workaround, would suggest using LiteLLM to proxy Bedrock

Copy link
Contributor

@JuHyung-Son JuHyung-Son left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

good start! i left some comments

pkg/ai/amazonbedrock.go Outdated Show resolved Hide resolved
pkg/ai/amazonbedrock.go Show resolved Hide resolved
pkg/ai/amazonbedrock.go Show resolved Hide resolved
@AlexsJones
Copy link
Member

Can you respond to comments and we will merge this next week @awsyshah ?

@awsyshah
Copy link
Contributor Author

made the key suggest improvement of moving some of the constants to config. The other vars are as per the API or not need outside of the case and hence declared within it. Please review.

@JuHyung-Son
Copy link
Contributor

comments are not fixed

@awsyshah
Copy link
Contributor Author

comments are not fixed

Hi @JuHyung-Son ,

Sorry for the trouble there, can I request which are the specific ones you want changed.

The first action of moving the constants like maxTokens to config is done right ? or is my understanding / implementation incorrect ?

For Comment 2 , the stop_reason , that call used is as per the documentation from :https://docs.aws.amazon.com/bedrock/latest/userguide/model-parameters-anthropic-claude-messages.html

For Comment 3: The type you have commented on is only used once and that is if it is a a21 model so its defined within the area so as its only ever used there. The rest of the code has not use of it , is it still better to just define it up top even is only ever to be used if the model is one of the A21 one and may not be used otherwise ?

Let me know and I will make the changes so we can have this merged.

Thanks

Copy link
Contributor

@JuHyung-Son JuHyung-Son left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i got it.
LGTM!

@AlexsJones AlexsJones enabled auto-merge (squash) September 2, 2024 06:48
@AlexsJones AlexsJones merged commit 4f3ecf0 into k8sgpt-ai:main Sep 17, 2024
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

[Question]: Integration with Amazon bedrock issue
4 participants