BedrockConfig

org.llm4s.llmconnect.config.BedrockConfig
See theBedrockConfig companion object
final case class BedrockConfig(region: String, model: String, contextWindow: Int, reserveCompletion: Int, credentials: Option[BedrockCredentials], profile: Option[String], endpointUrl: Option[String], timeouts: ProviderTimeouts, network: HttpNetworkSettings) extends ProviderConfig

Configuration for the AWS Bedrock Converse API.

Authentication, in order of precedence: explicit credentials; the shared-config profile; otherwise the AWS default credential chain (environment variables, ~/.aws/credentials, EC2 instance profile, ECS task role, ...).

Build one with BedrockConfig.fromValues, which validates it and resolves contextWindow and reserveCompletion from the model registry.

Value parameters

contextWindow

Total token capacity of the model (prompt plus completion).

credentials

Explicit credentials; the default chain is used when absent.

endpointUrl

Endpoint override, e.g. a VPC endpoint or a test server.

model

Bedrock model id or inference-profile id, e.g. "anthropic.claude-3-5-sonnet-20241022-v2:0" or "us.anthropic.claude-3-5-sonnet-20241022-v2:0".

profile

AWS shared-config profile name.

region

AWS region that hosts the model, e.g. "us-east-1".

reserveCompletion

Tokens held back from prompt history for the completion.

timeouts

how long a Converse call and a ConverseStream call may take: the section's timeouts block. An absent value keeps the client's default: the AWS SDK's own for a request, and no limit for a stream (ProviderTimeouts).

Attributes

Companion
object
Source
BedrockConfig.scala
Graph
Supertypes
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all

Members list

Value members

Concrete methods

override def toString: String

Returns a string representation of the object.

Returns a string representation of the object.

The default representation is platform dependent.

Attributes

Returns

a string representation of the object.

Definition Classes
Any
Source
BedrockConfig.scala
override def withModel(model: String): BedrockConfig

The same provider and credentials, pointed at a different model.

The same provider and credentials, pointed at a different model.

Attributes

Definition Classes
Source
BedrockConfig.scala

The same config with the given proxy and TLS settings.

The same config with the given proxy and TLS settings.

The loader calls this on every config a descriptor builds, as it does withTimeouts, so a descriptor does not read the http block itself. The default returns this: a config that does not carry the setting ignores it. A config that does overrides this with its own return type.

Attributes

Definition Classes
Source
BedrockConfig.scala
override def withTimeouts(timeouts: ProviderTimeouts): BedrockConfig

The same config with the given timeouts.

The same config with the given timeouts.

The loader calls this on every config a descriptor builds, passing the section's timeouts block, so a descriptor does not read the block itself. The default returns this: a config that does not carry timeouts, such as one supplied by another module, ignores them. A config that does overrides this with its own return type.

Attributes

Definition Classes
Source
BedrockConfig.scala

Inherited methods

Where the client gets the API key it sends with each request, when not from the key this config holds: a section's apiKeyFile, or a provider set with withApiKeyProvider (#2313).

Where the client gets the API key it sends with each request, when not from the key this config holds: a section's apiKeyFile, or a provider set with withApiKeyProvider (#2313).

The default is None, and so is the value of a config that does not support a provider.

Attributes

Inherited from:
ProviderConfig
Source
ProviderConfig.scala

Attributes

Inherited from:
Product

Attributes

Inherited from:
Product

The same config, its client asking provider for the key on each request, so a rotated key is used without rebuilding the client.

The same config, its client asking provider for the key on each request, so a rotated key is used without rebuilding the client.

The loader calls this for a section that sets apiKeyFile. The default returns this: a config whose client cannot take a provider ignores it, and its apiKeyProvider stays None - which the loader reports as an error for apiKeyFile and code setting a provider should check. A config that supports it overrides this with its own return type.

Attributes

Inherited from:
ProviderConfig
Source
ProviderConfig.scala

Concrete fields

override val providerId: ProviderId

Canonical id of the provider this config addresses, e.g. ProviderId("openai").

Canonical id of the provider this config addresses, e.g. ProviderId("openai").

Attributes

Source
BedrockConfig.scala