Connecting OpenSearch to self-hosted embedding models with Ollama

A planning guide to wiring OpenSearch ML Commons connectors to a self-hosted Ollama server so embeddings and generation stay inside your network.

On this page

Connecting OpenSearch to Ollama keeps embeddings inside your network

A team that wants semantic search or retrieval-augmented generation on OpenSearch often has a simple constraint: the documents cannot leave the network to reach a hosted model API. ML Commons connectors solve the wiring part. A connector tells OpenSearch how to call an external model endpoint, and a connector blueprint provides a tested template for a specific platform. The OpenSearch connector blueprint docs list Ollama among the supported blueprints, alongside hosted providers such as OpenAI and Amazon Bedrock. The Ollama blueprint lets OpenSearch send text to an Ollama server that you run, so embeddings and generation can stay on hardware you control. Teams usually need this when data classification, contract terms or sector rules rule out sending content to a third-party inference service, or when they want to test local models before committing to one.

The part that needs the most planning is network placement. The local Ollama API at port 11434 does not require authentication by default, and Ollama binds to 127.0.0.1 unless the OLLAMA_HOST variable changes that. Moving the bind address so OpenSearch nodes can reach it is a single setting, but it also exposes an unauthenticated inference endpoint to anything else that can route to it. Before go-live, confirm which OpenSearch nodes or ML nodes need to reach Ollama, restrict that path with firewall rules or network segmentation, and place an authenticating reverse proxy in front if the wider network needs access. Ask your security team to test whether any other host can reach the port. Ollama's own documentation states that local runs do not expose your prompts to Ollama, but that statement covers the runtime, not your network exposure.

Plan the connector credentials and the cloud settings together. Ollama's cloud inference at its hosted API uses an API key sent as a Bearer token, which is a different path from the local server. If you want a guarantee that no traffic leaves the network, set OLLAMA_NO_CLOUD=1 on the server and confirm in testing that the connector only targets your internal endpoint. Store any API key that OpenSearch uses in the keystore or a secrets manager rather than in connector request bodies, and restrict the ML Commons access roles so that only the teams that own the model can create or update connectors. Confirm with your OpenSearch version which blueprint format and processor behavior apply, because the docs distinguish standard blueprints from legacy ones.

Request flow from OpenSearch to a self-hosted Ollama server

The diagram starts with indexing and query clients sending documents and searches to the OpenSearch cluster, where ingest and search processors call the ML Commons connector. The connector sends the request across the internal network boundary to an Ollama server bound to a private address on port 11434, and the embedding returns along the same path. Check that the connector endpoint resolves only to the private address, that no route leaves the boundary, and that the cloud inference path shown separately is not configured.

Embedding requests stay inside the network boundary, while cloud inference is a separate path.

Which Ollama bind, model and concurrency settings fit your cluster

This table compares the Ollama server settings that decide who can reach the embedding API, where models live, and how many requests run at once. Read each row as a choice with a documented default and a trade-off, then match it to how your OpenSearch cluster calls Ollama. The main takeaway is that the default loopback bind is the safest starting point, and every wider setting needs a proxy, network control and capacity check.

SettingDocumented default or behaviorWhen it fitsTrade-off
Bind address (default)127.0.0.1 on port 11434, no authentication on the local APIOllama runs on the same host as a connector proxy or a test environmentOpenSearch nodes on other hosts cannot reach it without further changes
Bind address via OLLAMA_HOSTChanged with the OLLAMA_HOST environment variableSeparate inference host on a private interface, called by OpenSearch ML nodesExposes an unauthenticated API unless a proxy adds access control and TLS
Reverse proxy in frontDocs describe exposing Ollama through proxies such as NginxYou need authentication, TLS, rate limits or logging at the network edgeProxy configuration and certificates become part of your operations scope
Model storage (OLLAMA_MODELS)Default paths differ by OS, such as /usr/share/ollama/.ollama/models on LinuxModels must sit on a dedicated volume sized and backed up separatelyMoving storage means checking ownership and permissions for the service user
Parallel requests (OLLAMA_NUM_PARALLEL)Default of 1 parallel request per modelLow embedding volume during testing or small indexing jobsHigher values raise memory use per loaded model and need capacity testing
Loaded models (OLLAMA_MAX_LOADED_MODELS)Default of 3 times the number of GPUs, or 3 on CPUOne embedding model plus a generation model on the same hostEach loaded model holds memory, so extra models can evict or starve others
Request queue (OLLAMA_MAX_QUEUE)Default of 512 queued requestsBulk ingestion from OpenSearch ingest pipelines that can waitA deep queue hides overload and delays failures back to the indexing job
Cloud features (OLLAMA_NO_CLOUD=1)Cloud features can be turned off with this variable or the server configuration fileData must stay inside your network and no cloud model calls are allowedCloud-only models become unavailable, so confirm which models your use case needs

