| 开发者 | euthelup |
|---|---|
| 更新时间 | 2026年6月2日 09:35 |
| PHP版本: | 7.4 及以上 |
| WordPress版本: | 7.0 |
| 版权: | GPL-2.0-or-later |
| 版权网址: | 版权信息 |
wp_ai_client_prompt() (Gutenberg AI features, official provider plugins, third-party code) can route prompts to Osaurus running on the same machine. Prompts never leave the local network.
Why use it
AiClient::defaultRegistry() and points it at the Osaurus HTTP server. Because Osaurus speaks the OpenAI Chat Completions wire format, the implementation extends the SDK's OpenAI-compatible base classes — so capabilities like streaming and tool calling flow through automatically.
Configuration
The plugin resolves the Osaurus base URL in this order (first match wins):
OSAURUS_BASE_URL PHP constant defined in wp-config.php.osaurus_ai_connector_base_url option, settable from Settings → Connectors in wp-admin.http://127.0.0.1:1337/v1 (works out of the box for bare-metal WordPress on the same Mac as Osaurus; Docker setups must override).http://127.0.0.1:1337/v1 (this is the default — no configuration needed)http://host.docker.internal:1337/v1http://<your-mac-LAN-IP>:1337/v1 — make sure Osaurus is bound to a non-loopback interface and your firewall allows port 1337.http://<remote-host>:1337/v1 or https://... if you front it with TLS.curl <base-url>/models from the same shell environment WordPress runs in. A JSON list back means the connector will work.
Osaurus project home: osaurus.ai
Osaurus documentation: docs.osaurus.ai
curl http://127.0.0.1:1337/v1/models.wp-content/plugins/.http://127.0.0.1:1337/v1 works as-is. If you run WordPress inside Docker (DDEV, Lando, Docker Desktop), switch the URL to http://host.docker.internal:1337/v1 from Settings → Connectors or set OSAURUS_BASE_URL in your environment config.No. Osaurus is a local server and does not require credentials. The plugin registers a placeholder authentication so the Connectors screen treats the row as configured.
No. All requests go to the Osaurus URL you configure — by default a process on your own machine. See the External services section above.
Osaurus itself currently targets Apple Silicon. The connector plugin will load on any system but cannot reach Osaurus if Osaurus is not running.
Either define OSAURUS_BASE_URL in wp-config.php, or change the URL from Settings → Connectors in wp-admin.
Not supported. Osaurus only exposes text / chat completions today. For images, install an image-capable provider plugin alongside this one.
http_request_failed error.Confirm Osaurus is running and reachable from the host running WordPress. If you run WordPress inside Docker, change the URL to http://host.docker.internal:1337/v1 — the default 127.0.0.1 only works for bare-metal WordPress.