WatsonXConfig

org.llm4s.llmconnect.config.WatsonXConfig
See theWatsonXConfig companion object
final case class WatsonXConfig(apiKey: String, projectId: String, spaceId: Option[String], model: String, baseUrl: String, apiVersion: String, iamUrl: String, contextWindow: Int, reserveCompletion: Int) extends ProviderConfig

Configuration for IBM watsonx.ai.

watsonx.ai hosts IBM Granite, Llama, Mistral and other models behind a governed API. Auth is IBM Cloud IAM: the apiKey is exchanged for a short-lived bearer token. Inference runs in a project (projectId) or a deployment space (spaceId); setting both is rejected. Prefer WatsonXConfig.fromValues over the primary constructor.

Value parameters

apiKey

IBM Cloud API key exchanged for IAM bearer tokens; redacted in toString.

apiVersion

watsonx API version date, e.g. "2024-05-31".

baseUrl

watsonx.ai ML API base URL, e.g. "https://us-south.ml.cloud.ibm.com".

contextWindow

Model's total token capacity (prompt + completion combined).

iamUrl

IBM Cloud IAM token endpoint.

model

Model identifier, e.g. "ibm/granite-13b-instruct-v2".

projectId

watsonx project ID; may be empty only when spaceId is set.

reserveCompletion

Tokens held back from prompt history for the completion.

spaceId

Optional watsonx deployment space ID, used in place of the project (never together with it).

Attributes

Companion
object
Graph
Supertypes
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all

Members list

Value members

Concrete methods

override def endpointUrl: Option[String]

The endpoint this config will contact, when it is known statically.

The endpoint this config will contact, when it is known statically.

Used by policy checks and diagnostics that need to know where traffic will go without knowing which provider it belongs to. None means the config carries no single URL — not that it makes no network calls.

Attributes

Definition Classes
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
override def withModel(model: String): WatsonXConfig

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

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

Attributes

Definition Classes

Inherited methods

def productElementNames: Iterator[String]

Attributes

Inherited from:
Product
def productIterator: Iterator[Any]

Attributes

Inherited from:
Product

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