IBM WatsonX

Configuration reference for WatsonX, which connects to IBM's foundation models through the ibm-watsonx-ai client.

The IBM WatsonX model provides access to IBM's language models.

The v3.0.4 default, ibm/granite-20b-code-instruct, has been withdrawn from multitenant watsonx.ai. Set id to a model available in your deployment. See IBM model lifecycle updates.

Parameters

ParameterTypeDefaultDescription
idstr"ibm/granite-20b-code-instruct"The id of the IBM WatsonX model to use
namestr"WatsonX"The name of the model
providerstr"IBM"The provider of the model
frequency_penaltyOptional[float]NonePenalizes new tokens based on their frequency in the text so far
presence_penaltyOptional[float]NonePenalizes new tokens based on whether they appear in the text so far
max_tokensOptional[int]NoneMaximum number of tokens to generate
temperatureOptional[float]NoneControls randomness in the model's output
top_pOptional[float]NoneControls diversity via nucleus sampling
logprobsOptional[int]NoneReturn log probabilities of the output tokens
top_logprobsOptional[int]NoneNumber of most likely tokens to return log probabilities for
request_paramsOptional[Dict[str, Any]]NoneAdditional parameters to include in the request
api_keyOptional[str]NoneThe API key for IBM WatsonX (defaults to IBM_WATSONX_API_KEY env var)
project_idOptional[str]NoneThe project ID for IBM WatsonX (defaults to IBM_WATSONX_PROJECT_ID env var)
urlOptional[str]"https://eu-de.ml.cloud.ibm.com"The WatsonX endpoint URL (IBM_WATSONX_URL env var takes precedence)
verifyboolTrueVerify TLS certificates when connecting
client_paramsOptional[Dict[str, Any]]NoneDeclared client parameters. Agno v3.0.4 does not pass this field to ModelInference; provide model_client for custom client configuration
model_clientOptional[ModelInference]NonePre-configured WatsonX ModelInference client
model_typeModelTypeModelType.MODELFunctional role of this model (e.g. MODEL, OUTPUT_MODEL, PARSER_MODEL). Set by the agent
supports_native_structured_outputsboolFalseWhether the model supports structured outputs natively
supports_json_schema_outputsboolFalseWhether the model uses JSON schema for structured outputs
system_promptOptional[str]NoneSystem prompt from the model added to the agent
instructionsOptional[List[str]]NoneInstructions from the model added to the agent
tool_message_rolestr"tool"Role of tool messages
assistant_message_rolestr"assistant"Role of assistant messages
cache_responseboolFalseCache model responses to avoid redundant API calls during development
cache_ttlOptional[int]NoneTime-to-live for cached responses, in seconds
cache_dirOptional[str]NoneDirectory for the response cache. Defaults to ~/.agno/cache/model_responses
retriesint0Number of retries to attempt before raising a ModelProviderError
delay_between_retriesint1Delay between retries, in seconds
exponential_backoffboolFalseIf True, the delay between retries is doubled each time
retry_with_guidanceboolTrueRetry a failed model invocation once with a guidance message appended
retry_with_guidance_limitint1Number of times to retry the model invocation with guidance