# Zactonz AI Connector for Ollama

> Ollama connector for the WordPress AI Client. Run local, self-hosted or Ollama Cloud models for text, images, embeddings and tool calling.

- **Type:** Plugin (WordPress plugins)
- **Version:** 1.2.0, released 29 Sep 2026
- **Requires:** WordPress 7.0+, PHP 7.4+, Ollama (local, self-hosted or Cloud)
- **Tested with:** WordPress 7.1.2
- **Licence:** GPL-2.0-or-later
- **Download:** https://downloads.wordpress.org/plugin/zactonz-ai-provider-ollama.latest-stable.zip
- **WordPress.org:** https://wordpress.org/plugins/zactonz-ai-provider-ollama/
- **Source:** https://github.com/zactonz/zactonz-ai-provider-ollama
- **Documentation:** https://developers.zactonz.com/wordpress/plugins/zactonz-ai-provider-ollama/

## Overview

Zactonz AI Connector for Ollama registers Ollama as a connector for the WordPress AI Client. It is built for the **Settings › Connectors** screen and for the plugin-directory connector search, so when WordPress asks for a connector you can add Ollama in a couple of clicks. Once active, Ollama can power text generation, image generation, embeddings, tool calling, structured output and streaming wherever the selected model supports them.

Ollama exposes an OpenAI-compatible API. The connector talks to that API, which means it works with any model you have pulled into Ollama: Llama, Mistral, Gemma, Phi and many more, running locally, on a remote self-hosted instance, or on Ollama Cloud.

### Features

- Text generation with any Ollama model.
- Image generation with supported models.
- Single and batch embedding generation on WordPress 7.1 and newer.
- Function calling and structured output (JSON mode).
- Automatic model discovery from your Ollama instance, with accurate per-model capability detection for text, vision, tools, thinking, images, structured output and embeddings.
- Separate default models for text, vision, images, embeddings and tool calling.
- Thinking controls: model default, disabled, low, medium or high.
- Connector integration in **Settings › Connectors** with an Ollama Cloud / self-hosted switch, and discoverable connector metadata for plugin-directory searches.
- Separate saved API keys for Ollama Cloud and for protected self-hosted endpoints. Local instances work without a key.
- Self-hosted host URL and port controls, and a configurable text request timeout for slow local or thinking responses.
- Redacted diagnostics panel plus a WordPress Site Health connectivity test.
- Stable, cancellable SSE streaming for content, thinking and tool-call chunks.

### Requirements

| Component | Minimum |
|---|---|
| WordPress | 7.0 (tested up to 7.1.2) |
| PHP | 7.4 |
| Ollama | Running locally, on a remote server, or Ollama Cloud |

### Part of a family

