IBM watsonx.ai Embedding and Scoring Models

IBM watsonx.ai provides embedding models that turn text into vector representations and scoring models that rank a set of documents by their relevance to a query.

This extension supports IBM watsonx as a service on IBM Cloud only.

Prerequisites

To use watsonx.ai models, configure the following required values in your application.properties file:

Base URL

The base-url depends on the region of your service instance:

quarkus.langchain4j.watsonx.base-url=https://us-south.ml.cloud.ibm.com

Project ID

Obtain the Project Id via:

quarkus.langchain4j.watsonx.project-id=23d...
You may use the optional space-id as an alternative.

API Key

Create an API key by visiting https://cloud.ibm.com/iam/apikeys and clicking Create +.

quarkus.langchain4j.watsonx.api-key=your-api-key
You can also use the QUARKUS_LANGCHAIN4J_WATSONX_API_KEY environment variable.

Dependency

Add the following dependency to your project:

<dependency>
  <groupId>io.quarkiverse.langchain4j</groupId>
  <artifactId>quarkus-langchain4j-watsonx</artifactId>
  <version>1.13.0</version>
</dependency>

Even better, if you use the Quarkus platform BOM (default for projects generated), add the Quarkus Langchain4J BOM and all dependency versions will align:

    <dependencyManagement>
        <dependencies>
            <dependency>
                <groupId>${quarkus.platform.group-id}</groupId>
                <artifactId>${quarkus.platform.artifact-id}</artifactId>
                <version>${quarkus.platform.version}</version>
                <type>pom</type>
                <scope>import</scope>
            </dependency>
            <dependency>
                <groupId>${quarkus.platform.group-id}</groupId>
                <artifactId>quarkus-langchain4j-bom</artifactId> (1)
                <version>${quarkus.platform.version}</version> (2)
                <type>pom</type>
                <scope>import</scope>
            </dependency>
        </dependencies>
    </dependencyManagement>

    <dependencies>
      <dependency>
        <groupId>io.quarkiverse.langchain4j</groupId>
        <artifactId>quarkus-langchain4j-watsonx</artifactId>
        (3)
      </dependency>
    </dependencies>
1 In your dependencyManagement section, add the quarkus-langchain4j-bom
2 Inherit the version from your platform version
3 Voilà, no need for version alignment anymore

Embedding Model

IBM watsonx.ai provides multiple embedding models for converting text into vector representations suitable for semantic search, RAG pipelines, similarity comparison, and vector database integrations.

Quarkus integrates the LangChain4j WatsonxEmbeddingModel, exposing it as EmbeddingModel bean.

The list of supported embedding models is available in the watsonx.ai documentation.

Configuration

Configure the embedding model by specifying its model name in application.properties.

# Base Watsonx configuration
quarkus.langchain4j.watsonx.base-url=${BASE_URL}
quarkus.langchain4j.watsonx.api-key=${API_KEY}
quarkus.langchain4j.watsonx.project-id=${PROJECT_ID}

# Embedding model configuration
quarkus.langchain4j.watsonx.embedding-model.model-name=ibm/slate-125m-english-rtrvr

If an embedding model is configured, Quarkus will automatically create and register a EmbeddingModel bean.

Injection

@Inject
EmbeddingModel embeddingModel;

Usage

To generate the embedding of a single text, use embed.

var response = embeddingModel.embed("Hello Watsonx!");

assertNotNull(response);
var embedding = response.content();

System.out.println("Embedding size: " + embedding.vector().length());

To embed more than one text segment at a time, use embedAll.

var embeddings = embeddingModel.embedAll(
    List.of(
        TextSegment.from("First document"),
        TextSegment.from("Second document")
    )
);

Scoring Model

IBM watsonx.ai provides scoring (reranking) models that evaluate the relevance between a query and a piece of text. Quarkus integrates the LangChain4j WatsonxScoringModel, exposing it as ScoringModel implementation.

Scoring models are especially useful for RAG pipelines, document ranking, and semantic relevance evaluation.

The list of supported scoring models is available in the watsonx.ai documentation.

Configuration

Configure the model by specifying its name in application.properties.

# Base Watsonx configuration
quarkus.langchain4j.watsonx.base-url=${BASE_URL}
quarkus.langchain4j.watsonx.api-key=${API_KEY}
quarkus.langchain4j.watsonx.project-id=${PROJECT_ID}

# Scoring model configuration
quarkus.langchain4j.watsonx.scoring-model.model-name=cross-encoder/ms-marco-minilm-l-12-v2

If a scoring model is configured, Quarkus will automatically create and register a ScoringModel bean.

Injection

@Inject
ScoringModel scoringModel;

Usage

To score a single text against a query, use score.

var response = scoringModel.score("Rerank this!", "Test to rerank 1");

assertNotNull(response);
assertNotNull(response.content());

double score = response.content();
System.out.println("Score: " + score);

To score more than one document at a time, use scoreAll.

var scores = scoringModel.scoreAll(
    List.of(
        TextSegment.from("Document A"),
        TextSegment.from("Document B")
    ),
    "User query"
);

System.out.println(scores); // list of relevance scores

Configuration

Configuration property fixed at build time - All other configuration properties are overridable at runtime

Configuration property

Type

Default

Whether the model should be enabled.

Environment variable: QUARKUS_LANGCHAIN4J_WATSONX_CHAT_MODEL_ENABLED

boolean

true

Whether the embedding model should be enabled.

Environment variable: QUARKUS_LANGCHAIN4J_WATSONX_EMBEDDING_MODEL_ENABLED

boolean

true

Whether the scoring model should be enabled.

Environment variable: QUARKUS_LANGCHAIN4J_WATSONX_SCORING_MODEL_ENABLED

boolean

true

Whether the moderation model should be enabled.

Environment variable: QUARKUS_LANGCHAIN4J_WATSONX_MODERATION_MODEL_ENABLED

boolean

true

Specifies the base URL of the watsonx.ai API.

A list of all available URLs is provided in the IBM Watsonx.ai documentation at the this link.

Environment variable: QUARKUS_LANGCHAIN4J_WATSONX_BASE_URL

string

IBM Cloud API key.

Environment variable: QUARKUS_LANGCHAIN4J_WATSONX_API_KEY

string

Timeout for watsonx.ai calls.

Environment variable: QUARKUS_LANGCHAIN4J_WATSONX_TIMEOUT

Duration 

60s

The version date for the API of the form YYYY-MM-DD.

Environment variable: QUARKUS_LANGCHAIN4J_WATSONX_VERSION

string

The space that contains the resource.

Either space_id or project_id has to be given.

Environment variable: QUARKUS_LANGCHAIN4J_WATSONX_SPACE_ID

string

The project that contains the resource.

Either space_id or project_id has to be given.

Environment variable: QUARKUS_LANGCHAIN4J_WATSONX_PROJECT_ID

string

Whether the watsonx.ai client should log requests.

Environment variable: QUARKUS_LANGCHAIN4J_WATSONX_LOG_REQUESTS

boolean

false

Whether the watsonx.ai client should log responses.

Environment variable: QUARKUS_LANGCHAIN4J_WATSONX_LOG_RESPONSES

boolean

false

Whether the watsonx.ai client should log requests as cURL commands.

Environment variable: QUARKUS_LANGCHAIN4J_WATSONX_LOG_REQUESTS_CURL

boolean

false

Whether to enable the integration. Defaults to true, which means requests are made to the watsonx.ai provider. Set to false to disable all requests.

Environment variable: QUARKUS_LANGCHAIN4J_WATSONX_ENABLE_INTEGRATION

boolean

true

Base URL of the IAM Authentication API.

Environment variable: QUARKUS_LANGCHAIN4J_WATSONX_IAM_BASE_URL

URI

Timeout for IAM authentication calls.

Environment variable: QUARKUS_LANGCHAIN4J_WATSONX_IAM_TIMEOUT

Duration 

10s

Grant type for the IAM Authentication API.

Environment variable: QUARKUS_LANGCHAIN4J_WATSONX_IAM_GRANT_TYPE

string

Base URL of the Cloud Object Storage API.

Environment variable: QUARKUS_LANGCHAIN4J_WATSONX_TEXT_EXTRACTION_COS_URL

string

required

The id of the connection asset that contains the credentials required to access the data.

Environment variable: QUARKUS_LANGCHAIN4J_WATSONX_TEXT_EXTRACTION_DOCUMENT_REFERENCE_CONNECTION

string

required

The name of the bucket containing the input document.

Environment variable: QUARKUS_LANGCHAIN4J_WATSONX_TEXT_EXTRACTION_DOCUMENT_REFERENCE_BUCKET_NAME

string

required

The id of the connection asset used to store the extracted results.

Environment variable: QUARKUS_LANGCHAIN4J_WATSONX_TEXT_EXTRACTION_RESULTS_REFERENCE_CONNECTION

string

required

The name of the bucket where the output files will be written.

Environment variable: QUARKUS_LANGCHAIN4J_WATSONX_TEXT_EXTRACTION_RESULTS_REFERENCE_BUCKET_NAME

string

required

Whether text extraction requests should be logged.

Environment variable: QUARKUS_LANGCHAIN4J_WATSONX_TEXT_EXTRACTION_LOG_REQUESTS

boolean

false

Whether text extraction responses should be logged.

Environment variable: QUARKUS_LANGCHAIN4J_WATSONX_TEXT_EXTRACTION_LOG_RESPONSES

boolean

false

Whether the watsonx.ai client should log requests as cURL commands.

Environment variable: QUARKUS_LANGCHAIN4J_WATSONX_TEXT_EXTRACTION_LOG_REQUESTS_CURL

boolean

false

Base URL of the Cloud Object Storage API.

Environment variable: QUARKUS_LANGCHAIN4J_WATSONX_TEXT_CLASSIFICATION_COS_URL

string

required

The id of the connection asset that contains the credentials required to access the data.

Environment variable: QUARKUS_LANGCHAIN4J_WATSONX_TEXT_CLASSIFICATION_DOCUMENT_REFERENCE_CONNECTION

string

required

The name of the bucket containing the input document.

Environment variable: QUARKUS_LANGCHAIN4J_WATSONX_TEXT_CLASSIFICATION_DOCUMENT_REFERENCE_BUCKET_NAME

string

required

Whether text extraction requests should be logged.

Environment variable: QUARKUS_LANGCHAIN4J_WATSONX_TEXT_CLASSIFICATION_LOG_REQUESTS

boolean

false

Whether text extraction responses should be logged.

