Evaluating local Ollama models with promptfoo

Running promptfoo evals and red teams against Ollama models keeps prompts and outputs on infrastructure you control, provided the provider IDs, host binding and grader are set deliberately. This page covers the configuration path and its failure points.

On this page

Evaluating local Ollama models with promptfoo: what the integration does

A team that wants to evaluate and red team a model served by Ollama, without sending prompts to a hosted service, can do so with promptfoo running on its own machine. promptfoo evals run locally and talk directly with the model, so the only network path that matters is between the promptfoo process and the Ollama server. promptfoo's Ollama provider calls Ollama's REST API, which listens on port 11434. Setting this up is a configuration task: you point a promptfoo config at a provider ID and a model name. It does not require building a custom plugin or writing a wrapper.

The local Ollama API at localhost:11434 does not require authentication by default, so the first run usually needs no keys. That convenience carries a risk. Ollama binds to 127.0.0.1 unless the OLLAMA_HOST environment variable changes the bind address, so a team that moves the server to another host or puts it behind a proxy must add its own access controls. Confirm the bind address and who can reach the port before treating the endpoint as private.

Two points need a decision before the first run. The first is whether the model under test runs on the same machine as promptfoo or on a shared host, which changes the base URL and the network rules you must review. The second is whether cloud features of Ollama are in use: Ollama states that local runs do not expose your prompts to it, and OLLAMA_NO_CLOUD=1 or the server configuration file can turn cloud features off. Direct cloud inference at ollama.com uses an API key sent as a Bearer token, which is a different path from the local setup described here. Confirm which path your evals take before you record results as on-site.

What you need before the first Ollama eval runs

Five things have to be in place before promptfoo can reach a model: the CLI on a supported Node.js runtime, an Ollama server with models pulled, a network path from the machine running promptfoo, and TLS if the API leaves localhost. Confirm the current promptfoo and Ollama versions in your own environment before you start, because both projects release often.

promptfoo CLI and Node.js runtime

Install the promptfoo CLI from npm. The current npm release requires Node.js 22.22.0 or newer, so check the runtime version on the machine that will run evals before installing anything else. Record the promptfoo version you install, since eval results and provider behavior can change between releases. Confirm the current release on the npm registry at setup time rather than relying on the version in this card.

promptfoo on npm

Ollama install on your host

Install Ollama on macOS, Windows, Linux or in Docker. The same host should run the promptfoo CLI if you want the simplest setup, but it can also be a separate server. Record the Ollama version with ollama --version so you can match any behavior difference later. Confirm the install method for your operating system against the Ollama documentation, since packaging changes over time.

Ollama repository

Models pulled to the serving host

Each model the eval calls must already exist on the machine that runs Ollama. Pull the chat model under test, plus any separate grader model, and confirm the exact tag with ollama list. Model files are stored in a host-specific folder, and OLLAMA_MODELS can move that storage to a larger disk. Plan disk space for every model you intend to compare, since model files can be large.

Network path and firewall rules

Ollama binds to 127.0.0.1 on port 11434 by default, so a remote promptfoo runner cannot reach it without a change. Setting OLLAMA_HOST changes the bind address, and that change should be paired with firewall rules that allow only the runner's network to reach the port. Test the path with a simple request from the runner before writing any config. Confirm the port and bind behavior on your Ollama version.

Ollama FAQ

Reverse proxy and TLS

If Ollama is exposed beyond localhost, the local API has no authentication, so anyone who reaches the port can run inference. Place a reverse proxy such as Nginx in front of it, terminate TLS there, and restrict access with network controls or proxy authentication. Ask your security team to confirm the proxy design before the first test, because prompts and outputs will cross that link.

Ollama API authentication

Keep data on site

Decide before the first run whether any cloud model or cloud feature may be used. Running Ollama locally keeps prompts on the host, and OLLAMA_NO_CLOUD=1 disables cloud features in the server configuration. Confirm that the eval config points only at local endpoints, and that no API key for a cloud service is set in the environment that promptfoo reads.

How to configure promptfoo against Ollama step by step