Setup sequence for an Ollama connector in OpenSearch

This sequence takes a cluster from version checks to a verified embedding call, with Ollama kept on a private address and every model and connector step confirmed before the next one starts. The output is a registered Ollama-backed model that the cluster can call from inside your network.

  1. Confirm OpenSearch and ML Commons versions

    The cluster administrator records the OpenSearch version and the ML Commons plugin version on every node, then checks the connector blueprint for Ollama against that version in the OpenSearch connector blueprints documentation. Standard blueprints are recommended for OpenSearch 2.14 and later, so older clusters need a different blueprint choice and a documented reason for it. Confirm that the cluster is on a version still in maintenance, since the releases page describes maintenance as bug fixes and security patches only. The step is done when the version record and the chosen blueprint are written into the change ticket.

  2. Install and bind Ollama to a private address

    The platform team installs Ollama on a host that the OpenSearch ML nodes can reach over the internal network, using the install method approved for your servers. Ollama binds to 127.0.0.1 on port 11434 by default, so set the OLLAMA_HOST environment variable to a private interface address that the cluster can reach, and restrict that port with host firewall rules to the ML node subnet. Set OLLAMA_NO_CLOUD=1 if cloud features are not approved for this host. The step is done when a request from an ML node to the private address returns the Ollama version response, and a request from outside the allowed subnet fails.

  3. Pull the embedding model into the model directory

    Pull the embedding model you have approved onto the Ollama host, and confirm it lands in the directory you configured. Ollama stores models in a default location per operating system, and the OLLAMA_MODELS variable moves that directory, so set it before the first pull if your storage layout requires it. Record the model name, tag and file checksum in your asset inventory, since the model is part of the data path you will need to review. The step is done when the model appears in the local model list on the host and a direct generation or embedding request to the local API succeeds.

  4. Create the connector and register the model

    Create the connector using the Ollama blueprint, setting the endpoint to the private address and port of the Ollama host, the model name you pulled, and the embedding request body the blueprint expects. Then register the model against that connector and deploy it, using the ML Commons API calls from the connector documentation. Because the local Ollama API does not require authentication, restrict access to the connector and model group through OpenSearch roles so that only the ML service accounts can invoke them. The step is done when the registration returns a model ID and the model status reports as deployed.

  5. Enable ML access on the cluster

    A cluster administrator enables ML Commons settings that allow remote models to run on the cluster and sets which node roles can host ML workloads, following the ML Commons configuration in the OpenSearch documentation. Keep the setting scope narrow: enable only the connector endpoints you approved, and confirm that ML nodes are the only nodes running ML tasks where your architecture requires it. Record each setting value in the change ticket so the configuration can be reviewed during later audits. The step is done when the cluster settings show the intended values and a node stats check shows the ML role on the expected nodes.

  6. Test with a sample embedding call

    Send a test embedding request through the registered model ID, using a short, non-sensitive sample string, and check that the response returns a vector whose length matches the model's documented output dimension. Then run the same request from an account without ML permissions and confirm that it is refused. Review the OpenSearch and Ollama logs for the request, and confirm that the logs show the expected endpoint and no outbound traffic to external hosts. The step is done when the vector is returned, the unauthorized request is refused, and the logs match the intended data path.

Securing the Ollama endpoint and the OpenSearch connector

Ollama and OpenSearch connectors can move prompts, documents and credentials between systems that were never designed as one trust boundary. The cards below cover the risks that matter most when embeddings and generation stay inside your network, and the checks to run before any connector reaches production.

Unauthenticated local API