Environment variable: QUARKUS_LANGCHAIN4J_WATSONX_TEXT_CLASSIFICATION_LOG_RESPONSES

boolean

false

Whether the watsonx.ai client should log requests as cURL commands.

Environment variable: QUARKUS_LANGCHAIN4J_WATSONX_TEXT_CLASSIFICATION_LOG_REQUESTS_CURL

boolean

false

Base URL of the Cloud Object Storage API.

Environment variable: QUARKUS_LANGCHAIN4J_WATSONX_SCHEMA_CREATE_COS_URL

string

required

The id of the connection asset that contains the credentials required to access the data.

Environment variable: QUARKUS_LANGCHAIN4J_WATSONX_SCHEMA_CREATE_DOCUMENT_REFERENCE_CONNECTION

string

required

The name of the bucket containing the input document.

Environment variable: QUARKUS_LANGCHAIN4J_WATSONX_SCHEMA_CREATE_DOCUMENT_REFERENCE_BUCKET_NAME

string

required

Whether create schema requests should be logged.

Environment variable: QUARKUS_LANGCHAIN4J_WATSONX_SCHEMA_CREATE_LOG_REQUESTS

boolean

false

Whether create schema responses should be logged.

Environment variable: QUARKUS_LANGCHAIN4J_WATSONX_SCHEMA_CREATE_LOG_RESPONSES

boolean

false

Whether the watsonx.ai client should log requests as cURL commands.

Environment variable: QUARKUS_LANGCHAIN4J_WATSONX_SCHEMA_CREATE_LOG_REQUESTS_CURL

boolean

false

Whether improve schema requests should be logged.

Environment variable: QUARKUS_LANGCHAIN4J_WATSONX_SCHEMA_IMPROVE_LOG_REQUESTS

boolean

false

Whether improve schema responses should be logged.

Environment variable: QUARKUS_LANGCHAIN4J_WATSONX_SCHEMA_IMPROVE_LOG_RESPONSES

boolean

false

Whether the watsonx.ai client should log requests as cURL commands.

Environment variable: QUARKUS_LANGCHAIN4J_WATSONX_SCHEMA_IMPROVE_LOG_REQUESTS_CURL

boolean

false

Whether merge schema requests should be logged.

Environment variable: QUARKUS_LANGCHAIN4J_WATSONX_SCHEMA_MERGE_LOG_REQUESTS

boolean

false

Whether merge schema responses should be logged.

Environment variable: QUARKUS_LANGCHAIN4J_WATSONX_SCHEMA_MERGE_LOG_RESPONSES

boolean

false

Whether the watsonx.ai client should log requests as cURL commands.

Environment variable: QUARKUS_LANGCHAIN4J_WATSONX_SCHEMA_MERGE_LOG_REQUESTS_CURL

boolean

false

Whether cluster schema requests should be logged.

Environment variable: QUARKUS_LANGCHAIN4J_WATSONX_SCHEMA_CLUSTER_LOG_REQUESTS

boolean

false

Whether cluster schema responses should be logged.

Environment variable: QUARKUS_LANGCHAIN4J_WATSONX_SCHEMA_CLUSTER_LOG_RESPONSES

boolean

false

Whether the watsonx.ai client should log requests as cURL commands.

Environment variable: QUARKUS_LANGCHAIN4J_WATSONX_SCHEMA_CLUSTER_LOG_REQUESTS_CURL

boolean

false

Specifies how the model should choose which tool to call during a request.

This value can be:

  • auto: The model decides whether and which tool to call automatically.

  • required: The model must call one of the available tools.

If toolChoiceName is set, this value is ignored.

Setting this value influences the tool-calling behavior of the model when no specific tool is required.

Environment variable: QUARKUS_LANGCHAIN4J_WATSONX_CHAT_MODEL_TOOL_CHOICE

auto, required, none

Specifies the name of a specific tool that the model must call.

When set, the model will be forced to call the specified tool. The name must exactly match one of the available tools defined for the service.

Environment variable: QUARKUS_LANGCHAIN4J_WATSONX_CHAT_MODEL_TOOL_CHOICE_NAME

string

Positive values penalize new tokens based on their existing frequency in the generated text, reducing the likelihood of the model repeating the same lines verbatim.

The parameter is sent to the model only when it is set.

Possible values: -2 < value < 2

Environment variable: QUARKUS_LANGCHAIN4J_WATSONX_CHAT_MODEL_FREQUENCY_PENALTY

double

Specifies whether to return the log probabilities of the output tokens.

If set to true, the response will include the log probability of each output token in the content of the message.

The parameter is sent to the model only when it is set.

Environment variable: QUARKUS_LANGCHAIN4J_WATSONX_CHAT_MODEL_LOGPROBS

boolean

An integer specifying the number of most likely tokens to return at each token position, each with an associated log probability. The option logprobs must be set to true if this parameter is used.

Possible values: 0 ≤ value ≤ 20

Environment variable: QUARKUS_LANGCHAIN4J_WATSONX_CHAT_MODEL_TOP_LOGPROBS

int

The maximum number of tokens that can be generated in the chat completion. The total length of input tokens and generated tokens is limited by the model’s context length. Set to 0 for the model’s configured max generated tokens.

Environment variable: QUARKUS_LANGCHAIN4J_WATSONX_CHAT_MODEL_MAX_OUTPUT_TOKENS

int

1024

Applies a penalty to new tokens based on whether they already appear in the generated text so far, encouraging the model to introduce new topics rather than repeat itself.

The parameter is sent to the model only when it is set.

Possible values: -2 < value < 2

Environment variable: QUARKUS_LANGCHAIN4J_WATSONX_CHAT_MODEL_PRESENCE_PENALTY

double

Random number generator seed to use in sampling mode for experimental repeatability.

Environment variable: QUARKUS_LANGCHAIN4J_WATSONX_CHAT_MODEL_SEED

int

Defines one or more stop sequences that will cause the model to stop generating further tokens if any of them are encountered in the output.

This allows control over where the model should end its response. If a stop sequence is encountered before the minimum number of tokens has been generated, it will be ignored.

Possible values: 0 ≤ number of items ≤ 4

Environment variable: QUARKUS_LANGCHAIN4J_WATSONX_CHAT_MODEL_STOP

list of string

Specifies the sampling temperature to use in the generation process.

Higher values (e.g. 0.8) make the output more random and diverse, while lower values (e.g. 0.2) make the output more focused and deterministic.

Possible values: 0 < value < 2

Environment variable: QUARKUS_LANGCHAIN4J_WATSONX_CHAT_MODEL_TEMPERATURE

double

${quarkus.langchain4j.temperature:1.0}

An alternative to sampling with temperature, called nucleus sampling, where the model considers the results of the tokens with top_p probability mass. So 0.1 means only the tokens comprising the top 10% probability mass are considered.

The parameter is sent to the model only when it is set.

Possible values: 0 < value < 1

Environment variable: QUARKUS_LANGCHAIN4J_WATSONX_CHAT_MODEL_TOP_P

double

Specifies the desired format for the model’s output.

Allowable values: [text, json, json_schema]

Environment variable: QUARKUS_LANGCHAIN4J_WATSONX_CHAT_MODEL_RESPONSE_FORMAT

text, json, json-schema

Whether the JSON Schema sent to the model should use the strict mode.

When enabled, the model is constrained to return a response that exactly matches the given JSON Schema. To satisfy the restrictions of the strict mode, all the properties of the schema are marked as required, the optional ones are made nullable and additionalProperties is set to false.

Set this property to false to let the model treat the schema as a hint instead of a constraint.

Environment variable: QUARKUS_LANGCHAIN4J_WATSONX_CHAT_MODEL_STRICT_JSON_SCHEMA

boolean

true

Whether chat model requests should be logged.

Environment variable: QUARKUS_LANGCHAIN4J_WATSONX_CHAT_MODEL_LOG_REQUESTS

boolean

false

Whether chat model responses should be logged.

Environment variable: QUARKUS_LANGCHAIN4J_WATSONX_CHAT_MODEL_LOG_RESPONSES

boolean

false

Whether the watsonx.ai client should log requests as cURL commands.

Environment variable: QUARKUS_LANGCHAIN4J_WATSONX_CHAT_MODEL_LOG_REQUESTS_CURL

boolean

false

Specifies a set of allowed output choices.

When this parameter is set, the model is constrained to return exactly one of the provided choices.

Environment variable: QUARKUS_LANGCHAIN4J_WATSONX_CHAT_MODEL_GUIDED_CHOICE

list of string

Constrains the model output to follow a context-free grammar.

If specified, the generated output will conform to the defined grammar.

Environment variable: QUARKUS_LANGCHAIN4J_WATSONX_CHAT_MODEL_GUIDED_GRAMMAR

string

Constrains the model output to match a regular expression pattern.

If specified, the generated output must conform to the provided regex.

Environment variable: QUARKUS_LANGCHAIN4J_WATSONX_CHAT_MODEL_GUIDED_REGEX

string

Sets the length penalty to be applied during text generation. This penalty influences the length of the generated text. A length penalty discourages the model from generating overly long responses, or conversely, it can encourage more extended outputs.

When the penalty value is greater than 1.0, it discourages generating longer responses. Conversely, a value less than 1.0 incentivizes the model to generate longer text. A value of 1.0 means no penalty, and the length of the output will be determined by other factors, such as the input prompt and model’s natural completion behavior.

Environment variable: QUARKUS_LANGCHAIN4J_WATSONX_CHAT_MODEL_LENGTH_PENALTY

double

Sets the repetition penalty to be applied during text generation. This penalty helps to discourage the model from repeating the same words or phrases too often.

The penalty value should be greater than 1.0 for repetition discouragement. A value of 1.0 means no penalty, and values above 1.0 increase the strength of the penalty.

Environment variable: QUARKUS_LANGCHAIN4J_WATSONX_CHAT_MODEL_REPETITION_PENALTY

double

Enables or disables reasoning.

Environment variable: QUARKUS_LANGCHAIN4J_WATSONX_CHAT_MODEL_THINKING_ENABLED

boolean

The opening delimiter for the model’s internal reasoning section.

Environment variable: QUARKUS_LANGCHAIN4J_WATSONX_CHAT_MODEL_THINKING_TAGS_THINK_OPENING

string

required

The closing delimiter for the model’s internal reasoning section.

Environment variable: QUARKUS_LANGCHAIN4J_WATSONX_CHAT_MODEL_THINKING_TAGS_THINK_CLOSING

string

required

The opening delimiter for the model’s final response section.

