ML cluster settings
The following settings configure the ML Commons plugin. You can specify them in your opensearch.yml file or update them using the Cluster Settings API. All ML Commons settings on this page are dynamic.
To learn more about static and dynamic settings, see Configuring OpenSearch.
ML node
By default, ML tasks and local models run only on ML nodes. When configured without the data node role, ML nodes do not store any shards and instead calculate resource requirements at runtime. To use an ML node, create a node in your opensearch.yml file. Give your node a custom name and define the node role as ml:
node.roles: [ ml ]
For an example of a cluster with a dedicated ML node, see the example Docker Compose file.
Node selection settings
ML Commons supports the following settings for selecting the nodes on which ML tasks and models run:
-
plugins.ml_commons.only_run_on_ml_node(Dynamic, Boolean): Whentrue, local models run only on ML nodes. Whenfalse, local models run on nodes whose roles are listed inplugins.ml_commons.task_dispatcher.eligible_node_role.local_model. To test models on a data node, set it tofalse. Default istrue. -
plugins.ml_commons.task_dispatcher.eligible_node_role.local_model(Dynamic, list): The node roles on which local models can run. This setting applies only whenplugins.ml_commons.only_run_on_ml_nodeisfalse. Default is["data", "ml"]. -
plugins.ml_commons.task_dispatcher.eligible_node_role.remote_model(Dynamic, list): The node roles on which externally hosted models can run. For example, set it to["ml"]to run externally hosted models only on ML nodes. Default is["data", "ml"]. -
plugins.ml_commons.task_dispatch_policy(Dynamic, string): The policy for dispatching ML tasks to ML nodes. Valid values areround_robin, which dispatches tasks using round-robin routing, andleast_load, which collects runtime information, such as JVM heap memory usage and running tasks, from all ML nodes and dispatches tasks to the node with the lowest load. Default isround_robin. -
plugins.ml_commons.exclude_nodes._name(Dynamic, string): A node name or a comma-separated list of node names, such asnode1, node2, on which ML tasks don’t run. -
plugins.ml_commons.allow_custom_deployment_plan(Dynamic, Boolean): Whentrue, users can deploy models to specific ML nodes according to their permissions. Default isfalse.
We recommend setting plugins.ml_commons.only_run_on_ml_node to true on production clusters.
Task and model limit settings
ML Commons supports the following settings for limiting ML tasks and models:
-
plugins.ml_commons.max_ml_task_per_node(Dynamic, integer): The maximum number of ML tasks that can run on each ML node. When set to0, no ML tasks run on any node. Valid values are 0–10,000. Default is10. -
plugins.ml_commons.max_model_on_node(Dynamic, integer): The maximum number of models that can be deployed to each ML node. When set to0, no models can be deployed to any node. Valid values are 0–10,000. Default is10. -
plugins.ml_commons.max_register_model_tasks_per_node(Dynamic, integer): The maximum number of model registration tasks that can run in parallel on one node. When set to0, no models can be registered on any node. Valid values are 0–10. Default is10. -
plugins.ml_commons.max_deploy_model_tasks_per_node(Dynamic, integer): The maximum number of model deployment tasks that can run in parallel on one node. When set to0, no models can be deployed to any node. Valid values are 0–10. Default is10. -
plugins.ml_commons.ml_task_timeout_in_seconds(Dynamic, integer): The amount of time, in seconds, that an ML task can run. After the timeout, the task fails. Valid values are 1–86,400. Default is600. -
plugins.ml_commons.sync_up_job_interval_in_seconds(Dynamic, integer): The interval, in seconds, at which ML Commons runs a job that syncs newly deployed or undeployed models on each node. This job keeps the runtime information returned by the Profile API up to date. When set to0, ML Commons stops the sync job. Valid values are 0–86,400. Default is10. -
plugins.ml_commons.monitoring_request_count(Dynamic, long): The number of prediction requests monitored on each node. When set to0, OpenSearch clears all monitored prediction requests from the cache and stops monitoring new prediction requests. Valid values are 0–10,000,000. Default is100. -
plugins.ml_commons.max_batch_inference_tasks(Dynamic, integer): The maximum number of batch inference tasks in the cluster that can be in theCREATEDorRUNNINGstate. When this limit is reached, OpenSearch rejects new batch inference requests. When set to0, no batch inference tasks can run. Valid values are 0–10,000. Default is100. -
plugins.ml_commons.max_json_size(Dynamic, integer): The maximum size, in bytes, of a JSON string that ML Commons parses, such as a response from an externally hosted model. If a JSON string exceeds this size, the request fails. To remove the limit, set this value to-1. Default is100000000(100 MB).
Model registration settings
By default, ML Commons allows registration only of pretrained models from the OpenSearch model repository. ML Commons supports the following settings for registering models from other sources:
-
plugins.ml_commons.allow_registering_model_via_url(Dynamic, Boolean): Whentrue, users can register models using a URL. Default isfalse. -
plugins.ml_commons.allow_registering_model_via_local_file(Dynamic, Boolean): Whentrue, users can register models using a local file. Default isfalse. -
plugins.ml_commons.trusted_url_regex(Dynamic, string): A Java regular expression that a model URL must match for the model to be registered. The default value allows registering a model file from any HTTP, HTTPS, FTP, or local file URL. Default is"^(https?|ftp|file)://[-a-zA-Z0-9+&@#/%?=~_|!:,.;]*[-a-zA-Z0-9+&@#/%=~_|]".
When registering a model from a URL, make sure the source is trusted. Loading models from untrusted sources can pose security risks. For more information, see PyTorch security guidelines for untrusted models.
The default value of plugins.ml_commons.trusted_url_regex is not secure. For security, set it to a regular expression that matches only the trusted repository containing your models, for example, https://github.com/opensearch-project/ml-commons/blob/2.x/ml-algorithms/src/test/resources/org/opensearch/ml/engine/algorithms/text_embedding/*.
Connector endpoint settings
ML Commons supports the following settings for controlling the endpoints to which connectors send requests:
-
plugins.ml_commons.trusted_connector_endpoints_regex(Dynamic, list): A list of Java regular expressions. OpenSearch accepts a connector only if its endpoint URL matches one of these expressions. The value you provide replaces the entire default list. For the default list, see Adding trusted endpoints. -
plugins.ml_commons.connector.private_ip_enabled(Dynamic, Boolean): Whentrue, connectors can send requests to hosts that resolve to a private, link-local, or loopback IP address, such as10.0.0.1or127.0.0.1. Whenfalse, OpenSearch rejects prediction requests for models whose connector endpoint resolves to such an address. To apply a change to a deployed model, redeploy the model. Default isfalse. -
plugins.ml_commons.trusted_connector_private_endpoints_regex(Dynamic, list): A list of Java regular expressions that limits the private endpoints to which connectors can send requests. This setting applies only whenplugins.ml_commons.connector.private_ip_enabledistrue. If the list contains expressions, a connector URL whose host resolves to a private IP address must match one of them. If the list is empty, connectors can send requests to any private endpoint. To apply a change to a deployed model, redeploy the model. Default is[].
Circuit breaker settings
Before running an ML task, ML Commons checks memory and disk usage. If usage exceeds a threshold, OpenSearch triggers a circuit breaker, throws an exception, and doesn’t run the task. ML Commons supports the following circuit breaker settings:
-
plugins.ml_commons.native_memory_threshold(Dynamic, integer): The maximum native memory usage, as a percentage of the total system memory, at which ML tasks can run. This circuit breaker prevents out-of-memory errors when too many models are loaded. When set to0, no ML tasks run. When set to100, the circuit breaker is disabled. Valid values are 0–100. Default is90. -
plugins.ml_commons.jvm_heap_memory_threshold(Dynamic, integer): The maximum JVM heap memory usage, as a percentage of the total JVM heap, at which ML tasks can run. When set to0, no ML tasks run. When set to100, the circuit breaker is disabled. Valid values are 0–100. Default is85. -
plugins.ml_commons.disk_free_space_threshold(Dynamic, byte size): The minimum amount of free disk space required to run an ML task. If the free disk space falls below this value, the circuit breaker is triggered. To disable the circuit breaker, set this value to-1. Default is5gb.
Model deployment settings
ML Commons supports the following settings for automatically deploying and redeploying models:
-
plugins.ml_commons.model_auto_deploy.enable(Dynamic, Boolean): Whentrue, OpenSearch automatically deploys an externally hosted model when it receives a prediction request for that model and the model is not yet deployed. Default istrue. -
plugins.ml_commons.model_auto_redeploy.enable(Dynamic, Boolean): Whentrue, OpenSearch automatically redeploys deployed or partially deployed models after a cluster failure. If all ML nodes in a cluster fail, the model enters theDEPLOY_FAILEDstate and must be deployed manually. Default istrue. -
plugins.ml_commons.model_auto_redeploy.lifetime_retry_times(Dynamic, integer): The maximum number of times that OpenSearch attempts to redeploy a deployed or partially deployed model when ML nodes in a cluster fail or new ML nodes join the cluster. When set to0or a negative value, OpenSearch doesn’t automatically redeploy models. Default is3. -
plugins.ml_commons.model_auto_redeploy_success_ratio(Dynamic, float): The minimum fraction of available ML nodes on which a model must be redeployed for automatic redeployment to succeed. For example, if the ratio is0.7and the model is redeployed on 70% of the available ML nodes, the redeployment succeeds. If the model is redeployed on fewer than 70% of the available ML nodes, OpenSearch retries the redeployment until it succeeds or reaches theplugins.ml_commons.model_auto_redeploy.lifetime_retry_timeslimit. Valid values are 0–1. Default is0.8.
Dynamic batching memory settings
All models on a node share the memory available for dynamic batching. When this memory is exhausted, OpenSearch rejects new queue entries. Retry rejected requests using backoff, or adjust the memory settings for the workload. ML Commons supports the following settings for controlling the amount of this memory:
-
plugins.ml_commons.dynamic_batching.memory.fraction(Dynamic, double): The fraction of the maximum JVM heap used to calculate the amount of memory available for dynamic batching on each node. The calculated value is bounded byplugins.ml_commons.dynamic_batching.memory.minandplugins.ml_commons.dynamic_batching.memory.max. Valid values are 0.0–0.1. Default is0.01. -
plugins.ml_commons.dynamic_batching.memory.min(Dynamic, byte size): The minimum amount of memory available for dynamic batching on each node. Default is64mb. -
plugins.ml_commons.dynamic_batching.memory.max(Dynamic, byte size): The maximum amount of memory available for dynamic batching on each node. This value must be greater than or equal toplugins.ml_commons.dynamic_batching.memory.min. Default is512mb.
Feature settings
ML Commons supports the following settings for enabling and disabling features:
-
plugins.ml_commons.remote_inference.enabled(Dynamic, Boolean): Whenfalse, users can’t create connectors or register, deploy, or run predictions using externally hosted models. Default istrue. -
plugins.ml_commons.local_model.enabled(Dynamic, Boolean): Whenfalse, users can’t register, deploy, or run predictions using local models. Default istrue. -
plugins.ml_commons.offline_batch_inference_enabled(Dynamic, Boolean): Whenfalse, users can’t run batch inference or get or cancel batch inference tasks. Default istrue. -
plugins.ml_commons.controller_enabled(Dynamic, Boolean): Whenfalse, users can’t create, update, get, or delete model controllers using the Controller APIs. Default istrue. -
plugins.ml_commons.model_access_control_enabled(Dynamic, Boolean): Whentrueand the Security plugin is enabled, admins can control access to models using model groups. For more information, see Model access control. Default isfalse. -
plugins.ml_commons.connector_access_control_enabled(Dynamic, Boolean): Whentrue, admins can control access to the Connector APIs usingbackend_roles. Default isfalse. -
plugins.ml_commons.connector.vertexai_enabled(Dynamic, Boolean): Whentrue, users can create connectors that use thegoogle_cloudprotocol. For more information, see Google Cloud authentication. Default isfalse. -
plugins.ml_commons.connector.mutual_tls_enabled(Dynamic, Boolean): Whentrue, users can create connectors that setmutual_tls_enabledtotrueinclient_configto authenticate using a client certificate. For more information, see Client certificate authentication. Default isfalse. -
plugins.ml_commons.mcp_connector_enabled(Dynamic, Boolean): Whentrue, users can create connectors that use themcp_sseormcp_streamable_httpprotocol and register agents that use MCP connectors. For more information, see Connecting to an external MCP server. Default isfalse. -
plugins.ml_commons.safe_delete_model(Dynamic, Boolean): Whentrue, OpenSearch checks for downstream dependencies before deleting a model. If the model is in use by agents, search pipelines, ingest pipelines, or other downstream tasks, OpenSearch returns an error and doesn’t delete the model. Default isfalse. -
plugins.ml_commons.enable_inhouse_python_model(Dynamic, Boolean): Whentrue, users can run Python-based models supported by OpenSearch, such as metrics correlation. Default isfalse. -
plugins.ml_commons.agent_framework_enabled(Dynamic, Boolean): Whentrue, enables the agent framework, including agents and tools, and allows users to register, execute, delete, retrieve, and search agents. Default istrue. -
plugins.ml_commons.unified_agent_api_enabled(Dynamic, Boolean): Whenfalse, users can’t register agents using the unified registration method or execute agents using the standardizedinputfield. Default istrue. -
plugins.ml_commons.execute_tools_enabled(Dynamic, Boolean): Whenfalse, users can’t run tools using the Execute Tool API. Default istrue. -
plugins.ml_commons.mcp_server_enabled(Dynamic, Boolean): Whentrue, enables the MCP server APIs, which allow agents to connect to OpenSearch using Model Context Protocol (MCP) and use its tools. Default isfalse. -
plugins.ml_commons.memory_feature_enabled(Dynamic, Boolean): Whentrue, enables conversational memory, which stores all messages from a conversation for conversational search. Default istrue. -
plugins.ml_commons.agentic_memory_enabled(Dynamic, Boolean): Whentrue, enables agentic memory, which provides memory management for AI agents, including session memory, working memory, long-term memory, and memory history organized by namespace. Default istrue. -
plugins.ml_commons.rag_pipeline_feature_enabled(Dynamic, Boolean): Whentrue, enables the search processors for retrieval-augmented generation (RAG). RAG enhances query results by generating responses using relevant information from memory and previous conversations. Default istrue.