- We recommend using
meta-llama/llama-3-3-70b-instructfor general use - We recommend
ibm/granite-20b-code-instructfor code-related tasks - We recommend using
meta-llama/llama-3-2-11b-vision-instructfor image understanding
Multimodal Support
With WatsonX we supportImage as input
Authentication
Set yourIBM_WATSONX_API_KEY and IBM_WATSONX_PROJECT_ID environment variables. Get your credentials from IBM Cloud.
You can also set the IBM_WATSONX_URL environment variable to the URL of the WatsonX API you want to use. It defaults to https://eu-de.ml.cloud.ibm.com.
Example
UseWatsonX with your Agent:
View more examples here.
Params
| Parameter | Type | Default | Description |
|---|---|---|---|
id | str | "ibm/granite-13b-chat-v2" | The id of the IBM watsonx model to use |
name | str | "IBMWatsonx" | The name of the model |
provider | str | "IBMWatsonx" | The provider of the model |
api_key | Optional[str] | None | The API key for IBM watsonx (defaults to WATSONX_API_KEY env var) |
url | Optional[str] | None | The URL for the IBM watsonx service |
project_id | Optional[str] | None | The project ID for IBM watsonx |
space_id | Optional[str] | None | The space ID for IBM watsonx |
deployment_id | Optional[str] | None | The deployment ID for custom deployments |
params | Optional[Dict[str, Any]] | None | Additional generation parameters (temperature, max_new_tokens, etc.) |
WatsonX is a subclass of the Model class and has access to the same params.