Ollama's REST API on port 11434 accepts requests without authentication when it runs locally. Anyone who can reach that port can run models, pull new ones and consume compute, and OpenSearch becomes the only thing standing between them and your data. Confirm which hosts can reach the port with a host firewall or network policy, and treat the API as open to every process on the same machine.

Ollama API authentication

Binding address changes exposure

Ollama binds to 127.0.0.1 on port 11434 by default. Changing the bind address with OLLAMA_HOST makes the API reachable from other hosts, which is often how the OpenSearch cluster reaches it. Put a reverse proxy such as Nginx in front of the service, terminate TLS there, and allow only the OpenSearch node addresses to connect. Document the change in your configuration management so it does not drift.

Ollama FAQ

Cloud credentials in connectors

Connector blueprints for hosted providers expect an API key, and that key is stored in the connector definition. A key pasted into a connector is readable by anyone who can read connector metadata, and it survives in snapshots and logs. Keep local Ollama connectors free of provider keys, use the server configuration to turn off cloud features where they are not needed, and confirm how your OpenSearch version stores and masks connector credentials before adding any hosted endpoint.

Roles for connectors and models

Creating a connector and deploying a model are powerful actions because they decide which endpoint your cluster calls and which data leaves the index. Use the OpenSearch Security plugin to restrict ML Commons management permissions to a small platform group, and give application users only the rights to run the predict or inference step. Test the roles with a non-admin account before go-live so that the separation is verified, not assumed.

OpenSearch security docs

Audit logging of request traffic

Connector calls carry the text that is embedded or generated, so request traffic is also a data trail. Enable OpenSearch audit logs for the ML actions and keep proxy access logs for the Ollama endpoint, with timestamps, calling identity and endpoint. Decide the retention period with your compliance team, and confirm that logs do not store full prompt bodies unless you have approved that. Review the logs on a schedule rather than only after an incident.

Where Ollama runs: workstation, shared server or GPU node

A developer laptop is the fastest way to confirm that a connector blueprint, the model name and the ingest or search processor work together before any shared infrastructure is involved. Ollama runs locally on macOS, Windows, Linux and Docker, and when it runs locally the Ollama FAQ states that it does not see your prompts or data. That makes a laptop suitable for test documents and sample queries, not for a copy of production data that has not been approved for that machine.

  • Model storage: Models default to the user's profile on the workstation, such as ~/.ollama/models on macOS. Set OLLAMA_MODELS if the home directory is small or synced to a cloud drive.
  • Concurrency: Defaults of one parallel request per model are enough for a single tester, so expect slow batches during bulk indexing tests.
  • Network exposure: Ollama binds to 127.0.0.1 on port 11434 by default. Keep that setting, so the local API is reachable only from the same machine.
  • OpenSearch connection: A laptop cluster in Docker can reach the host through a host address rather than localhost. Confirm the route and the bind address before debugging the connector.
  • Cloud features: Set OLLAMA_NO_CLOUD=1 if the laptop should never send inference to cloud models.

Before you move on, confirm with the laptop owner which data sets are permitted on that device and where the model files are stored.

Common questions about Ollama and OpenSearch connectors

How much effort does connecting OpenSearch to a self-hosted Ollama model take?

The connector itself is a small configuration step: you register a connector using a blueprint, create a model, and then wire it into an ingest or search pipeline. The effort comes from everything around it. The main drivers are how many models and embedding endpoints you run, whether generation and embedding share hardware, how requests are queued and limited under load, how TLS and access control are placed in front of Ollama, and how you test retrieval quality before users depend on it. Each additional model, environment or data source adds validation work. Ask any partner to split the quote into connector setup, model hosting, security controls, testing and handover so you can see which parts scale with your scope.

Can our own team connect OpenSearch to Ollama without outside help?

A team with working knowledge of OpenSearch cluster administration, the ML Commons plugin and Linux service management can usually build a first connection on its own, using the connector blueprints in the OpenSearch documentation. Teams often need outside help in three places: placing Ollama behind an authenticated proxy, confirming that the connector and processors behave correctly on your OpenSearch version, and documenting the setup for security review. Confirm your version's blueprint type and processor support before you start, because the standard blueprints are recommended for OpenSearch 2.14 and later.

What does our infrastructure need to provide for this work?

You need a network path from the OpenSearch nodes that run ML inference to the Ollama host, a host with enough memory and, if you use accelerators, supported GPUs for the models you select, and an OpenSearch cluster where the ML Commons features are enabled and an administrator can create connectors and models. Ollama listens on 127.0.0.1 port 11434 by default, so you will change its bind address through the OLLAMA_HOST environment variable and place an authenticated reverse proxy in front of it. Plan storage for model files, which Ollama keeps in a default directory that OLLAMA_MODELS can move. Confirm firewall rules, certificate authority and service account ownership with your network and security teams before the build starts.

Do Ollama licensing or paid plans affect a self-hosted setup?

Ollama is released under the MIT license, and its pricing page states that running models on your own hardware is always unlimited. Paid plans apply to cloud models and related services, such as Pro, Max, Team and Enterprise, so a deployment that only runs models on your hardware does not need a subscription for that use. Be careful with the cloud path: direct inference against ollama.com requires an API key sent as a Bearer token, and the pricing page lists Enterprise features such as model access controls and per-user cost budgets. If you want to rule out cloud calls entirely, set OLLAMA_NO_CLOUD=1 or the equivalent server configuration. Ask your legal team to confirm the terms that apply to your use before you deploy.

What drives how long the connector project takes?

The timeline depends on the decisions that have not been made yet rather than on the connector configuration. The main drivers are the number of environments (development, test and production), whether your security team needs to review the proxy, authentication and logging design before deployment, how many embedding and generation models you need to evaluate, and whether your OpenSearch version is current enough for the standard blueprints. Access approvals and change windows often take longer than the technical steps. Ask any partner for a schedule that lists these dependencies and names who must approve each one.

How do we keep prompts and documents inside our network?

Ollama states that when it runs locally it does not see your prompts or data, but the rest of the path still needs design. Keep the Ollama host on a private network segment, restrict which OpenSearch nodes can call it, and disable cloud features with OLLAMA_NO_CLOUD=1 so no requests leave for hosted models. Remember that the local Ollama API does not require authentication, so anything that can reach the port can use it. Enforce authentication at the proxy, log requests, and test that outbound traffic from the host is blocked as you intended.

What breaks most often when OpenSearch calls Ollama under load?

The most common failures are queueing and concurrency limits on the Ollama side. By default, Ollama handles one parallel request per model, keeps up to three models loaded per GPU (or three on CPU), and queues up to 512 requests. When indexing or search traffic exceeds those limits, requests wait or time out, and OpenSearch ingest or search pipelines fail or slow down. Tune OLLAMA_NUM_PARALLEL, OLLAMA_MAX_LOADED_MODELS and OLLAMA_MAX_QUEUE against measured load, set timeouts and retries in the connector, and separate ML workloads onto dedicated nodes where the cluster allows it. Test with realistic batch sizes before go-live.

Limits to confirm before you commit

This connector setup depends on several moving parts: the OpenSearch release, the blueprint version, the embedding model and the Ollama build. Each one can narrow what you can deploy, so confirm them together before you lock an index design or a production rollout.

Blueprint and connector version support

Confirm that your OpenSearch release supports the Ollama blueprint version you plan to use. Standard blueprints are recommended for OpenSearch 2.14 and later, so a cluster older than that needs the legacy blueprint path and its different behavior. Check the supported connector list for your exact release before you write the connector, and record the version in your change log so an upgrade does not silently change request and response handling.

Connector blueprints docs

Embedding dimensions and token limits

Confirm that the vector dimension your embedding model returns matches the dimension set in the k-NN field mapping, because a mismatch fails at index or query time. Also confirm the model's maximum input tokens, since long documents sent without chunking may be truncated or rejected. Test both with a sample of your real content before you fix the mapping, since changing dimensions later usually means reindexing.

Ollama release cadence

Ollama ships releases frequently. The facts list v0.40.5, released on 14 October 2026, and v0.40.6, published as a pre-release on 16 October 2026. Pin a specific tested version in your deployment, and decide who reviews release notes before an upgrade. Avoid pulling the latest tag automatically into a system that embeds production data.

Ollama releases

Pre-release risk

