-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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(community): Permit bedrock application inference profiles #7822
feat(community): Permit bedrock application inference profiles #7822
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
1 Skipped Deployment
|
invoke approach is complicated indeed but this patch looks hacky and like a workaround. I will see what I can do when i have time unless langchain team is okay for this patch. 🙏 |
Thanks, I think it's actually pretty clean given the meta data is parsed from the model id. All that is unavailable in the inference id arn. Curious to hear how you could do it another way with that limitation. I expect you'd need to do an intermediate lookup or supply a second field as I have. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks! Small question
For example, "arn%3Aaws%3Abedrock%3Aus-east-1%3A1234567890%3Aapplication-inference-profile%2Fabcdefghi", will override this.model in final /invoke URL call. | ||
Must still provide `model` as normal modelId to benefit from all the metadata. | ||
*/ | ||
modelAlias?: string; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we call this applicationInferenceProfile
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Works for me. Figured to make the url override generic tho application inference profile is the only use case today. I'll push the change today if y'all don't beat me to it
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@jacoblee93 ok I pushed an update to rename as suggested. Still working fine in testing in my app. Thanks!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@jacoblee93 friendly bump, hoping to stay w/ LangChain as we migrate to App Inf profiles. Gotta deliver this soon. Thanks!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Will try to get this in today thanks!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks! Though note to others who might find this that it is better to switch to Bedrock's newer Converse API instead in @langchain/aws
Does that package support App Inf profiles yet? I probably need to pitch the same PR as I use that lib for embeddings. |
Thank you! |
Fixes #7809
Bedrock Chat Model did not have a way to invoke Application Inference Profiles. Solving this was complicated at first... how do you keep all that modelId-derived metadata parsing?
So I added a
modelAlias
field that simply overridesthis.model
to be used in the /invoke URL. It expects to be URL encoded. Worked great in my local testing. You can find me on Twitter @bios_hazard