Environment variable: QUARKUS_LANGCHAIN4J_WATSONX_CHAT_MODEL_THINKING_TAGS_RESPONSE_OPENING

string

required

The closing delimiter for the model’s final response section.

Environment variable: QUARKUS_LANGCHAIN4J_WATSONX_CHAT_MODEL_THINKING_TAGS_RESPONSE_CLOSING

string

required

Controls the reasoning effort level for models that separate reasoning and response automatically.

Example values: LOW, MEDIUM, HIGH.

Environment variable: QUARKUS_LANGCHAIN4J_WATSONX_CHAT_MODEL_THINKING_EFFORT

low, medium, high

Determines whether the reasoning portion returned by the model should be included in the final response provided to the application.

Environment variable: QUARKUS_LANGCHAIN4J_WATSONX_CHAT_MODEL_THINKING_INCLUDE_REASONING

boolean

Specifies the model to use for the chat completion.

A list of all available models is provided in the IBM watsonx.ai documentation at the this link.

To use a model, locate the API model ID column in the table and copy the corresponding model ID.

Environment variable: QUARKUS_LANGCHAIN4J_WATSONX_CHAT_MODEL_MODEL_NAME

string

ibm/granite-4-h-small

Specifies how the model should choose which tool to call during a request.

This value can be:

  • auto: The model decides whether and which tool to call automatically.

  • required: The model must call one of the available tools.

If toolChoiceName is set, this value is ignored.

Setting this value influences the tool-calling behavior of the model when no specific tool is required.

Environment variable: QUARKUS_LANGCHAIN4J_WATSONX_DEPLOYMENT_CHAT_MODEL_TOOL_CHOICE

auto, required, none

Specifies the name of a specific tool that the model must call.

When set, the model will be forced to call the specified tool. The name must exactly match one of the available tools defined for the service.

Environment variable: QUARKUS_LANGCHAIN4J_WATSONX_DEPLOYMENT_CHAT_MODEL_TOOL_CHOICE_NAME

string

Positive values penalize new tokens based on their existing frequency in the generated text, reducing the likelihood of the model repeating the same lines verbatim.

The parameter is sent to the model only when it is set.

Possible values: -2 < value < 2

Environment variable: QUARKUS_LANGCHAIN4J_WATSONX_DEPLOYMENT_CHAT_MODEL_FREQUENCY_PENALTY

double

Specifies whether to return the log probabilities of the output tokens.

If set to true, the response will include the log probability of each output token in the content of the message.

The parameter is sent to the model only when it is set.

Environment variable: QUARKUS_LANGCHAIN4J_WATSONX_DEPLOYMENT_CHAT_MODEL_LOGPROBS

boolean

An integer specifying the number of most likely tokens to return at each token position, each with an associated log probability. The option logprobs must be set to true if this parameter is used.

Possible values: 0 ≤ value ≤ 20

Environment variable: QUARKUS_LANGCHAIN4J_WATSONX_DEPLOYMENT_CHAT_MODEL_TOP_LOGPROBS

int

The maximum number of tokens that can be generated in the chat completion. The total length of input tokens and generated tokens is limited by the model’s context length. Set to 0 for the model’s configured max generated tokens.

Environment variable: QUARKUS_LANGCHAIN4J_WATSONX_DEPLOYMENT_CHAT_MODEL_MAX_OUTPUT_TOKENS

int

1024

Applies a penalty to new tokens based on whether they already appear in the generated text so far, encouraging the model to introduce new topics rather than repeat itself.

The parameter is sent to the model only when it is set.

Possible values: -2 < value < 2

Environment variable: QUARKUS_LANGCHAIN4J_WATSONX_DEPLOYMENT_CHAT_MODEL_PRESENCE_PENALTY

double

Random number generator seed to use in sampling mode for experimental repeatability.

Environment variable: QUARKUS_LANGCHAIN4J_WATSONX_DEPLOYMENT_CHAT_MODEL_SEED

int

Defines one or more stop sequences that will cause the model to stop generating further tokens if any of them are encountered in the output.

This allows control over where the model should end its response. If a stop sequence is encountered before the minimum number of tokens has been generated, it will be ignored.

Possible values: 0 ≤ number of items ≤ 4

Environment variable: QUARKUS_LANGCHAIN4J_WATSONX_DEPLOYMENT_CHAT_MODEL_STOP

list of string

Specifies the sampling temperature to use in the generation process.

Higher values (e.g. 0.8) make the output more random and diverse, while lower values (e.g. 0.2) make the output more focused and deterministic.

Possible values: 0 < value < 2

Environment variable: QUARKUS_LANGCHAIN4J_WATSONX_DEPLOYMENT_CHAT_MODEL_TEMPERATURE

double

${quarkus.langchain4j.temperature:1.0}

An alternative to sampling with temperature, called nucleus sampling, where the model considers the results of the tokens with top_p probability mass. So 0.1 means only the tokens comprising the top 10% probability mass are considered.

The parameter is sent to the model only when it is set.

Possible values: 0 < value < 1

Environment variable: QUARKUS_LANGCHAIN4J_WATSONX_DEPLOYMENT_CHAT_MODEL_TOP_P

double

Specifies the desired format for the model’s output.

Allowable values: [text, json, json_schema]

Environment variable: QUARKUS_LANGCHAIN4J_WATSONX_DEPLOYMENT_CHAT_MODEL_RESPONSE_FORMAT

text, json, json-schema

Whether the JSON Schema sent to the model should use the strict mode.

When enabled, the model is constrained to return a response that exactly matches the given JSON Schema. To satisfy the restrictions of the strict mode, all the properties of the schema are marked as required, the optional ones are made nullable and additionalProperties is set to false.

Set this property to false to let the model treat the schema as a hint instead of a constraint.

Environment variable: QUARKUS_LANGCHAIN4J_WATSONX_DEPLOYMENT_CHAT_MODEL_STRICT_JSON_SCHEMA

boolean

true

Whether chat model requests should be logged.

Environment variable: QUARKUS_LANGCHAIN4J_WATSONX_DEPLOYMENT_CHAT_MODEL_LOG_REQUESTS

boolean

false

Whether chat model responses should be logged.

Environment variable: QUARKUS_LANGCHAIN4J_WATSONX_DEPLOYMENT_CHAT_MODEL_LOG_RESPONSES

boolean

false

Whether the watsonx.ai client should log requests as cURL commands.

Environment variable: QUARKUS_LANGCHAIN4J_WATSONX_DEPLOYMENT_CHAT_MODEL_LOG_REQUESTS_CURL

boolean

false

Specifies a set of allowed output choices.

When this parameter is set, the model is constrained to return exactly one of the provided choices.

Environment variable: QUARKUS_LANGCHAIN4J_WATSONX_DEPLOYMENT_CHAT_MODEL_GUIDED_CHOICE

list of string

Constrains the model output to follow a context-free grammar.

If specified, the generated output will conform to the defined grammar.

Environment variable: QUARKUS_LANGCHAIN4J_WATSONX_DEPLOYMENT_CHAT_MODEL_GUIDED_GRAMMAR

string

Constrains the model output to match a regular expression pattern.

If specified, the generated output must conform to the provided regex.

Environment variable: QUARKUS_LANGCHAIN4J_WATSONX_DEPLOYMENT_CHAT_MODEL_GUIDED_REGEX

string

Sets the length penalty to be applied during text generation. This penalty influences the length of the generated text. A length penalty discourages the model from generating overly long responses, or conversely, it can encourage more extended outputs.

When the penalty value is greater than 1.0, it discourages generating longer responses. Conversely, a value less than 1.0 incentivizes the model to generate longer text. A value of 1.0 means no penalty, and the length of the output will be determined by other factors, such as the input prompt and model’s natural completion behavior.

Environment variable: QUARKUS_LANGCHAIN4J_WATSONX_DEPLOYMENT_CHAT_MODEL_LENGTH_PENALTY

double

Sets the repetition penalty to be applied during text generation. This penalty helps to discourage the model from repeating the same words or phrases too often.

The penalty value should be greater than 1.0 for repetition discouragement. A value of 1.0 means no penalty, and values above 1.0 increase the strength of the penalty.

Environment variable: QUARKUS_LANGCHAIN4J_WATSONX_DEPLOYMENT_CHAT_MODEL_REPETITION_PENALTY

double

Enables or disables reasoning.

Environment variable: QUARKUS_LANGCHAIN4J_WATSONX_DEPLOYMENT_CHAT_MODEL_THINKING_ENABLED

boolean

The opening delimiter for the model’s internal reasoning section.

Environment variable: QUARKUS_LANGCHAIN4J_WATSONX_DEPLOYMENT_CHAT_MODEL_THINKING_TAGS_THINK_OPENING

string

required

The closing delimiter for the model’s internal reasoning section.

Environment variable: QUARKUS_LANGCHAIN4J_WATSONX_DEPLOYMENT_CHAT_MODEL_THINKING_TAGS_THINK_CLOSING

string

required

The opening delimiter for the model’s final response section.

Environment variable: QUARKUS_LANGCHAIN4J_WATSONX_DEPLOYMENT_CHAT_MODEL_THINKING_TAGS_RESPONSE_OPENING

string

required

The closing delimiter for the model’s final response section.

Environment variable: QUARKUS_LANGCHAIN4J_WATSONX_DEPLOYMENT_CHAT_MODEL_THINKING_TAGS_RESPONSE_CLOSING

string

required

Controls the reasoning effort level for models that separate reasoning and response automatically.

Example values: LOW, MEDIUM, HIGH.

Environment variable: QUARKUS_LANGCHAIN4J_WATSONX_DEPLOYMENT_CHAT_MODEL_THINKING_EFFORT

low, medium, high

Determines whether the reasoning portion returned by the model should be included in the final response provided to the application.

Environment variable: QUARKUS_LANGCHAIN4J_WATSONX_DEPLOYMENT_CHAT_MODEL_THINKING_INCLUDE_REASONING

boolean

The deployment ID of the model deployed in watsonx.ai.

Setting this property routes all chat requests to the deployment chat API.

Environment variable: QUARKUS_LANGCHAIN4J_WATSONX_DEPLOYMENT_CHAT_MODEL_DEPLOYMENT_ID

string

Specifies how the model should choose which tool to call during a request.

This value can be:

  • auto: The model decides whether and which tool to call automatically.

  • required: The model must call one of the available tools.

If toolChoiceName is set, this value is ignored.

Setting this value influences the tool-calling behavior of the model when no specific tool is required.