This sequence connects promptfoo to a local Ollama model, runs a first eval, and then points the same config at a remote Ollama host. Each step ends with a check you can run before moving on, so a failure is easy to locate.

  1. Install and verify promptfoo

    The engineer running evals installs the promptfoo CLI through npm on a machine with Node.js 22.22.0 or newer, which is the version the npm release requires. Install it in the project or globally, then run the version command. The step is done when the command prints a version number without errors. If it fails, check the Node.js version first, since that is the most common cause of install problems.

  2. Start Ollama and confirm the model responds

    Install Ollama on the machine that will run the model, pull the model you plan to test, and make sure the Ollama service is running. By default, Ollama listens on 127.0.0.1 port 11434. Request the list of local models from the REST API at localhost:11434. The step is done when the response lists your model and a short test prompt returns text. Local calls need no API key.

  3. Write chat and completion provider IDs

    Create a promptfooconfig.yaml file in the project folder and list the Ollama models under providers. Use one entry for the chat endpoint and one for the completion endpoint, each with the model name as it appears in the list from the previous step. Confirm the exact provider ID prefixes in the promptfoo Ollama provider documentation for your installed version before you rely on them. The step is done when promptfoo loads the file and reports the providers without a configuration error.

  4. Run a minimal eval with one test case

    Add a single test case with a short prompt and one simple assertion, such as checking that the answer contains an expected word. Run the eval from the project folder. Promptfoo sends the request directly to the local Ollama server, so no data leaves the machine for this run. The step is done when the output shows one row per provider with a pass or fail result. Open the results view to confirm the prompt and response were recorded.

  5. Point the config at a remote Ollama host

    On the server, set the OLLAMA_HOST environment variable so Ollama listens on an address the client can reach, then restart the service. Ollama has no built-in authentication on its local API, so restrict access with a firewall, a private network or a reverse proxy that you control before opening the port. On the client, change the provider's base URL to the server address, using the setting name shown in the promptfoo Ollama provider documentation. The step is done when a request from the client to the remote host's model list returns your models.

  6. Confirm the remote run matches the local baseline

    Run the same minimal eval against the remote host with no other changes. Compare the provider names, the model names and the pass or fail results with the local run from the earlier step. Differences in the response text are expected because model output varies, but a failed connection or a missing model is a configuration issue to fix before scaling up test volume. The step is done when the remote run completes and its results match the local baseline in structure.

How to run a remote Ollama host and a local grader without leaving your network

The grader model decides where your test outputs travel. promptfoo's model-graded assertions and red team grading send the application's responses to whichever model is configured as the grader, so a grader that runs on your own Ollama host keeps those outputs on site. This matters most in red teaming, where the graded transcripts contain adversarial prompts and the sensitive material those prompts tried to extract. Treat the grader setting as a data path decision, not a convenience setting, and confirm in your own promptfoo configuration which provider the grader points to, including any defaultTest or per-assertion grader overrides that could send traffic elsewhere.

Ollama binds to 127.0.0.1 on port 11434 by default, so a runner on another machine needs a deliberate change. Set OLLAMA_HOST on the server to the interface address you intend to expose, and place a reverse proxy such as Nginx in front of it to handle TLS and access restrictions, as the Ollama FAQ describes. The local API does not require authentication, so the proxy, network segmentation or firewall rules must carry the access control. Limit which hosts can reach the port, and confirm that the promptfoo provider's apiBaseUrl points at the proxied address and not at a public endpoint.

Set OLLAMA_NO_CLOUD=1 on the Ollama host, or the equivalent entry in its server configuration file, so requests cannot route to hosted inference. Ollama's direct cloud endpoints at ollama.com require an API key, so a configuration that still holds one is a reminder to remove it from test environments. Then verify the result: run a grader-only assertion, watch the Ollama server logs and your egress firewall during the run, and confirm that no request leaves your network. Record the settings you verified and the Ollama version in your test evidence, since Ollama ships frequent releases and cloud behavior can change between them.

Which Ollama setup fits a laptop, a shared server or an air-gapped network

A single developer workstation is the simplest pattern. Ollama runs on the same machine as the promptfoo CLI, so the promptfoo config points at the local API and no network path is involved. Ollama binds to 127.0.0.1 on port 11434 by default, which keeps the API off other machines, and the local API does not require authentication. Because evals run on your machine and talk directly with the model, prompts and test data stay on the laptop unless you configure a cloud feature or a remote grader.

  • Binding: keep the default 127.0.0.1 address and do not set OLLAMA_HOST to an external interface.
  • Authentication: none is required for the local API, so the trust boundary is the operating system account.
  • Grader choice: a local model can grade results, which keeps grading traffic on the machine.
  • Cloud features: set OLLAMA_NO_CLOUD=1 or use the server configuration file if the team wants to rule out cloud inference.
  • Main trade-off: the throughput of the workstation limits test volume, and results from one laptop are hard to share or reproduce.

