You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
chat-ui is excellent, thanks for all your amazing work here!
I have been experimenting with a model in Sagemaker and am having some issues with the model endpoint configuration. It currently requires credentials to be provided explicitly. This does work, but the ergonomics are not great for our use cases:
in development, my team uses AWS SSO and it would be great to use our session credentials and not need to update our MODELS environment variable manually every time our sessions refresh
in deployments, we would want to use an instance or task execution role to sign requests
const{ url, accessKey, secretKey, sessionToken, model, region, service }=
endpointAwsParametersSchema.parse(input);
constaws=newAwsClient({
accessKeyId: accessKey,
secretAccessKey: secretKey,
sessionToken,
service,
region,
});
, which uses the aws4fetch library that only support signing with explicitly passed AWS credentials.
I was able to update this area of code locally and support AWS credential resolution by switching this to use a different library aws-sigv4-fetch like so:
try{createSignedFetcher=(awaitimport("aws-sigv4-fetch")).createSignedFetcher;}catch(e){thrownewError("Failed to import aws-sigv4-fetch");}const{ url, accessKey, secretKey, sessionToken, model, region, service }=endpointAwsParametersSchema.parse(input);constsignedFetch=createSignedFetcher({
service,
region,credentials:
accessKey&&secretKey
? {accessKeyId: accessKey,secretAccessKey: secretKey, sessionToken }
: undefined,});// Replacer `aws.fetch` with `signedFetch` below when passing `fetch` to `textGenerationStream#options`
My testing has found this supports passing credentials like today, or letting the AWS SDK resolve them through the default chain.
Would you be open to a PR with this change? Or is there a different/better/more suitable way to accomplish AWS credential resolution here?
The text was updated successfully, but these errors were encountered:
Yes I think that would be a great addition, especially since it's an added feature that doesn't require breaking changes 😄 Feel free to open a PR and I'll have a look!
chat-ui is excellent, thanks for all your amazing work here!
I have been experimenting with a model in Sagemaker and am having some issues with the model endpoint configuration. It currently requires credentials to be provided explicitly. This does work, but the ergonomics are not great for our use cases:
In my investigation I found this area of code
chat-ui/src/lib/server/endpoints/aws/endpointAws.ts
Lines 22 to 37 in eb071be
aws4fetch
library that only support signing with explicitly passed AWS credentials.I was able to update this area of code locally and support AWS credential resolution by switching this to use a different library
aws-sigv4-fetch
like so:My testing has found this supports passing credentials like today, or letting the AWS SDK resolve them through the default chain.
Would you be open to a PR with this change? Or is there a different/better/more suitable way to accomplish AWS credential resolution here?
The text was updated successfully, but these errors were encountered: