=== Jokiruiz Local Model Connector ===
Contributors: jokioki
Donate link: https://jokiruiz.com
Tags: ai, connector, ai provider, ollama, openai
Requires at least: 7.0
Tested up to: 7.0
Requires PHP: 7.4
Stable tag: 1.0.1
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

AI provider connector for local models: run WordPress AI on your own hardware with Ollama, LM Studio, llama.cpp or vLLM. No cloud, no API key.

== Description ==

**Jokiruiz Local Model Connector is an AI provider connector that runs WordPress AI features on your own hardware.**

It registers a new AI connector on the WordPress **Connectors** screen and exposes your local model to the WordPress AI Client, so any AI feature on your site can use it — with no cloud service, no account and no API key.

The connector speaks the OpenAI-compatible API (`/v1/models`, `/v1/chat/completions`) instead of each backend's native API, so one connector serves them all.

= Works with any OpenAI-compatible AI provider =

* **Ollama**
* **LM Studio**
* **llama.cpp** (llama-server)
* **vLLM**
* Any other server exposing an OpenAI-compatible endpoint, local or tunneled.

= Why this connector =

* **Private by default.** Prompts never leave your machine or your network.
* **No API key needed.** Local-only mode works without any credential; add a Bearer token only if your endpoint sits behind a tunnel.
* **Live model discovery.** The model list is read from your endpoint, not hardcoded, and cached so the admin never blocks on a slow or offline backend.
* **Built for local inference.** A short connect timeout detects an offline backend fast, while a long generation timeout leaves room for slow local generation on consumer hardware.
* **Connector health at a glance.** See connected / unreachable / auth failed, the active model and the latency of the last check — so you can tell a downed tunnel from a bad key.
* **Careful with security.** Your API key is never re-printed to the browser, and the plugin relaxes WordPress' SSRF protection only for the exact host and port you configured.
* **No surprise traffic.** The plugin makes no network request at all until you save an endpoint.

== Installation ==

1. Install and activate the plugin.
2. Start your local model server with an OpenAI-compatible API. For example, with Ollama: `OLLAMA_HOST=0.0.0.0:11434 ollama serve`
3. Go to **Settings → Jokiruiz Local Model Connector**.
4. Enter your endpoint (for example `http://localhost:11434`), leaving the API key empty for local-only use.
5. Refresh the model list, pick a model and save.

== Frequently Asked Questions ==

= Does this connector send my content to a cloud AI provider? =

No. Requests go only to the endpoint you configure, which is normally a model running on your own machine or your own network.

= Do I need an API key? =

No. Local-only mode requires no key. The API key field is only for endpoints published through a tunnel that requires a Bearer token.

= Which AI providers and backends are supported? =

Any backend exposing an OpenAI-compatible API, including Ollama, LM Studio, llama.cpp's server and vLLM.

= Does it make network requests before I configure it? =

No. Nothing is requested until you save an endpoint.

= The model list is empty. What now? =

Check that your server is running and reachable from WordPress, then use the **Refresh models** button. The health card on the settings screen distinguishes an unreachable backend from an authentication failure or an empty model list.

= My local model is slow and generation gets cut off. =

The connector already uses a 300 second generation timeout. You can change it with the `jokiruiz_local_model_connector_generation_timeout` filter.

== External services ==

This plugin connects to external services in two places. Both only happen in the WordPress admin, and no data about your site or visitors is ever sent.

1. **Your own AI endpoint.** The core purpose of the plugin is to talk to the OpenAI-compatible endpoint *you* configure (for example a local Ollama server at `http://localhost:11434`). It calls that endpoint's `/v1/models` and `/v1/chat/completions` paths to list models and generate text. No request is made until you save an endpoint. This is not a third-party service — it is the server you point the plugin at.

2. **YouTube (video embed).** The plugin settings screen embeds one video from the author's YouTube channel using YouTube's privacy-enhanced domain (`youtube-nocookie.com`). The embed loads only when you open that settings page. This sends your browser's request to YouTube/Google under their terms; see the [YouTube Terms of Service](https://www.youtube.com/t/terms) and the [Google Privacy Policy](https://policies.google.com/privacy).

== Screenshots ==

1. The connector settings screen, with the health card, setup guide and live model selector.
2. The connector listed on the WordPress Connectors screen.

== Changelog ==

= 1.0.1 =
* Initial release.
