WatsonXProvider
Registration for IBM watsonx.ai.
'''Beta - never run against the live service.''' The client calls the watsonx.ai chat API (/ml/v1/text/chat and /ml/v1/text/chat_stream), with tool calling; its request and response shapes are cross-checked against IBM's own open-source clients but have not been checked against a real account (https://github.com/llm4s/llm4s/issues/1314). The module's API is not frozen.
A section names the model and the projectId (or spaceId) inference runs in, and takes the IBM Cloud API key as apiKey - or from llm4s.credentials.watsonx.apiKey, which WATSONX_API_KEY binds. baseUrl selects the region and defaults to Dallas (us-south).
watsonx-main {
provider = "watsonx"
model = "ibm/granite-4-h-small"
projectId = ${?WATSONX_PROJECT_ID}
}
Attributes
- Source
- WatsonXProvider.scala
- Graph
-
- Supertypes
- Self type
-
WatsonXProvider.type
Members list
Value members
Concrete methods
Constructs the client for a ProviderConfig this provider produced.
Constructs the client for a ProviderConfig this provider produced.
config is whatever the caller passed, so implementations must check the type rather than cast — ProviderDescriptor.expectConfig does that and produces the standard mismatch error.
A client that sends its own HTTP requests sends them through options.httpClient when it is set, and does not close that client, and declares so with features.customHttpClient = true (it defaults to false, which a provider built on a vendor SDK keeps).
Attributes
- Source
- WatsonXProvider.scala
Turns a validated config section into the runtime ProviderConfig for this provider.
Turns a validated config section into the runtime ProviderConfig for this provider.
The section has already been checked against configSpec, so required fields are present and section.extras holds exactly the declared provider-specific keys that have a value (defaults applied, deprecated aliases resolved). A Left here means something configSpec cannot express (a malformed value, say).
Value parameters
- providerName
-
the user's instance name (
llm4s.providers.<name>), for error messages.
Attributes
- Source
- WatsonXProvider.scala
Sends its requests through LlmClientOptions.httpClient when one is supplied (#2341).
Sends its requests through LlmClientOptions.httpClient when one is supplied (#2341).
Attributes
- Definition Classes
- Source
- WatsonXProvider.scala
Inherited methods
Alternative spellings accepted in provider = "...", folded onto id.
Alternative spellings accepted in provider = "...", folded onto id.
For example Gemini accepts "google". Aliases are matched after the same trim/lowercase canonicalisation as id itself.
Attributes
- Inherited from:
- ProviderDescriptor
- Source
- ProviderDescriptor.scala
Live model discovery, when the provider's API offers it.
Live model discovery, when the provider's API offers it.
Attributes
- Inherited from:
- ProviderDescriptor
- Source
- ProviderDescriptor.scala
Concrete fields
The key giving the watsonx API version date.
The key giving the IAM token endpoint.
The key naming the watsonx project.
The key naming a watsonx deployment space, used instead of a project.
The key naming a watsonx deployment space, used instead of a project.
Attributes
- Source
- WatsonXProvider.scala
Which config fields this provider requires, its default endpoint, and the provider-specific keys (ProviderConfigSpec.extras) its section accepts.
Which config fields this provider requires, its default endpoint, and the provider-specific keys (ProviderConfigSpec.extras) its section accepts.
Attributes
- Source
- WatsonXProvider.scala
Canonical id, e.g. ProviderId("openai"). Must be unique within a registry.
Canonical id, e.g. ProviderId("openai"). Must be unique within a registry.
Attributes
- Source
- WatsonXProvider.scala