Before relying on this setup, confirm which models are installed locally and that the machine has enough memory and storage for them, since model files are stored in the directory your operating system uses by default.

How promptfoo settings map to Ollama models, endpoints and limits

This table maps the promptfoo config keys you set for an Ollama target to the Ollama side of the connection: model tags, API paths, host and storage variables, and concurrency limits. Read each row as a pair, then check the concurrency row first, because the default of one parallel request per model is the most common reason an eval run takes longer than expected.

SettingWhat it controlsOllama sideWhat to check
Provider ID and model nameWhich Ollama model promptfoo calls, written as the Ollama provider with the model tag after itA model tag such as the name and tag used with ollama pull on the serverRun ollama list on the host and copy the tag exactly, including any version suffix
Base URLWhere promptfoo sends requests when Ollama is not on the default local addressThe address set by OLLAMA_HOST, default 127.0.0.1 on port 11434Confirm the host is reachable from the machine running the eval, and that the proxy in front of it passes the API path through
Chat versus completion pathWhether prompts are sent as chat messages or as a single completion promptThe REST API on port 11434, which also offers an OpenAI-compatible surfaceChoose chat for instruction-tuned models and check the provider docs for the exact path before running a full suite
Temperature and token optionsSampling randomness and maximum output length for each testGeneration options passed with each request, applied per model callFix these values in the config so repeated runs are comparable, and record them with the results
Grader providerThe model that scores outputs for model-graded assertions and red team gradingA second Ollama model tag running on the same or another hostUse a grader you have tested on your own data, since weak graders produce unreliable pass rates
OLLAMA_HOSTNetwork address and port the server listens onDefault 127.0.0.1 on port 11434, changed through this variable for a remote hostBinding beyond localhost exposes an API with no authentication, so put a proxy with access control in front of it
OLLAMA_MODELSDirectory where model weights are storedDefaults differ by operating system, and this variable moves storage to another diskMake sure the directory has room for every model the suite and grader will load
OLLAMA_NUM_PARALLELHow many requests one loaded model handles at the same timeDefault of 1 parallel request per modelRaising it can speed up eval runs but uses more memory, so confirm headroom on the host before changing it
OLLAMA_MAX_LOADED_MODELS and OLLAMA_MAX_QUEUEHow many models stay loaded at once, and how many requests wait in lineLoaded model default is 3 per GPU or 3 on CPU, queue default is 512 requestsKeep the grader and target loaded together, and set the queue high enough for your concurrency setting

Security settings that keep evaluation data on site

Ollama's local API has no built-in authentication, so access control for evaluation traffic sits in the network and proxy layer around it. The cards below cover the settings that keep prompts, responses and grading data on infrastructure you control, from the bind address to the keys that should never appear in a promptfoo config.

Bind the API to a restricted interface

Ollama binds to 127.0.0.1 on port 11434 by default, which keeps the API off the network. If promptfoo runs on a different machine, change the bind address with the OLLAMA_HOST environment variable so it listens only on the interface that machine needs, not on every interface. Check the listening socket after each change with a command such as ss -ltnp on Linux, and confirm that nothing outside the intended network can connect.

Ollama FAQ

Front shared hosts with an authenticating proxy

The local API accepts requests without credentials, so any shared host needs a reverse proxy in front of it. Nginx is the proxy the Ollama docs describe. Require authentication at the proxy, terminate TLS there, and forward only the API paths that promptfoo calls. Test the proxy with an unauthenticated request, which should fail, before pointing any eval at it.

Ollama FAQ

Disable cloud features

Set OLLAMA_NO_CLOUD=1 in the environment of the Ollama service, or the equivalent setting in its server configuration file, so the runtime does not use cloud features during evaluation. Ollama states that local runs do not expose your prompts or data, and this setting makes the no-cloud intent explicit and reviewable. Confirm the setting is active on the running process, since a value set only in an interactive shell does not reach a service started by systemd or a container.

Ollama FAQ

Keep model storage on encrypted disks

Models are stored in a per-user or service directory by default, and the OLLAMA_MODELS variable moves them elsewhere. Place that directory on a volume with full-disk or volume encryption, and restrict read access to the service account. Model files are not your test data, but the directory also collects the artifacts of your evaluation work, so treat it as part of the evaluation environment. Ask your security team which encryption standard and key management the volume must meet.

Control who can reach the port

Limit inbound access to port 11434 with host firewall rules or network security groups, allowing only the promptfoo runners, the proxy and the administrators who maintain the host. Review the list when people or CI runners change. Remember that promptfoo runs on the same machine in many setups, so a rule that blocks all remote access may be all the control you need.

Keep cloud API keys out of local configs

A local Ollama provider needs no API key. Direct cloud calls to ollama.com require a key sent as a Bearer token, so do not copy that key into a promptfoo configuration that targets the local host. Store any key that is needed in a secrets manager or environment variable, scope it to the test purpose, and confirm that promptfoo output, logs and report files do not echo it back.

Ollama API authentication

Why promptfoo cannot reach Ollama and how to fix it

This table lists the failures teams hit most often when promptfoo runs against Ollama, with the cause and the fix for each. Read it top to bottom when a run fails, and check the first row first, since a closed bind address blocks every other request. The main takeaway is that most failures come from the Ollama server configuration or from the model tag, not from promptfoo itself.

SymptomLikely causeFix
Connection refused on port 11434Ollama binds to 127.0.0.1 by default, so a remote host or container cannot reach itSet OLLAMA_HOST to the interface you intend to expose, or place a reverse proxy such as Nginx in front of it, then point the promptfoo provider at that address
Model not found or wrong model tagThe model name in the config does not match a pulled tag, or the model was never pulled on that hostRun the list command on the same host that serves the API, copy the exact tag, and pull any missing model before the eval starts
Requests time out under loadOLLAMA_NUM_PARALLEL defaults to 1 per model, so concurrent promptfoo workers queue behind one slotLower promptfoo concurrency to match the server, or raise OLLAMA_NUM_PARALLEL after checking that the hardware has memory for it
Requests rejected with queue errorsThe queue reaches OLLAMA_MAX_QUEUE, which defaults to 512 queued requestsReduce test volume or worker count, add retries with backoff in the promptfoo config, and raise the queue limit only if the host can absorb it
Grader results look inconsistent or unexpectedThe grader was not set to a local model, so judging calls went to a default or cloud provider and sent test data off siteSet the grader provider explicitly to the local Ollama model, and confirm in the run output which provider handled each grading call
Certificate or proxy errors on a remote hostA TLS-terminating proxy uses a private certificate authority, or an HTTP proxy environment variable intercepts local trafficAdd the internal CA to the Node.js trust store, exclude the Ollama host from proxy settings, and confirm the scheme and port in the provider URL
Cloud authentication errors on a local modelThe base URL points at ollama.com instead of the local host, so the request expects a Bearer API keyCorrect the base URL to the local or remote Ollama host, and set OLLAMA_NO_CLOUD=1 on the server to stop cloud features from being used

Questions teams ask before running Ollama red teams

Can our own team run promptfoo against Ollama models without an outside partner?

Yes, a team with Node.js and some familiarity with LLM testing can point promptfoo at a local Ollama server and run evals. Ollama serves its REST API on port 11434 and does not require authentication on localhost, so a first run mostly depends on installing promptfoo, which requires Node.js 22.22.0 or newer, and writing a provider configuration. The harder part is usually the surrounding work: deciding which attack categories matter for your application, agreeing who approves the test data, and documenting results so a security or compliance reviewer can rely on them. An outside partner is useful when that governance work is the bottleneck, not the tooling.

What drives the effort of an Ollama red team engagement?

Effort grows with the number of things under test. The main drivers are:

  • The number of models and model variants you compare, since each one needs its own provider entry and a baseline run.
  • The number of hosts, especially if Ollama runs on several servers or behind a proxy that you must configure and secure.
  • Your grader choice, because a local grader model must be selected, hosted and checked for grading accuracy before its verdicts count.
  • Network controls, such as firewall rules, TLS termination and access restrictions around the Ollama port.
  • Scan size, meaning how many probes and strategies you run per model and how often you repeat them.

Each driver can be sized from your own inventory before any work starts.

What does our team need to provide before testing starts?