Environment variable: QUARKUS_LANGCHAIN4J_WATSONX_GATEWAY_CHAT_MODEL_TOOL_CHOICE

auto, required, none

Specifies the name of a specific tool that the model must call.

When set, the model will be forced to call the specified tool. The name must exactly match one of the available tools defined for the service.

Environment variable: QUARKUS_LANGCHAIN4J_WATSONX_GATEWAY_CHAT_MODEL_TOOL_CHOICE_NAME

string

Positive values penalize new tokens based on their existing frequency in the generated text, reducing the likelihood of the model repeating the same lines verbatim.

The parameter is sent to the model only when it is set.

Possible values: -2 < value < 2

Environment variable: QUARKUS_LANGCHAIN4J_WATSONX_GATEWAY_CHAT_MODEL_FREQUENCY_PENALTY

double

Specifies whether to return the log probabilities of the output tokens.

If set to true, the response will include the log probability of each output token in the content of the message.

The parameter is sent to the model only when it is set.

Environment variable: QUARKUS_LANGCHAIN4J_WATSONX_GATEWAY_CHAT_MODEL_LOGPROBS

boolean

An integer specifying the number of most likely tokens to return at each token position, each with an associated log probability. The option logprobs must be set to true if this parameter is used.

Possible values: 0 ≤ value ≤ 20

Environment variable: QUARKUS_LANGCHAIN4J_WATSONX_GATEWAY_CHAT_MODEL_TOP_LOGPROBS

int

The maximum number of tokens that can be generated in the chat completion. The total length of input tokens and generated tokens is limited by the model’s context length. Set to 0 for the model’s configured max generated tokens.

Environment variable: QUARKUS_LANGCHAIN4J_WATSONX_GATEWAY_CHAT_MODEL_MAX_OUTPUT_TOKENS

int

1024

Applies a penalty to new tokens based on whether they already appear in the generated text so far, encouraging the model to introduce new topics rather than repeat itself.

The parameter is sent to the model only when it is set.

Possible values: -2 < value < 2

Environment variable: QUARKUS_LANGCHAIN4J_WATSONX_GATEWAY_CHAT_MODEL_PRESENCE_PENALTY

double

Random number generator seed to use in sampling mode for experimental repeatability.

Environment variable: QUARKUS_LANGCHAIN4J_WATSONX_GATEWAY_CHAT_MODEL_SEED

int

Defines one or more stop sequences that will cause the model to stop generating further tokens if any of them are encountered in the output.

This allows control over where the model should end its response. If a stop sequence is encountered before the minimum number of tokens has been generated, it will be ignored.

Possible values: 0 ≤ number of items ≤ 4

Environment variable: QUARKUS_LANGCHAIN4J_WATSONX_GATEWAY_CHAT_MODEL_STOP

list of string

Specifies the sampling temperature to use in the generation process.

Higher values (e.g. 0.8) make the output more random and diverse, while lower values (e.g. 0.2) make the output more focused and deterministic.

Possible values: 0 < value < 2

Environment variable: QUARKUS_LANGCHAIN4J_WATSONX_GATEWAY_CHAT_MODEL_TEMPERATURE

double

${quarkus.langchain4j.temperature:1.0}

An alternative to sampling with temperature, called nucleus sampling, where the model considers the results of the tokens with top_p probability mass. So 0.1 means only the tokens comprising the top 10% probability mass are considered.

The parameter is sent to the model only when it is set.

Possible values: 0 < value < 1

Environment variable: QUARKUS_LANGCHAIN4J_WATSONX_GATEWAY_CHAT_MODEL_TOP_P

double

Specifies the desired format for the model’s output.

Allowable values: [text, json, json_schema]

Environment variable: QUARKUS_LANGCHAIN4J_WATSONX_GATEWAY_CHAT_MODEL_RESPONSE_FORMAT

text, json, json-schema

Whether the JSON Schema sent to the model should use the strict mode.

When enabled, the model is constrained to return a response that exactly matches the given JSON Schema. To satisfy the restrictions of the strict mode, all the properties of the schema are marked as required, the optional ones are made nullable and additionalProperties is set to false.

Set this property to false to let the model treat the schema as a hint instead of a constraint.

Environment variable: QUARKUS_LANGCHAIN4J_WATSONX_GATEWAY_CHAT_MODEL_STRICT_JSON_SCHEMA

boolean

true

Whether chat model requests should be logged.

Environment variable: QUARKUS_LANGCHAIN4J_WATSONX_GATEWAY_CHAT_MODEL_LOG_REQUESTS

boolean

false

Whether chat model responses should be logged.

Environment variable: QUARKUS_LANGCHAIN4J_WATSONX_GATEWAY_CHAT_MODEL_LOG_RESPONSES

boolean

false

Whether the watsonx.ai client should log requests as cURL commands.

Environment variable: QUARKUS_LANGCHAIN4J_WATSONX_GATEWAY_CHAT_MODEL_LOG_REQUESTS_CURL

boolean

false

The identifier of the model to use, as configured in the Model Gateway (for example openai/gpt-4o-mini).

Setting this property routes all chat requests to the Model Gateway.

Environment variable: QUARKUS_LANGCHAIN4J_WATSONX_GATEWAY_CHAT_MODEL_MODEL_NAME

string

Specifies the latency tier used to serve the request.

Allowable values: [auto, default, flex, priority]

Environment variable: QUARKUS_LANGCHAIN4J_WATSONX_GATEWAY_CHAT_MODEL_SERVICE_TIER

auto, default, flex, priority

Constrains the effort spent on reasoning for reasoning models.

Reducing the reasoning effort can result in faster responses and fewer tokens used on reasoning.

Allowable values: [low, medium, high]

Environment variable: QUARKUS_LANGCHAIN4J_WATSONX_GATEWAY_CHAT_MODEL_REASONING_EFFORT

low, medium, high

Whether the semantic cache is enabled.

Environment variable: QUARKUS_LANGCHAIN4J_WATSONX_GATEWAY_CHAT_MODEL_CACHE_ENABLED

boolean

true

The similarity threshold a cached entry must reach to be served instead of calling the model.

Environment variable: QUARKUS_LANGCHAIN4J_WATSONX_GATEWAY_CHAT_MODEL_CACHE_THRESHOLD

double

provider specific

The output types that the model is requested to generate.

Most models are only able to generate text, which is the default.

Environment variable: QUARKUS_LANGCHAIN4J_WATSONX_GATEWAY_CHAT_MODEL_MODALITIES

list of string

Whether the generated output should be stored for model distillation or evaluations.

Environment variable: QUARKUS_LANGCHAIN4J_WATSONX_GATEWAY_CHAT_MODEL_STORE

boolean

Whether the model is allowed to run tool calls in parallel.

Environment variable: QUARKUS_LANGCHAIN4J_WATSONX_GATEWAY_CHAT_MODEL_PARALLEL_TOOL_CALLS

boolean

A stable identifier of the end user issuing the request, used by the backing provider to detect and prevent abuse.

Environment variable: QUARKUS_LANGCHAIN4J_WATSONX_GATEWAY_CHAT_MODEL_USER

string

A set of key/value pairs that is attached to the request and returned with the response.

Environment variable: QUARKUS_LANGCHAIN4J_WATSONX_GATEWAY_CHAT_MODEL_METADATA__METADATA_KEY_

Map<String,String>

Specifies the ID of the model to be used.

A list of all available models is provided in the IBM watsonx.ai documentation at the this link.

To use a model, locate the API model ID column in the table and copy the corresponding model ID.

Environment variable: QUARKUS_LANGCHAIN4J_WATSONX_EMBEDDING_MODEL_MODEL_NAME

string

ibm/granite-embedding-278m-multilingual

Whether embedding model requests should be logged.

Environment variable: QUARKUS_LANGCHAIN4J_WATSONX_EMBEDDING_MODEL_LOG_REQUESTS

boolean

false

Whether embedding model responses should be logged.

Environment variable: QUARKUS_LANGCHAIN4J_WATSONX_EMBEDDING_MODEL_LOG_RESPONSES

boolean

false

Whether the watsonx.ai client should log requests as cURL commands.

Environment variable: QUARKUS_LANGCHAIN4J_WATSONX_EMBEDDING_MODEL_LOG_REQUESTS_CURL

boolean

false

The id of the model to be used.

All available models are listed in the IBM Watsonx.ai documentation at the link: following link.

To use a model, locate the API model_id column in the table and copy the corresponding model ID.

Environment variable: QUARKUS_LANGCHAIN4J_WATSONX_SCORING_MODEL_MODEL_NAME

string

cross-encoder/ms-marco-minilm-l-12-v2

Whether embedding model requests should be logged.

Environment variable: QUARKUS_LANGCHAIN4J_WATSONX_SCORING_MODEL_LOG_REQUESTS

boolean

false

Whether embedding model responses should be logged.

Environment variable: QUARKUS_LANGCHAIN4J_WATSONX_SCORING_MODEL_LOG_RESPONSES

boolean

false

Whether the watsonx.ai client should log requests as cURL commands.

Environment variable: QUARKUS_LANGCHAIN4J_WATSONX_SCORING_MODEL_LOG_REQUESTS_CURL

boolean

false

Indicates whether the PII moderation model is enabled.

Environment variable: QUARKUS_LANGCHAIN4J_WATSONX_MODERATION_MODEL_PII_ENABLED

boolean

required

Indicates whether the HAP moderation model is enabled.

Environment variable: QUARKUS_LANGCHAIN4J_WATSONX_MODERATION_MODEL_HAP_ENABLED

boolean

required

Threshold value for HAP moderation model.

Environment variable: QUARKUS_LANGCHAIN4J_WATSONX_MODERATION_MODEL_HAP_THRESHOLD

double

Indicates whether the GraniteGuardian moderation model is enabled.

Environment variable: QUARKUS_LANGCHAIN4J_WATSONX_MODERATION_MODEL_GRANITE_GUARDIAN_ENABLED

boolean

required

Threshold value for Granite Guardian moderation model.

Environment variable: QUARKUS_LANGCHAIN4J_WATSONX_MODERATION_MODEL_GRANITE_GUARDIAN_THRESHOLD

double

Whether moderation model requests should be logged.

Environment variable: QUARKUS_LANGCHAIN4J_WATSONX_MODERATION_MODEL_LOG_REQUESTS

boolean

false

Whether moderation model responses should be logged.

Environment variable: QUARKUS_LANGCHAIN4J_WATSONX_MODERATION_MODEL_LOG_RESPONSES

