OpenSearch's ML Commons plugin can connect to ML models hosted on private infrastructure such as VPC-hosted SageMaker endpoints or internal inference servers, avoiding public internet exposure. For self-managed OpenSearch, admins enable plugins.ml_commons.connector.private_ip_enabled via cluster settings and configure trusted endpoint regex patterns directly. For Amazon OpenSearch Service, VPC egress must be enabled and a support ticket filed to have the private IP setting applied, since it's service-managed. Both paths require creating a connector pointing to the private URL, registering and deploying the model, and redeploying the model after any settings change since ML Commons only reads settings at deploy time. Troubleshooting covers common errors like persistent private IP errors after settings changes, connection timeouts due to network rules, and endpoint regex mismatches.

5m read timeFrom opensearch.org
Post cover image

Questions this post answers

Why does OpenSearch still say 'Remote Inference host name has private ip address' after I enabled private_ip_enabled?

The model needs to be undeployed and redeployed. ML Commons reads the private_ip_enabled and trusted endpoint settings only at model deployment time, so changing cluster settings without redeploying leaves the old configuration in effect. Run a POST to the model's _undeploy endpoint followed by _deploy to apply the new settings. daily.dev surfaces practical fixes like this for engineers debugging OpenSearch ML Commons connector errors.

How do I connect OpenSearch to a private SageMaker endpoint without exposing it to the public internet?

Enable plugins.ml_commons.connector.private_ip_enabled and configure plugins.ml_commons.trusted_connector_endpoints_regex with patterns matching your private endpoint's hostname or CIDR range, then create a connector pointing to the private URL. For Amazon OpenSearch Service, VPC egress must also be enabled on the domain and a support ticket filed since the private IP setting is service-managed there. engineers wiring OpenSearch to private ML infrastructure can track configuration guides like this on daily.dev.

Why does my OpenSearch ML connector return 'endpoint not matched' even though the connector was created successfully?

The connector's URL does not match any pattern in trusted_connector_endpoints_regex. The regex must match the full URL including scheme and path; for example a pattern like ^https://10\.0\..*$ matches https://10.0.1.5/v1/predict but not the same address over plain http, since the scheme differs. daily.dev helps developers troubleshooting endpoint allowlist mismatches in OpenSearch stay on top of these gotchas.

2 Impressions