Connecting a local model to WordPress automation means registering a self-hosted inference server as an AI provider so that any WordPress feature built on the WordPress AI Client can generate text without calling a cloud service. The practical route is a connector plugin that speaks the OpenAI-compatible API — the /v1/models and /v1/chat/completions endpoints — and points at a base URL such as http://localhost:11434/v1. Because one protocol covers Ollama, LM Studio, llama.cpp, vLLM, and similar servers, a single connector can serve them all.
This guide is written for a technically curious beginner or intermediate practitioner who already runs, or plans to run, a local inference server and wants WordPress to use it. It explains what the moving parts are, how to connect them, how to confirm the connection works, and how to diagnose the failures that most often appear.
What the pieces are
WordPress exposes AI capabilities through the WordPress AI Client, an abstraction that plugins and features call instead of talking to a model directly. Providers are registered on the WordPress Connectors screen. A connector plugin is what bridges the two: it registers a provider and translates the AI Client’s requests into the API that the local server understands.
Two open examples illustrate the pattern. Jokiruiz Local Model Connector is a plugin published on the WordPress.org directory on July 21, 2026 by Joaquín Ruiz; it registers a new AI connector and exposes a local model to the WordPress AI Client. The georgestephanis/ai-provider-for-openai-compatible-servers repository, created July 13, 2026, does the same job and adds a WordPress Playground demo. Both deliberately speak the OpenAI-compatible API rather than each backend’s native API, so the same connector works with Ollama, LM Studio, llama.cpp (llama-server), vLLM, and any other server exposing an OpenAI-compatible endpoint, local or tunneled.
The key consequence is that the connector does not need to know which engine you run. It needs a reachable base URL and, optionally, a credential. Model names are not hardcoded; they are read from the endpoint.
Prerequisites
Before installing anything, confirm the following:
- A local inference server that exposes an OpenAI-compatible endpoint. Ollama’s default base URL is
http://localhost:11434/v1. - Network reachability from the machine that runs WordPress. The string
localhostresolves to the web server’s own host, not to the visitor’s browser, which is a frequent source of confusion. - Permission to install and activate WordPress plugins on the site.
- Optionally, a Bearer token if the endpoint sits behind a tunnel or reverse proxy. Local-only mode works without any credential.
- Optionally, a model already pulled or downloaded on the inference server.
Verify the server before touching WordPress. A request to the models endpoint should return a JSON list:
curl http://localhost:11434/v1/modelsIf that command fails, the problem is at the server or network layer, not in WordPress, and no plugin configuration will fix it.
Connecting the endpoint step by step
- Start the inference server and confirm that
/v1/modelsresponds. Expected result: a JSON list of available model identifiers. - Install and activate a connector plugin. Either Jokiruiz Local Model Connector or
ai-provider-for-openai-compatible-serversfits the pattern described above; pick one and avoid running two connectors against the same provider. - Open the Connectors settings screen in wp-admin. The connector appears as a setup card on that screen.
- Enter the base URL of your endpoint, for example
http://localhost:11434/v1. Use the address as seen from the WordPress host, not from your laptop. - Add a Bearer token only if needed. If the endpoint is behind a tunnel, supply the token. A purely local endpoint needs no credential.
- Save the configuration. Live model discovery queries the endpoint’s model list and caches the result, so the admin screen does not block on a slow or offline backend.
- Run the connection test or read the health indicator on the card.
- Select the active model from the discovered list, or specify one manually if the plugin offers that option.
- Use it. Any AI feature built on the WordPress AI Client can now generate text with the local model, with no further per-feature configuration.
Expected result after a successful connection: the connector reports a healthy state, the active model is listed, and a test generation returns text.
Verifying and reading connector health
Jokiruiz Local Model Connector reports health at a glance: connected, unreachable, or auth failed, together with the active model and the latency of the last check. That combination matters because it distinguishes a downed tunnel from a bad key. A connector that is unreachable is a network or process problem; a connector that fails authentication is a credential problem.
Because the model list is read from the endpoint rather than hardcoded, a model you pull later should appear after the cached list refreshes. If it does not, the cache — not the model — is usually the thing to check.
Timeouts are tuned for local inference. A short connect timeout detects an offline backend quickly, while a long generation timeout leaves room for slow local generation on consumer hardware. That asymmetry is intentional: connecting should fail fast, but generating may legitimately take a while.
Troubleshooting common failures
The connector reports unreachable
Likely causes, in order of likelihood: the inference server is not running; the port in the base URL is wrong; WordPress runs in a container or on a different host than the model server, so localhost points somewhere else; or a firewall blocks the connection. Re-run the curl check from the WordPress host itself. If it fails there, fix the server or the network before revisiting the plugin.
The connector reports auth failed
This indicates a Bearer token mismatch. Re-enter the token. Note that Jokiruiz Local Model Connector never re-prints a stored API key to the browser, so you may have to paste the token again rather than read the existing value from the screen.
The model list is empty or stale
The endpoint may not expose /v1/models, or the cached list may be out of date. Confirm the endpoint responds, then refresh discovery. If your server exposes models under a different path, the connector cannot invent them.
WordPress blocks the request as an SSRF risk
WordPress restricts outbound requests to private network addresses by default, which is exactly what a local endpoint is. Jokiruiz Local Model Connector relaxes that protection only for the exact host and port you configured, rather than globally. If you run a different connector, check how it handles private-address requests before assuming the failure is on the model side.
WordPress Playground cannot reach the endpoint
Playground routes WordPress’s outbound HTTP through the browser, so a local server must allow cross-origin requests. Ollama, for example, needs an origin allowance such as OLLAMA_ORIGINS=https://playground.wordpress.net. This is a Playground-specific constraint, not a general WordPress one.
Limitations and tradeoffs
Local inference moves the cost from a subscription to your hardware. Generation speed depends on the machine and the model, and consumer hardware can be slow — which is why the connector’s generation timeout is deliberately long. A connector cannot make a model faster than the hardware allows.
Privacy is the main draw. Jokiruiz Local Model Connector states that prompts never leave your machine or your network, and that the plugin makes no network request at all until it is configured. Those are provider claims rather than results of an independent audit, but the design is consistent with them: no cloud account, no API key, and SSRF relaxation scoped to one host and port.
Credential management does not disappear entirely. A tunneled endpoint needs a Bearer token, which reintroduces the problem of storing and rotating a secret. Local-only deployments avoid that.
Finally, connector behavior is plugin-specific. The two projects referenced here overlap in purpose but are separate codebases, so test the one you choose against your own endpoint rather than assuming identical behavior.
An illustrative scenario
Consider a site hosted on the same machine as an Ollama instance, with a model already pulled. The administrator installs a connector plugin, opens the Connectors screen, and enters http://localhost:11434/v1 as the base URL, leaving the token field empty. Discovery populates the model list from the endpoint, the health indicator turns to connected, and an AI feature built on the WordPress AI Client generates text locally. This scenario is illustrative rather than a recorded test; your ports, model names, and plugin screens will differ.
Next steps
Once the connector reports healthy, generate a short piece of text through an actual AI feature rather than only through the test button. Watch the reported latency over a few requests, because that number tells you whether the current model is practical for interactive use or better suited to background jobs. If you later need access from a remote WordPress host, add a tunnel and a Bearer token, then re-check the health state. If you hit a failure the checks above do not explain, share your environment, the exact error text, and the output of the curl check with the community so others can reproduce it.
FAQ
Do I need an API key to connect a local model to WordPress?
No, not for a local-only endpoint. The Jokiruiz Local Model Connector works without any credential in local-only mode; a Bearer token is only relevant when the endpoint sits behind a tunnel or reverse proxy.
Why does the connector say unreachable when the model server is clearly running?
The most common cause is that localhost means the WordPress host, not your workstation. If WordPress runs in a container or on another machine, point the base URL at the address the web server can actually reach, and verify with a curl request to /v1/models from that host.
Can I use this with WordPress Playground?
Yes, but Playground routes WordPress's outbound HTTP through the browser, so the local server must allow cross-origin requests. For Ollama that means setting an origin allowance such as OLLAMA_ORIGINS=https://playground.wordpress.net.
Does the connector send prompts to a cloud service?
The Jokiruiz Local Model Connector states that prompts never leave your machine or network and that the plugin makes no network request until it is configured. That is a provider claim rather than an independently audited result, but the design — no account, no API key, scoped SSRF relaxation — is consistent with it.