Treat pre-releases such as v0.40.6 as test builds only. They can change API behavior, model handling or defaults without the stability expected from a stable release. Run any candidate build against your embedding and generation requests in a staging cluster, compare vectors and latency with the pinned version, and promote it only after the results match your acceptance criteria.

Feature availability in your version

Confirm that every feature in your design exists in your OpenSearch version, including the ML Commons connector options, the inference ingest and search processors, and the security settings that control who can call the connector. Features that appear in current documentation may not exist in an older cluster. Check the version notes for your release and test each feature in staging before you depend on it.

Network and access boundaries

Confirm that Ollama's bind address and port are reachable only from the OpenSearch ML nodes, not from user networks. Ollama binds to 127.0.0.1 port 11434 by default, so exposing it requires a deliberate change through OLLAMA_HOST and usually a proxy. Also confirm that OLLAMA_NO_CLOUD=1 is set if data must never leave your network, and that your security team has reviewed the local API, which does not require authentication.

Ollama FAQ

What changes for your team after the connector is live

Once the connector works, the job becomes operating two systems that now depend on each other: the OpenSearch cluster and the Ollama host. Ollama's defaults matter here. Each model serves one parallel request by default (OLLAMA_NUM_PARALLEL), loaded models are capped by OLLAMA_MAX_LOADED_MODELS, and up to 512 requests can wait in the queue (OLLAMA_MAX_QUEUE). Ingest pipelines and search queries that call the model will feel that queue directly. Your team should set these values deliberately, watch queue depth and request latency during bulk indexing, and decide what happens when the queue fills: slow ingestion, retry with backoff, or fail the request. Confirm the exact metrics your Ollama version exposes before building dashboards around them.

Model upgrades are the change that most often breaks search quality without anyone noticing. A new embedding model produces vectors in a different space, so existing vectors cannot be mixed with new query vectors. Plan a re-embedding pass for each affected index, run it into a new index, validate relevance against your saved test queries, and then switch the alias. Connector and model IDs, the blueprint version, and the model_id used in ingest and search processors should be recorded in change control. Also decide who approves a model change, because a swap changes both security posture and results.

Ownership should be written down before the first incident. The platform or infrastructure team usually owns the Ollama host: operating system patches, GPU drivers, model storage under the directory set by OLLAMA_MODELS, disk growth, and the proxy in front of port 11434. The search team usually owns the ML connector, the model group, access roles, and ingest pipelines. Capacity planning spans both: query volume and document count drive embedding requests, and document growth turns into re-embedding work whenever the model changes. Ask your team to confirm which party is paid for each of these tasks, whether support hours or a retainer cover the host, and how a vendor on-call request would be triaged.

How DeployOpen works on this

DeployOpen plans, implements, integrates, documents and supports self-hosted open-source platforms inside your own infrastructure. For this connector work, we start from your network rules, model hosting choices and data handling requirements, then build the OpenSearch-to-Ollama path so your security and compliance teams can review it.

How we scope

  • Written scope lists the OpenSearch version, Ollama hosts, models and connector blueprints in your environment.
  • Scope records which data may reach embedding and generation endpoints, and which network paths are approved.
  • Engagements are fixed-scope, with deliverables and timelines agreed in writing before work begins.

How we build

  • We configure ML Commons connectors and inference processors against the Ollama endpoint you approve.
  • We restrict Ollama binding, proxy exposure and cloud features in line with your written network controls.
  • We test ingest and search paths end to end, including failure behavior when the model host is unavailable.

How we hand over

  • You receive configuration records, connector settings, access role definitions and network diagrams for review.
  • Runbooks cover model storage locations, concurrency settings, model loading and upgrade steps for your team.
  • Documentation maps the controls to evidence your compliance teams can use in their own assessments.

How we support

  • Ongoing support, upgrades and continuous testing are available as retainers after handover.
  • Retainers can cover OpenSearch and Ollama version changes, since both projects release frequently.
  • Ask any partner for the support scope, response arrangements and change process in writing before signing.

Sources and further reading

Talk to our team.

Tell us what you're working on, whether it's a deployment, an audit, a security test or a cyber range. You'll speak with an engineer who can help you scope it.

  • 30-minute call: free, with no obligation.
  • NDA on request: we can sign before you share details.
  • Clear next steps: a scope and plan after the call.