- 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
Parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
| id | str | "ibm/granite-20b-code-instruct" | The model ID to use |
| frequency_penalty | float | None | Penalty for using frequent tokens. Higher values discourage repetition |
| presence_penalty | float | None | Penalty for using tokens already present in the text. Higher values encourage new topics |
| max_tokens | int | None | Maximum number of tokens to generate in the response |
| temperature | float | None | Controls randomness in responses. Higher values make output more random |
| top_p | float | None | Controls diversity of responses via nucleus sampling |
| logprobs | int | None | Number of log probabilities to return |
| top_logprobs | int | None | Number of most likely tokens to return log probabilities for |
| response_format | Any | None | Format specification for the response |
| api_key | str | None | IBM WatsonX API key |
| project_id | str | None | IBM WatsonX project ID |
| url | str | "https://eu-de.ml.cloud.ibm.com" | IBM WatsonX API endpoint URL |
| verify | bool | True | Whether to verify SSL certificates |
| client_params | Dict[str, Any] | None | Additional parameters to pass to the client |
WatsonX is a subclass of the Model class and has access to the same params.