Bedrock: workaround LiteLLM passthrough issues (#6778)

Explicitly setting requestTimeout seems to be required for it to be
possible to use the Bedrock provider with LiteLLM
Bedrock passthrough.
This commit is contained in:
John Richmond 2025-08-09 11:29:18 -07:00 committed by GitHub
parent 75b861c845
commit cdc31f7c26
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -226,6 +226,11 @@ export class AwsBedrockHandler extends BaseProvider implements SingleCompletionH
// Use API key/token-based authentication if enabled and API key is set
clientConfig.token = { token: this.options.awsApiKey }
clientConfig.authSchemePreference = ["httpBearerAuth"] // Otherwise there's no end of credential problems.
clientConfig.requestHandler = {
// This should be the default anyway, but without setting something
// this provider fails to work with LiteLLM passthrough.
requestTimeout: 0,
}
} else if (this.options.awsUseProfile && this.options.awsProfile) {
// Use profile-based credentials if enabled and profile is set
clientConfig.credentials = fromIni({