boolean

false

Whether the watsonx.ai client should log requests as cURL commands.

Environment variable: QUARKUS_LANGCHAIN4J_WATSONX_MODERATION_MODEL_LOG_REQUESTS_CURL

boolean

false

Base URL for the built-in service.

All available URLs are listed in the IBM Watsonx.ai documentation at the following link.

Note: If empty, the URL is automatically calculated based on the watsonx.base-url value.

Environment variable: QUARKUS_LANGCHAIN4J_WATSONX_BUILT_IN_TOOL_BASE_URL

string

Timeout for built-in tools APIs.

If empty, the api key inherits the value from the watsonx.timeout property.

Environment variable: QUARKUS_LANGCHAIN4J_WATSONX_BUILT_IN_TOOL_TIMEOUT

Duration 

10s

Whether the built-in rest client should log requests.

Environment variable: QUARKUS_LANGCHAIN4J_WATSONX_BUILT_IN_TOOL_LOG_REQUESTS

boolean

false

Whether the built-in rest client should log responses.

Environment variable: QUARKUS_LANGCHAIN4J_WATSONX_BUILT_IN_TOOL_LOG_RESPONSES

boolean

false

Whether the watsonx.ai client should log requests as cURL commands.

Environment variable: QUARKUS_LANGCHAIN4J_WATSONX_BUILT_IN_TOOL_LOG_REQUESTS_CURL

boolean

false

Tavily API key.

Environment variable: QUARKUS_LANGCHAIN4J_WATSONX_BUILT_IN_TOOL_TAVILY_SEARCH_API_KEY

string

Deployment id.

Environment variable: QUARKUS_LANGCHAIN4J_WATSONX_BUILT_IN_TOOL_PYTHON_INTERPRETER_DEPLOYMENT_ID

string

Vector index ids

Environment variable: QUARKUS_LANGCHAIN4J_WATSONX_BUILT_IN_TOOL_RAG_QUERY_VECTOR_INDEX_IDS

list of string

Named model config

Type

Default

Specifies the base URL of the watsonx.ai API.

A list of all available URLs is provided in the IBM Watsonx.ai documentation at the this link.

Environment variable: QUARKUS_LANGCHAIN4J_WATSONX__MODEL_NAME__BASE_URL

string

IBM Cloud API key.

Environment variable: QUARKUS_LANGCHAIN4J_WATSONX__MODEL_NAME__API_KEY

string

Timeout for watsonx.ai calls.

Environment variable: QUARKUS_LANGCHAIN4J_WATSONX__MODEL_NAME__TIMEOUT

Duration 

60s

The version date for the API of the form YYYY-MM-DD.

Environment variable: QUARKUS_LANGCHAIN4J_WATSONX__MODEL_NAME__VERSION

string

The space that contains the resource.

Either space_id or project_id has to be given.

Environment variable: QUARKUS_LANGCHAIN4J_WATSONX__MODEL_NAME__SPACE_ID

string

The project that contains the resource.

Either space_id or project_id has to be given.

Environment variable: QUARKUS_LANGCHAIN4J_WATSONX__MODEL_NAME__PROJECT_ID

string

Whether the watsonx.ai client should log requests.

Environment variable: QUARKUS_LANGCHAIN4J_WATSONX__MODEL_NAME__LOG_REQUESTS

boolean

false

Whether the watsonx.ai client should log responses.

Environment variable: QUARKUS_LANGCHAIN4J_WATSONX__MODEL_NAME__LOG_RESPONSES

boolean

false

Whether the watsonx.ai client should log requests as cURL commands.

Environment variable: QUARKUS_LANGCHAIN4J_WATSONX__MODEL_NAME__LOG_REQUESTS_CURL

boolean

false

Whether to enable the integration. Defaults to true, which means requests are made to the watsonx.ai provider. Set to false to disable all requests.

Environment variable: QUARKUS_LANGCHAIN4J_WATSONX__MODEL_NAME__ENABLE_INTEGRATION

boolean

true

Base URL of the IAM Authentication API.

Environment variable: QUARKUS_LANGCHAIN4J_WATSONX__MODEL_NAME__IAM_BASE_URL

URI

Timeout for IAM authentication calls.

Environment variable: QUARKUS_LANGCHAIN4J_WATSONX__MODEL_NAME__IAM_TIMEOUT

Duration 

10s

Grant type for the IAM Authentication API.

Environment variable: QUARKUS_LANGCHAIN4J_WATSONX__MODEL_NAME__IAM_GRANT_TYPE

string

Base URL of the Cloud Object Storage API.

Environment variable: QUARKUS_LANGCHAIN4J_WATSONX__MODEL_NAME__TEXT_EXTRACTION_COS_URL

string

required

The id of the connection asset that contains the credentials required to access the data.

Environment variable: QUARKUS_LANGCHAIN4J_WATSONX__MODEL_NAME__TEXT_EXTRACTION_DOCUMENT_REFERENCE_CONNECTION

string

required

The name of the bucket containing the input document.

Environment variable: QUARKUS_LANGCHAIN4J_WATSONX__MODEL_NAME__TEXT_EXTRACTION_DOCUMENT_REFERENCE_BUCKET_NAME

string

required

The id of the connection asset used to store the extracted results.

Environment variable: QUARKUS_LANGCHAIN4J_WATSONX__MODEL_NAME__TEXT_EXTRACTION_RESULTS_REFERENCE_CONNECTION

string

required

The name of the bucket where the output files will be written.

Environment variable: QUARKUS_LANGCHAIN4J_WATSONX__MODEL_NAME__TEXT_EXTRACTION_RESULTS_REFERENCE_BUCKET_NAME

string

required

Whether text extraction requests should be logged.

Environment variable: QUARKUS_LANGCHAIN4J_WATSONX__MODEL_NAME__TEXT_EXTRACTION_LOG_REQUESTS

boolean

false

Whether text extraction responses should be logged.

Environment variable: QUARKUS_LANGCHAIN4J_WATSONX__MODEL_NAME__TEXT_EXTRACTION_LOG_RESPONSES

boolean

false

Whether the watsonx.ai client should log requests as cURL commands.

Environment variable: QUARKUS_LANGCHAIN4J_WATSONX__MODEL_NAME__TEXT_EXTRACTION_LOG_REQUESTS_CURL

boolean

false

Base URL of the Cloud Object Storage API.

Environment variable: QUARKUS_LANGCHAIN4J_WATSONX__MODEL_NAME__TEXT_CLASSIFICATION_COS_URL

string

required

The id of the connection asset that contains the credentials required to access the data.

Environment variable: QUARKUS_LANGCHAIN4J_WATSONX__MODEL_NAME__TEXT_CLASSIFICATION_DOCUMENT_REFERENCE_CONNECTION

string

required

The name of the bucket containing the input document.

Environment variable: QUARKUS_LANGCHAIN4J_WATSONX__MODEL_NAME__TEXT_CLASSIFICATION_DOCUMENT_REFERENCE_BUCKET_NAME

string

required

Whether text extraction requests should be logged.

Environment variable: QUARKUS_LANGCHAIN4J_WATSONX__MODEL_NAME__TEXT_CLASSIFICATION_LOG_REQUESTS

boolean

false

Whether text extraction responses should be logged.

Environment variable: QUARKUS_LANGCHAIN4J_WATSONX__MODEL_NAME__TEXT_CLASSIFICATION_LOG_RESPONSES

boolean

false

Whether the watsonx.ai client should log requests as cURL commands.

Environment variable: QUARKUS_LANGCHAIN4J_WATSONX__MODEL_NAME__TEXT_CLASSIFICATION_LOG_REQUESTS_CURL

boolean

false

Base URL of the Cloud Object Storage API.

Environment variable: QUARKUS_LANGCHAIN4J_WATSONX__MODEL_NAME__SCHEMA_CREATE_COS_URL

string

required

The id of the connection asset that contains the credentials required to access the data.

Environment variable: QUARKUS_LANGCHAIN4J_WATSONX__MODEL_NAME__SCHEMA_CREATE_DOCUMENT_REFERENCE_CONNECTION

string

required

The name of the bucket containing the input document.

Environment variable: QUARKUS_LANGCHAIN4J_WATSONX__MODEL_NAME__SCHEMA_CREATE_DOCUMENT_REFERENCE_BUCKET_NAME

string

required

Whether create schema requests should be logged.

Environment variable: QUARKUS_LANGCHAIN4J_WATSONX__MODEL_NAME__SCHEMA_CREATE_LOG_REQUESTS

boolean

false

Whether create schema responses should be logged.

Environment variable: QUARKUS_LANGCHAIN4J_WATSONX__MODEL_NAME__SCHEMA_CREATE_LOG_RESPONSES

boolean

false

Whether the watsonx.ai client should log requests as cURL commands.

Environment variable: QUARKUS_LANGCHAIN4J_WATSONX__MODEL_NAME__SCHEMA_CREATE_LOG_REQUESTS_CURL

boolean

false

Whether improve schema requests should be logged.

Environment variable: QUARKUS_LANGCHAIN4J_WATSONX__MODEL_NAME__SCHEMA_IMPROVE_LOG_REQUESTS

boolean

false

Whether improve schema responses should be logged.

Environment variable: QUARKUS_LANGCHAIN4J_WATSONX__MODEL_NAME__SCHEMA_IMPROVE_LOG_RESPONSES

boolean

false

Whether the watsonx.ai client should log requests as cURL commands.

Environment variable: QUARKUS_LANGCHAIN4J_WATSONX__MODEL_NAME__SCHEMA_IMPROVE_LOG_REQUESTS_CURL

boolean

false

Whether merge schema requests should be logged.

Environment variable: QUARKUS_LANGCHAIN4J_WATSONX__MODEL_NAME__SCHEMA_MERGE_LOG_REQUESTS

boolean

false

Whether merge schema responses should be logged.

Environment variable: QUARKUS_LANGCHAIN4J_WATSONX__MODEL_NAME__SCHEMA_MERGE_LOG_RESPONSES

boolean

false

Whether the watsonx.ai client should log requests as cURL commands.

Environment variable: QUARKUS_LANGCHAIN4J_WATSONX__MODEL_NAME__SCHEMA_MERGE_LOG_REQUESTS_CURL

boolean

false

Whether cluster schema requests should be logged.

Environment variable: QUARKUS_LANGCHAIN4J_WATSONX__MODEL_NAME__SCHEMA_CLUSTER_LOG_REQUESTS

boolean

false

Whether cluster schema responses should be logged.

Environment variable: QUARKUS_LANGCHAIN4J_WATSONX__MODEL_NAME__SCHEMA_CLUSTER_LOG_RESPONSES

boolean

false

Whether the watsonx.ai client should log requests as cURL commands.

Environment variable: QUARKUS_LANGCHAIN4J_WATSONX__MODEL_NAME__SCHEMA_CLUSTER_LOG_REQUESTS_CURL

boolean

false

Specifies how the model should choose which tool to call during a request.

This value can be:

  • auto: The model decides whether and which tool to call automatically.

  • required: The model must call one of the available tools.

If toolChoiceName is set, this value is ignored.

Setting this value influences the tool-calling behavior of the model when no specific tool is required.

Environment variable: QUARKUS_LANGCHAIN4J_WATSONX__MODEL_NAME__CHAT_MODEL_TOOL_CHOICE

auto, required, none

Specifies the name of a specific tool that the model must call.

When set, the model will be forced to call the specified tool. The name must exactly match one of the available tools defined for the service.

Environment variable: QUARKUS_LANGCHAIN4J_WATSONX__MODEL_NAME__CHAT_MODEL_TOOL_CHOICE_NAME

string

Positive values penalize new tokens based on their existing frequency in the generated text, reducing the likelihood of the model repeating the same lines verbatim.

The parameter is sent to the model only when it is set.

Possible values: -2 < value < 2

Environment variable: QUARKUS_LANGCHAIN4J_WATSONX__MODEL_NAME__CHAT_MODEL_FREQUENCY_PENALTY

double

Specifies whether to return the log probabilities of the output tokens.

If set to true, the response will include the log probability of each output token in the content of the message.

The parameter is sent to the model only when it is set.

Environment variable: QUARKUS_LANGCHAIN4J_WATSONX__MODEL_NAME__CHAT_MODEL_LOGPROBS

boolean

An integer specifying the number of most likely tokens to return at each token position, each with an associated log probability. The option logprobs must be set to true if this parameter is used.

Possible values: 0 ≤ value ≤ 20

Environment variable: QUARKUS_LANGCHAIN4J_WATSONX__MODEL_NAME__CHAT_MODEL_TOP_LOGPROBS

int

The maximum number of tokens that can be generated in the chat completion. The total length of input tokens and generated tokens is limited by the model’s context length. Set to 0 for the model’s configured max generated tokens.

Environment variable: QUARKUS_LANGCHAIN4J_WATSONX__MODEL_NAME__CHAT_MODEL_MAX_OUTPUT_TOKENS

int

1024

Applies a penalty to new tokens based on whether they already appear in the generated text so far, encouraging the model to introduce new topics rather than repeat itself.

The parameter is sent to the model only when it is set.

Possible values: -2 < value < 2

Environment variable: QUARKUS_LANGCHAIN4J_WATSONX__MODEL_NAME__CHAT_MODEL_PRESENCE_PENALTY

double

Random number generator seed to use in sampling mode for experimental repeatability.

Environment variable: QUARKUS_LANGCHAIN4J_WATSONX__MODEL_NAME__CHAT_MODEL_SEED

int

Defines one or more stop sequences that will cause the model to stop generating further tokens if any of them are encountered in the output.

This allows control over where the model should end its response. If a stop sequence is encountered before the minimum number of tokens has been generated, it will be ignored.

Possible values: 0 ≤ number of items ≤ 4

Environment variable: QUARKUS_LANGCHAIN4J_WATSONX__MODEL_NAME__CHAT_MODEL_STOP

list of string

Specifies the sampling temperature to use in the generation process.

Higher values (e.g. 0.8) make the output more random and diverse, while lower values (e.g. 0.2) make the output more focused and deterministic.

Possible values: 0 < value < 2

Environment variable: QUARKUS_LANGCHAIN4J_WATSONX__MODEL_NAME__CHAT_MODEL_TEMPERATURE

double

${quarkus.langchain4j.temperature:1.0}

An alternative to sampling with temperature, called nucleus sampling, where the model considers the results of the tokens with top_p probability mass. So 0.1 means only the tokens comprising the top 10% probability mass are considered.

The parameter is sent to the model only when it is set.

Possible values: 0 < value < 1

Environment variable: QUARKUS_LANGCHAIN4J_WATSONX__MODEL_NAME__CHAT_MODEL_TOP_P

double

Specifies the desired format for the model’s output.

Allowable values: [text, json, json_schema]

Environment variable: QUARKUS_LANGCHAIN4J_WATSONX__MODEL_NAME__CHAT_MODEL_RESPONSE_FORMAT

text, json, json-schema

Whether the JSON Schema sent to the model should use the strict mode.

When enabled, the model is constrained to return a response that exactly matches the given JSON Schema. To satisfy the restrictions of the strict mode, all the properties of the schema are marked as required, the optional ones are made nullable and additionalProperties is set to false.

Set this property to false to let the model treat the schema as a hint instead of a constraint.

Environment variable: QUARKUS_LANGCHAIN4J_WATSONX__MODEL_NAME__CHAT_MODEL_STRICT_JSON_SCHEMA

boolean

true

Whether chat model requests should be logged.

Environment variable: QUARKUS_LANGCHAIN4J_WATSONX__MODEL_NAME__CHAT_MODEL_LOG_REQUESTS

boolean

false

Whether chat model responses should be logged.

Environment variable: QUARKUS_LANGCHAIN4J_WATSONX__MODEL_NAME__CHAT_MODEL_LOG_RESPONSES

boolean

false

Whether the watsonx.ai client should log requests as cURL commands.

Environment variable: QUARKUS_LANGCHAIN4J_WATSONX__MODEL_NAME__CHAT_MODEL_LOG_REQUESTS_CURL

boolean

false

Specifies a set of allowed output choices.

When this parameter is set, the model is constrained to return exactly one of the provided choices.

Environment variable: QUARKUS_LANGCHAIN4J_WATSONX__MODEL_NAME__CHAT_MODEL_GUIDED_CHOICE

list of string

Constrains the model output to follow a context-free grammar.

If specified, the generated output will conform to the defined grammar.

Environment variable: QUARKUS_LANGCHAIN4J_WATSONX__MODEL_NAME__CHAT_MODEL_GUIDED_GRAMMAR

string

Constrains the model output to match a regular expression pattern.

If specified, the generated output must conform to the provided regex.

Environment variable: QUARKUS_LANGCHAIN4J_WATSONX__MODEL_NAME__CHAT_MODEL_GUIDED_REGEX

string

Sets the length penalty to be applied during text generation. This penalty influences the length of the generated text. A length penalty discourages the model from generating overly long responses, or conversely, it can encourage more extended outputs.

When the penalty value is greater than 1.0, it discourages generating longer responses. Conversely, a value less than 1.0 incentivizes the model to generate longer text. A value of 1.0 means no penalty, and the length of the output will be determined by other factors, such as the input prompt and model’s natural completion behavior.

Environment variable: QUARKUS_LANGCHAIN4J_WATSONX__MODEL_NAME__CHAT_MODEL_LENGTH_PENALTY

double

Sets the repetition penalty to be applied during text generation. This penalty helps to discourage the model from repeating the same words or phrases too often.

The penalty value should be greater than 1.0 for repetition discouragement. A value of 1.0 means no penalty, and values above 1.0 increase the strength of the penalty.

Environment variable: QUARKUS_LANGCHAIN4J_WATSONX__MODEL_NAME__CHAT_MODEL_REPETITION_PENALTY

double

Enables or disables reasoning.

Environment variable: QUARKUS_LANGCHAIN4J_WATSONX__MODEL_NAME__CHAT_MODEL_THINKING_ENABLED

boolean

The opening delimiter for the model’s internal reasoning section.

Environment variable: QUARKUS_LANGCHAIN4J_WATSONX__MODEL_NAME__CHAT_MODEL_THINKING_TAGS_THINK_OPENING

string

required

The closing delimiter for the model’s internal reasoning section.

Environment variable: QUARKUS_LANGCHAIN4J_WATSONX__MODEL_NAME__CHAT_MODEL_THINKING_TAGS_THINK_CLOSING

string

required

The opening delimiter for the model’s final response section.

Environment variable: QUARKUS_LANGCHAIN4J_WATSONX__MODEL_NAME__CHAT_MODEL_THINKING_TAGS_RESPONSE_OPENING

string

required

The closing delimiter for the model’s final response section.

Environment variable: QUARKUS_LANGCHAIN4J_WATSONX__MODEL_NAME__CHAT_MODEL_THINKING_TAGS_RESPONSE_CLOSING

string

required

Controls the reasoning effort level for models that separate reasoning and response automatically.

Example values: LOW, MEDIUM, HIGH.

Environment variable: QUARKUS_LANGCHAIN4J_WATSONX__MODEL_NAME__CHAT_MODEL_THINKING_EFFORT

low, medium, high

Determines whether the reasoning portion returned by the model should be included in the final response provided to the application.

Environment variable: QUARKUS_LANGCHAIN4J_WATSONX__MODEL_NAME__CHAT_MODEL_THINKING_INCLUDE_REASONING

boolean

Specifies the model to use for the chat completion.

A list of all available models is provided in the IBM watsonx.ai documentation at the this link.

To use a model, locate the API model ID column in the table and copy the corresponding model ID.

Environment variable: QUARKUS_LANGCHAIN4J_WATSONX__MODEL_NAME__CHAT_MODEL_MODEL_NAME

string

ibm/granite-4-h-small

Specifies how the model should choose which tool to call during a request.

This value can be:

  • auto: The model decides whether and which tool to call automatically.

  • required: The model must call one of the available tools.

If toolChoiceName is set, this value is ignored.

Setting this value influences the tool-calling behavior of the model when no specific tool is required.

Environment variable: QUARKUS_LANGCHAIN4J_WATSONX__MODEL_NAME__DEPLOYMENT_CHAT_MODEL_TOOL_CHOICE

auto, required, none

Specifies the name of a specific tool that the model must call.

When set, the model will be forced to call the specified tool. The name must exactly match one of the available tools defined for the service.

Environment variable: QUARKUS_LANGCHAIN4J_WATSONX__MODEL_NAME__DEPLOYMENT_CHAT_MODEL_TOOL_CHOICE_NAME

string

Positive values penalize new tokens based on their existing frequency in the generated text, reducing the likelihood of the model repeating the same lines verbatim.

The parameter is sent to the model only when it is set.

Possible values: -2 < value < 2

Environment variable: QUARKUS_LANGCHAIN4J_WATSONX__MODEL_NAME__DEPLOYMENT_CHAT_MODEL_FREQUENCY_PENALTY

double

Specifies whether to return the log probabilities of the output tokens.

If set to true, the response will include the log probability of each output token in the content of the message.

The parameter is sent to the model only when it is set.

Environment variable: QUARKUS_LANGCHAIN4J_WATSONX__MODEL_NAME__DEPLOYMENT_CHAT_MODEL_LOGPROBS

boolean

An integer specifying the number of most likely tokens to return at each token position, each with an associated log probability. The option logprobs must be set to true if this parameter is used.

Possible values: 0 ≤ value ≤ 20

Environment variable: QUARKUS_LANGCHAIN4J_WATSONX__MODEL_NAME__DEPLOYMENT_CHAT_MODEL_TOP_LOGPROBS

int

The maximum number of tokens that can be generated in the chat completion. The total length of input tokens and generated tokens is limited by the model’s context length. Set to 0 for the model’s configured max generated tokens.

Environment variable: QUARKUS_LANGCHAIN4J_WATSONX__MODEL_NAME__DEPLOYMENT_CHAT_MODEL_MAX_OUTPUT_TOKENS

int

1024

Applies a penalty to new tokens based on whether they already appear in the generated text so far, encouraging the model to introduce new topics rather than repeat itself.

The parameter is sent to the model only when it is set.

Possible values: -2 < value < 2

Environment variable: QUARKUS_LANGCHAIN4J_WATSONX__MODEL_NAME__DEPLOYMENT_CHAT_MODEL_PRESENCE_PENALTY

double

Random number generator seed to use in sampling mode for experimental repeatability.

Environment variable: QUARKUS_LANGCHAIN4J_WATSONX__MODEL_NAME__DEPLOYMENT_CHAT_MODEL_SEED

int

Defines one or more stop sequences that will cause the model to stop generating further tokens if any of them are encountered in the output.

This allows control over where the model should end its response. If a stop sequence is encountered before the minimum number of tokens has been generated, it will be ignored.

Possible values: 0 ≤ number of items ≤ 4

Environment variable: QUARKUS_LANGCHAIN4J_WATSONX__MODEL_NAME__DEPLOYMENT_CHAT_MODEL_STOP

list of string

Specifies the sampling temperature to use in the generation process.

Higher values (e.g. 0.8) make the output more random and diverse, while lower values (e.g. 0.2) make the output more focused and deterministic.

Possible values: 0 < value < 2

Environment variable: QUARKUS_LANGCHAIN4J_WATSONX__MODEL_NAME__DEPLOYMENT_CHAT_MODEL_TEMPERATURE

double

${quarkus.langchain4j.temperature:1.0}

An alternative to sampling with temperature, called nucleus sampling, where the model considers the results of the tokens with top_p probability mass. So 0.1 means only the tokens comprising the top 10% probability mass are considered.

The parameter is sent to the model only when it is set.

Possible values: 0 < value < 1

Environment variable: QUARKUS_LANGCHAIN4J_WATSONX__MODEL_NAME__DEPLOYMENT_CHAT_MODEL_TOP_P

double

Specifies the desired format for the model’s output.

Allowable values: [text, json, json_schema]

Environment variable: QUARKUS_LANGCHAIN4J_WATSONX__MODEL_NAME__DEPLOYMENT_CHAT_MODEL_RESPONSE_FORMAT

text, json, json-schema

Whether the JSON Schema sent to the model should use the strict mode.

When enabled, the model is constrained to return a response that exactly matches the given JSON Schema. To satisfy the restrictions of the strict mode, all the properties of the schema are marked as required, the optional ones are made nullable and additionalProperties is set to false.

Set this property to false to let the model treat the schema as a hint instead of a constraint.

Environment variable: QUARKUS_LANGCHAIN4J_WATSONX__MODEL_NAME__DEPLOYMENT_CHAT_MODEL_STRICT_JSON_SCHEMA

boolean

true

Whether chat model requests should be logged.

Environment variable: QUARKUS_LANGCHAIN4J_WATSONX__MODEL_NAME__DEPLOYMENT_CHAT_MODEL_LOG_REQUESTS

boolean

false

Whether chat model responses should be logged.

Environment variable: QUARKUS_LANGCHAIN4J_WATSONX__MODEL_NAME__DEPLOYMENT_CHAT_MODEL_LOG_RESPONSES

boolean

false

Whether the watsonx.ai client should log requests as cURL commands.

Environment variable: QUARKUS_LANGCHAIN4J_WATSONX__MODEL_NAME__DEPLOYMENT_CHAT_MODEL_LOG_REQUESTS_CURL

boolean

false

Specifies a set of allowed output choices.

When this parameter is set, the model is constrained to return exactly one of the provided choices.

Environment variable: QUARKUS_LANGCHAIN4J_WATSONX__MODEL_NAME__DEPLOYMENT_CHAT_MODEL_GUIDED_CHOICE

list of string

Constrains the model output to follow a context-free grammar.

If specified, the generated output will conform to the defined grammar.

Environment variable: QUARKUS_LANGCHAIN4J_WATSONX__MODEL_NAME__DEPLOYMENT_CHAT_MODEL_GUIDED_GRAMMAR

string

Constrains the model output to match a regular expression pattern.

If specified, the generated output must conform to the provided regex.

Environment variable: QUARKUS_LANGCHAIN4J_WATSONX__MODEL_NAME__DEPLOYMENT_CHAT_MODEL_GUIDED_REGEX

string

Sets the length penalty to be applied during text generation. This penalty influences the length of the generated text. A length penalty discourages the model from generating overly long responses, or conversely, it can encourage more extended outputs.

When the penalty value is greater than 1.0, it discourages generating longer responses. Conversely, a value less than 1.0 incentivizes the model to generate longer text. A value of 1.0 means no penalty, and the length of the output will be determined by other factors, such as the input prompt and model’s natural completion behavior.

Environment variable: QUARKUS_LANGCHAIN4J_WATSONX__MODEL_NAME__DEPLOYMENT_CHAT_MODEL_LENGTH_PENALTY

double

Sets the repetition penalty to be applied during text generation. This penalty helps to discourage the model from repeating the same words or phrases too often.

The penalty value should be greater than 1.0 for repetition discouragement. A value of 1.0 means no penalty, and values above 1.0 increase the strength of the penalty.

Environment variable: QUARKUS_LANGCHAIN4J_WATSONX__MODEL_NAME__DEPLOYMENT_CHAT_MODEL_REPETITION_PENALTY

double

Enables or disables reasoning.

Environment variable: QUARKUS_LANGCHAIN4J_WATSONX__MODEL_NAME__DEPLOYMENT_CHAT_MODEL_THINKING_ENABLED

boolean

The opening delimiter for the model’s internal reasoning section.

Environment variable: QUARKUS_LANGCHAIN4J_WATSONX__MODEL_NAME__DEPLOYMENT_CHAT_MODEL_THINKING_TAGS_THINK_OPENING

string

required

The closing delimiter for the model’s internal reasoning section.

Environment variable: QUARKUS_LANGCHAIN4J_WATSONX__MODEL_NAME__DEPLOYMENT_CHAT_MODEL_THINKING_TAGS_THINK_CLOSING

string

required

The opening delimiter for the model’s final response section.

Environment variable: QUARKUS_LANGCHAIN4J_WATSONX__MODEL_NAME__DEPLOYMENT_CHAT_MODEL_THINKING_TAGS_RESPONSE_OPENING

string

required

The closing delimiter for the model’s final response section.

Environment variable: QUARKUS_LANGCHAIN4J_WATSONX__MODEL_NAME__DEPLOYMENT_CHAT_MODEL_THINKING_TAGS_RESPONSE_CLOSING

string

required

Controls the reasoning effort level for models that separate reasoning and response automatically.

Example values: LOW, MEDIUM, HIGH.

Environment variable: QUARKUS_LANGCHAIN4J_WATSONX__MODEL_NAME__DEPLOYMENT_CHAT_MODEL_THINKING_EFFORT

low, medium, high

Determines whether the reasoning portion returned by the model should be included in the final response provided to the application.

Environment variable: QUARKUS_LANGCHAIN4J_WATSONX__MODEL_NAME__DEPLOYMENT_CHAT_MODEL_THINKING_INCLUDE_REASONING

boolean

The deployment ID of the model deployed in watsonx.ai.

Setting this property routes all chat requests to the deployment chat API.

Environment variable: QUARKUS_LANGCHAIN4J_WATSONX__MODEL_NAME__DEPLOYMENT_CHAT_MODEL_DEPLOYMENT_ID

string

Specifies how the model should choose which tool to call during a request.

This value can be:

  • auto: The model decides whether and which tool to call automatically.

  • required: The model must call one of the available tools.

If toolChoiceName is set, this value is ignored.

Setting this value influences the tool-calling behavior of the model when no specific tool is required.

Environment variable: QUARKUS_LANGCHAIN4J_WATSONX__MODEL_NAME__GATEWAY_CHAT_MODEL_TOOL_CHOICE

auto, required, none

Specifies the name of a specific tool that the model must call.

When set, the model will be forced to call the specified tool. The name must exactly match one of the available tools defined for the service.

Environment variable: QUARKUS_LANGCHAIN4J_WATSONX__MODEL_NAME__GATEWAY_CHAT_MODEL_TOOL_CHOICE_NAME

string

Positive values penalize new tokens based on their existing frequency in the generated text, reducing the likelihood of the model repeating the same lines verbatim.

The parameter is sent to the model only when it is set.

Possible values: -2 < value < 2

Environment variable: QUARKUS_LANGCHAIN4J_WATSONX__MODEL_NAME__GATEWAY_CHAT_MODEL_FREQUENCY_PENALTY

double

Specifies whether to return the log probabilities of the output tokens.

If set to true, the response will include the log probability of each output token in the content of the message.

The parameter is sent to the model only when it is set.

Environment variable: QUARKUS_LANGCHAIN4J_WATSONX__MODEL_NAME__GATEWAY_CHAT_MODEL_LOGPROBS

boolean

An integer specifying the number of most likely tokens to return at each token position, each with an associated log probability. The option logprobs must be set to true if this parameter is used.

Possible values: 0 ≤ value ≤ 20

Environment variable: QUARKUS_LANGCHAIN4J_WATSONX__MODEL_NAME__GATEWAY_CHAT_MODEL_TOP_LOGPROBS

int