Plan to provide four things. First, hardware or a VM with enough memory and accelerator capacity for the models you will test, because Ollama stores models locally and runs them on your own compute. Second, network access from the test runner to the Ollama host, plus any proxy or firewall changes approved by your network team. Third, written approval for each model to be tested and for the data used in prompts and grading. Fourth, a named owner for the test data and application context, who can answer questions about what the model is supposed to do and what a failure looks like.

How long does setup take for a local Ollama test environment?

The duration depends on the drivers above, so a single model on one workstation differs greatly from several models on a shared remote host with restricted networking. Ask for a timeline in the written scope and check that it lists the dependencies that could delay it, such as hardware provisioning, firewall change windows and approval of test data. Note that Ollama releases change often; v0.40.5 was released on 14 October 2026 and v0.40.6 was published as a pre-release on 16 October 2026, so pin the version you test and record it in your evidence.

Is promptfoo Community enough, or do we need the self-hosted server?

For a single engineer or a small group running evals and red teams from the command line, the Community edition is free and includes all LLM evaluation features, all model providers and red teaming with 10k probes per month, with community support. The self-hosted promptfoo app is a better fit when several people need to share results. It is an Express server deployable with Docker, Docker Compose or Kubernetes with Helm, but its documentation says it stores data in a local SQLite database that cannot be shared across replicas, has no RBAC, horizontal scaling, built-in authentication or SSO, and is not recommended for production use. Confirm the current limits on the promptfoo pricing page before deciding.

Can a local Ollama grader keep our data on site?

Yes, if the grader runs on infrastructure you control. Ollama states that when it runs locally it does not see your prompts or data, and cloud features can be turned off with OLLAMA_NO_CLOUD=1 or in the server configuration file. Running models on your own hardware is listed as unlimited on the Ollama pricing page, while the paid cloud plans apply only to hosted inference. Confirm that no part of your pipeline calls a hosted endpoint, including the promptfoo tool itself, and check the grader's accuracy on a sample of known pass and fail cases before relying on its scores.

What would an outside partner scope and quote for this work?

DeployOpen agrees scope, deliverables and timelines in writing before work starts, and most engagements are fixed-scope. A quote would follow from the written scope, which typically covers the models and hosts in scope, the network and access design for the Ollama endpoints, the grader choice and its validation, the red team plugins and strategies to run, how results are stored and reviewed, and the handover documentation. Ask for each of these to be listed as a separate line so you can see what you pay for and what your team keeps. DeployOpen does not publish a price list. Ongoing testing and upgrades are available as retainers.

How promptfoo, Ollama and the grader fit together on your network

The flow starts on an operator machine, where the promptfoo CLI sends eval and red team requests to an Ollama host inside the internal network. The same host, or a second Ollama model, grades the outputs, and results are written to a local output store. The trust boundary marks what stays on site: no traffic leaves for a cloud model. Check that the Ollama host is reachable only from approved machines, that OLLAMA_NO_CLOUD=1 is set, and that no provider in the config points at an external endpoint.

Requests, grading and results all stay inside the internal network.

How DeployOpen scopes and delivers an Ollama evaluation setup

DeployOpen starts by agreeing in writing which Ollama hosts, models and promptfoo workflows are in scope, then builds the provider configuration, grading setup and run procedure in your infrastructure. Engagements are fixed-scope, so deliverables and timelines are set before work begins.

How we scope

  • Inventory which Ollama hosts run locally, on a shared server or on a remote host, and who calls them
  • Confirm which chat and completion models are under test and which local model will act as grader
  • Agree the written scope, deliverables and timeline before any configuration work starts

How we build

  • Configure promptfoo provider IDs for chat and completion endpoints and verify each model responds
  • Set up a remote Ollama host with access controls at the network layer, and confirm the bind address and proxy
  • Test a local grader model against a reviewed sample so grading results can be trusted and kept on site

How we hand over

  • Deliver version-pinned configuration files, run scripts and a runbook your engineers can rerun
  • Document data flows showing that prompts and grading stay on hosts you control, with cloud features turned off
  • Walk your security and platform teams through the setup and record decisions for later review

How we support

  • Ongoing support, upgrades and continuous testing are available as a retainer after handover
  • Plan model and Ollama version upgrades so eval baselines are re-run before results are compared
  • Retesting after changes to hosts, models or network exposure can be included in a retainer scope

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.