This connector is one of the Zactonz AI Connector plugins, which add the providers WordPress core leaves out. They follow one set of conventions, so every connector behaves the same way in the admin. [Zactonz AI Connector for OpenRouter](https://developers.zactonz.com/wordpress/plugins/zactonz-ai-connector-for-openrouter/) covers hundreds of hosted models behind one key; [Zactonz AI Connector for Groq](https://developers.zactonz.com/wordpress/plugins/zactonz-ai-connector-for-groq/) covers very low latency inference on GroqCloud; [Zactonz AI Connector for DeepSeek](https://developers.zactonz.com/wordpress/plugins/zactonz-ai-connector-for-deepseek/) covers a very long context window and thinking mode; [Zactonz AI Connector for Mistral AI](https://developers.zactonz.com/wordpress/plugins/zactonz-ai-connector-for-mistral-ai/) covers Mistral AI's open-weight and commercial models with capabilities read from its catalogue; [Zactonz AI Connector for xAI Grok](https://developers.zactonz.com/wordpress/plugins/zactonz-ai-connector-for-xai-grok/) covers Grok text, vision and image generation. All of them are listed under [WordPress](https://developers.zactonz.com/wordpress/).

### Disclaimer

Zactonz AI Connector for Ollama is developed by Zactonz Technologies. Ollama is a third-party project. This plugin is not affiliated with, endorsed by, or sponsored by Ollama.

## Installation & setup

### Install the plugin

From the dashboard, go to **Plugins › Add New**, search for **Zactonz AI Connector for Ollama** and click **Install Now**, then **Activate**. WordPress also links here directly from **Settings › Connectors** when it needs a connector that is not installed yet.

With WP-CLI:

```bash
wp plugin install zactonz-ai-provider-ollama --activate
```

To install manually, download the zip from the Download button above, upload the folder to `/wp-content/plugins/zactonz-ai-provider-ollama/` and activate it from the **Plugins** menu.

### Connect to Ollama

1. Go to **Settings › Connectors** and choose **Ollama Cloud** or **Self-hosted**.
2. For Ollama Cloud, enter your API key.
3. For self-hosted, enter the host URL or IP and the port (the default is `http://localhost:11434`). Add the optional self-hosted API key only if your endpoint is protected.
4. Go to **Settings › Ollama** to review the models discovered on that endpoint, then pick a default model, a thinking mode and a text request timeout.

Cloud and self-hosted keys are stored separately and applied to requests for whichever connection mode is active.

### Environment overrides

Two settings can also come from the environment, which is useful on managed hosts and in containers:

| Setting | Variable | Notes |
|---|---|---|
| Host URL | `OLLAMA_HOST` | Takes precedence over the value saved in the admin. |
| API key | `OLLAMA_API_KEY` | Environment variable or PHP constant; takes priority over saved admin keys. |

### Install Ollama itself

If you do not have Ollama yet, download it from [ollama.com](https://ollama.com) and pull a model:

```bash
ollama pull llama3.2
```

The connector discovers pulled models automatically the next time you open **Settings › Ollama**.

### Check the connection

**Tools › Site Health** includes a connectivity test for the configured Ollama endpoint, and **Settings › Ollama** shows a redacted diagnostics panel with endpoint status, latency, model availability, version, embeddings and streaming readiness.

## FAQ

### How do I install Ollama?

Visit [ollama.com](https://ollama.com) to download and install Ollama for your platform. Once installed, pull a model (for example `ollama pull llama3.2`) and the connector will discover it automatically.

### Why does this plugin appear in the connector search?

WordPress links to the plugin directory from **Settings › Connectors** when a needed connector is not installed. This plugin is tagged as a connector and registers Ollama as a WordPress AI Client connector after activation.

### Do I need an API key?

Ollama Cloud requires a valid API key, entered in **Settings › Connectors** or **Settings › Ollama**.

Self-hosted Ollama does not need an API key by default. If your self-hosted endpoint is protected, enter the optional self-hosted API key. Cloud and self-hosted keys are stored separately and applied to requests for the active connection mode.

An `OLLAMA_API_KEY` environment variable or PHP constant can also be used and takes priority over saved admin keys.

### How do I change the Ollama host URL?

By default the connector uses `http://localhost:11434`. You can change this in two ways:

1. Set the `OLLAMA_HOST` environment variable, which takes precedence.
2. Choose **Self-hosted** on **Settings › Connectors** or **Settings › Ollama**, then enter your host URL or IP and port.

## Changelog

### 1.2.0 — 29 September 2026

Renamed to Zactonz AI Connector for Ollama, matching the rest of the connector family. The plugin folder, slug and text domain are unchanged, so this is an ordinary update.

**Fixed**

- Ollama Cloud and self-hosted API keys were interchangeable. A key entered on **Settings › Connectors** is now filed under the connection mode in use at the time, so switching mode can no longer send a Cloud key to a self-hosted address, or a private self-hosted token to ollama.com.
- A model listing containing an entry without a usable name raised a fatal error. Entries from both the self-hosted and Cloud endpoints are now validated before use.
- Events could be delivered after a stream was cancelled. The trailing block of an unterminated stream is no longer parsed once the caller has returned false, so the partial result holds only what the caller was told about.
- A callback failure on a replayed body, on the trailing block, or on the done event was discarded instead of reported.
- Streamed responses reported no token usage. An OpenAI-compatible stream omits the usage block unless it is asked for.
- Administrator AJAX errors returned HTTP 200, because a `WP_Error` code was passed where a status code was expected.
- The Ollama mark on **Settings › Connectors** was supplied at its own 646×854 proportions and did not fit the square the screen draws it in.
- The guard meant to stop the plugin loading twice was never set.
- Ten of the twelve shipped class files had no direct-access guard.
- The settings screen's JavaScript strings could not be translated, because script translations were never registered.

**Changed**

- Streaming now uses the WordPress HTTP API. The plugin no longer calls cURL anywhere in its own code: a stream is an ordinary `wp_remote_post()` and the body arrives through the `requests-request.progress` action.
- A transport without incremental delivery replays the whole response through the same parser, so streaming returns every event instead of failing when the cURL extension is absent.
- Cancellation stops delivering events without aborting the transfer, which no HTTP API hook can do. The partial result is unchanged.
- The reachability check is cached for five minutes per connection. The AI Client asks on every model lookup, and each answer previously cost a request — or the full request timeout when Ollama was not running.
- The Site Health connectivity test runs asynchronously, and reports a recommendation rather than a critical failure when Ollama is simply not running. A direct test held the Site Health screen open for the length of the request.
- Model preference travels through the order models are listed in, rather than five global filters. Those filters are shared with every other connector on the site, so whichever registered last won; listing order is per provider. Every capability's default now leads, not only the text one.
- The API key also lives in the option WordPress registers for the connector, so a key entered on **Settings › Connectors** and one entered on the plugin's own screen are the same credential. Per-connection keys are still kept, and an existing key is copied across on upgrade.
- The Ollama port widens the HTTP API's safe-port list only while the connector's own request is in flight, rather than for every request the site makes.

**Added**

- An uninstall handler that removes the settings and both stored keys when the plugin is deleted, on single sites and across a network.
- An External services section in the readme covering what Ollama Cloud receives.

### 1.1.0 — 3 August 2026

- Added native Ollama single and batch embedding generation for the WordPress 7.1 / PHP AI Client 1.4 embedding API.
- Reworked discovery to advertise only capabilities reported by Ollama, with conservative fallback behaviour when model details are unavailable.
- Added separate default selectors for text, vision, image, embedding and tool-calling models.
- Added model-default, disabled, low, medium and high thinking preferences, with automatic migration from the previous enabled setting.
- Added a redacted diagnostics panel covering endpoint status, latency, model availability, version, embeddings and streaming readiness.
- Added a WordPress Site Health connectivity test and redacted debug-information section.
- Added stable provider-level SSE streaming with content, thinking, usage, tool-call aggregation, callback-error handling and cancellation with partial results.
- Improved WordPress.org connector-search metadata for admins coming from Settings › Connectors.
- Fixed Connector-screen saves so connection changes no longer discard model and thinking preferences.
- Fixed Ollama Cloud capability reporting so structured output is not advertised where it is unsupported.
- Added automated coverage for discovery, settings migration and preservation, embeddings, diagnostics, Site Health, streaming, cancellation and streamed tool calls.

### 1.0.0 — 22 May 2026

- First Zactonz release with Settings › Connectors recognition, Ollama Cloud and self-hosted modes, separate Cloud and self-hosted API credentials, provider logo and live connected-status integration.
- Host URL or IP and port controls with model discovery from the configured Ollama instance.
- Default-model thinking mode and a longer configurable text request timeout for local Ollama responses.
- Text generation, structured output, function calling, vision-aware model metadata and image generation for compatible models.