The maximum number of tokens that can be generated in the chat completion. The total length of input tokens and generated tokens is limited by the model’s context length. Set to 0 for the model’s configured max generated tokens.

Environment variable: QUARKUS_LANGCHAIN4J_WATSONX__MODEL_NAME__GATEWAY_CHAT_MODEL_MAX_OUTPUT_TOKENS

int

1024

Applies a penalty to new tokens based on whether they already appear in the generated text so far, encouraging the model to introduce new topics rather than repeat itself.

The parameter is sent to the model only when it is set.

Possible values: -2 < value < 2

Environment variable: QUARKUS_LANGCHAIN4J_WATSONX__MODEL_NAME__GATEWAY_CHAT_MODEL_PRESENCE_PENALTY

double

Random number generator seed to use in sampling mode for experimental repeatability.

Environment variable: QUARKUS_LANGCHAIN4J_WATSONX__MODEL_NAME__GATEWAY_CHAT_MODEL_SEED

int

Defines one or more stop sequences that will cause the model to stop generating further tokens if any of them are encountered in the output.

This allows control over where the model should end its response. If a stop sequence is encountered before the minimum number of tokens has been generated, it will be ignored.

Possible values: 0 ≤ number of items ≤ 4

Environment variable: QUARKUS_LANGCHAIN4J_WATSONX__MODEL_NAME__GATEWAY_CHAT_MODEL_STOP

list of string

Specifies the sampling temperature to use in the generation process.

Higher values (e.g. 0.8) make the output more random and diverse, while lower values (e.g. 0.2) make the output more focused and deterministic.

Possible values: 0 < value < 2

Environment variable: QUARKUS_LANGCHAIN4J_WATSONX__MODEL_NAME__GATEWAY_CHAT_MODEL_TEMPERATURE

double

${quarkus.langchain4j.temperature:1.0}

An alternative to sampling with temperature, called nucleus sampling, where the model considers the results of the tokens with top_p probability mass. So 0.1 means only the tokens comprising the top 10% probability mass are considered.

The parameter is sent to the model only when it is set.

Possible values: 0 < value < 1

Environment variable: QUARKUS_LANGCHAIN4J_WATSONX__MODEL_NAME__GATEWAY_CHAT_MODEL_TOP_P

double

Specifies the desired format for the model’s output.

Allowable values: [text, json, json_schema]

Environment variable: QUARKUS_LANGCHAIN4J_WATSONX__MODEL_NAME__GATEWAY_CHAT_MODEL_RESPONSE_FORMAT

text, json, json-schema

Whether the JSON Schema sent to the model should use the strict mode.

When enabled, the model is constrained to return a response that exactly matches the given JSON Schema. To satisfy the restrictions of the strict mode, all the properties of the schema are marked as required, the optional ones are made nullable and additionalProperties is set to false.

Set this property to false to let the model treat the schema as a hint instead of a constraint.

Environment variable: QUARKUS_LANGCHAIN4J_WATSONX__MODEL_NAME__GATEWAY_CHAT_MODEL_STRICT_JSON_SCHEMA

boolean

true

Whether chat model requests should be logged.

Environment variable: QUARKUS_LANGCHAIN4J_WATSONX__MODEL_NAME__GATEWAY_CHAT_MODEL_LOG_REQUESTS

boolean

false

Whether chat model responses should be logged.

Environment variable: QUARKUS_LANGCHAIN4J_WATSONX__MODEL_NAME__GATEWAY_CHAT_MODEL_LOG_RESPONSES

boolean

false

Whether the watsonx.ai client should log requests as cURL commands.

Environment variable: QUARKUS_LANGCHAIN4J_WATSONX__MODEL_NAME__GATEWAY_CHAT_MODEL_LOG_REQUESTS_CURL

boolean

false

The identifier of the model to use, as configured in the Model Gateway (for example openai/gpt-4o-mini).

Setting this property routes all chat requests to the Model Gateway.

Environment variable: QUARKUS_LANGCHAIN4J_WATSONX__MODEL_NAME__GATEWAY_CHAT_MODEL_MODEL_NAME

string

Specifies the latency tier used to serve the request.

Allowable values: [auto, default, flex, priority]

Environment variable: QUARKUS_LANGCHAIN4J_WATSONX__MODEL_NAME__GATEWAY_CHAT_MODEL_SERVICE_TIER

auto, default, flex, priority

Constrains the effort spent on reasoning for reasoning models.

Reducing the reasoning effort can result in faster responses and fewer tokens used on reasoning.

Allowable values: [low, medium, high]

Environment variable: QUARKUS_LANGCHAIN4J_WATSONX__MODEL_NAME__GATEWAY_CHAT_MODEL_REASONING_EFFORT

low, medium, high

Whether the semantic cache is enabled.

Environment variable: QUARKUS_LANGCHAIN4J_WATSONX__MODEL_NAME__GATEWAY_CHAT_MODEL_CACHE_ENABLED

boolean

true

The similarity threshold a cached entry must reach to be served instead of calling the model.

Environment variable: QUARKUS_LANGCHAIN4J_WATSONX__MODEL_NAME__GATEWAY_CHAT_MODEL_CACHE_THRESHOLD

double

provider specific

The output types that the model is requested to generate.

Most models are only able to generate text, which is the default.

Environment variable: QUARKUS_LANGCHAIN4J_WATSONX__MODEL_NAME__GATEWAY_CHAT_MODEL_MODALITIES

list of string

Whether the generated output should be stored for model distillation or evaluations.

Environment variable: QUARKUS_LANGCHAIN4J_WATSONX__MODEL_NAME__GATEWAY_CHAT_MODEL_STORE

boolean

Whether the model is allowed to run tool calls in parallel.

Environment variable: QUARKUS_LANGCHAIN4J_WATSONX__MODEL_NAME__GATEWAY_CHAT_MODEL_PARALLEL_TOOL_CALLS

boolean

A stable identifier of the end user issuing the request, used by the backing provider to detect and prevent abuse.

Environment variable: QUARKUS_LANGCHAIN4J_WATSONX__MODEL_NAME__GATEWAY_CHAT_MODEL_USER

string

A set of key/value pairs that is attached to the request and returned with the response.

Environment variable: QUARKUS_LANGCHAIN4J_WATSONX__MODEL_NAME__GATEWAY_CHAT_MODEL_METADATA__METADATA_KEY_

Map<String,String>

Specifies the ID of the model to be used.

A list of all available models is provided in the IBM watsonx.ai documentation at the this link.

To use a model, locate the API model ID column in the table and copy the corresponding model ID.

Environment variable: QUARKUS_LANGCHAIN4J_WATSONX__MODEL_NAME__EMBEDDING_MODEL_MODEL_NAME

string

ibm/granite-embedding-278m-multilingual

Whether embedding model requests should be logged.

Environment variable: QUARKUS_LANGCHAIN4J_WATSONX__MODEL_NAME__EMBEDDING_MODEL_LOG_REQUESTS

boolean

false

Whether embedding model responses should be logged.

Environment variable: QUARKUS_LANGCHAIN4J_WATSONX__MODEL_NAME__EMBEDDING_MODEL_LOG_RESPONSES

boolean

false

Whether the watsonx.ai client should log requests as cURL commands.

Environment variable: QUARKUS_LANGCHAIN4J_WATSONX__MODEL_NAME__EMBEDDING_MODEL_LOG_REQUESTS_CURL

boolean

false

The id of the model to be used.

All available models are listed in the IBM Watsonx.ai documentation at the link: following link.

To use a model, locate the API model_id column in the table and copy the corresponding model ID.

Environment variable: QUARKUS_LANGCHAIN4J_WATSONX__MODEL_NAME__SCORING_MODEL_MODEL_NAME

string

cross-encoder/ms-marco-minilm-l-12-v2

Whether embedding model requests should be logged.

Environment variable: QUARKUS_LANGCHAIN4J_WATSONX__MODEL_NAME__SCORING_MODEL_LOG_REQUESTS

boolean

false

Whether embedding model responses should be logged.

Environment variable: QUARKUS_LANGCHAIN4J_WATSONX__MODEL_NAME__SCORING_MODEL_LOG_RESPONSES

boolean

false

Whether the watsonx.ai client should log requests as cURL commands.

Environment variable: QUARKUS_LANGCHAIN4J_WATSONX__MODEL_NAME__SCORING_MODEL_LOG_REQUESTS_CURL

boolean

false

Indicates whether the PII moderation model is enabled.

Environment variable: QUARKUS_LANGCHAIN4J_WATSONX__MODEL_NAME__MODERATION_MODEL_PII_ENABLED

boolean

required

Indicates whether the HAP moderation model is enabled.

Environment variable: QUARKUS_LANGCHAIN4J_WATSONX__MODEL_NAME__MODERATION_MODEL_HAP_ENABLED

boolean

required

Threshold value for HAP moderation model.

Environment variable: QUARKUS_LANGCHAIN4J_WATSONX__MODEL_NAME__MODERATION_MODEL_HAP_THRESHOLD

double

Indicates whether the GraniteGuardian moderation model is enabled.

Environment variable: QUARKUS_LANGCHAIN4J_WATSONX__MODEL_NAME__MODERATION_MODEL_GRANITE_GUARDIAN_ENABLED

boolean

required

Threshold value for Granite Guardian moderation model.

Environment variable: QUARKUS_LANGCHAIN4J_WATSONX__MODEL_NAME__MODERATION_MODEL_GRANITE_GUARDIAN_THRESHOLD

double

Whether moderation model requests should be logged.

Environment variable: QUARKUS_LANGCHAIN4J_WATSONX__MODEL_NAME__MODERATION_MODEL_LOG_REQUESTS

boolean

false

Whether moderation model responses should be logged.

Environment variable: QUARKUS_LANGCHAIN4J_WATSONX__MODEL_NAME__MODERATION_MODEL_LOG_RESPONSES

boolean

false

Whether the watsonx.ai client should log requests as cURL commands.

Environment variable: QUARKUS_LANGCHAIN4J_WATSONX__MODEL_NAME__MODERATION_MODEL_LOG_REQUESTS_CURL

boolean

false

About the Duration format

To write duration values, use the standard java.time.Duration format. See the Duration#parse() Java API documentation for more information.

You can also use a simplified format, starting with a number:

  • If the value is only a number, it represents time in seconds.

  • If the value is a number followed by ms, it represents time in milliseconds.

In other cases, the simplified format is translated to the java.time.Duration format for parsing:

  • If the value is a number followed by h, m, or s, it is prefixed with PT.

  • If the value is a number followed by d, it is prefixed with P.