{"id":50361170,"url":"https://github.com/roddyka/api-provider-for-ollama","last_synced_at":"2026-05-30T01:30:42.073Z","repository":{"id":360400485,"uuid":"1246700606","full_name":"roddyka/api-provider-for-ollama","owner":"roddyka","description":"AI Provider for Ollama Local for  Wordpress 7.0 AI Conectors","archived":false,"fork":false,"pushed_at":"2026-05-26T07:48:25.000Z","size":38,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-05-26T09:33:56.802Z","etag":null,"topics":["ai-agents","ai-assistant","ai-model","wordpress","wordpress-ai-provider","wordpress-development","wordpress-plugin"],"latest_commit_sha":null,"homepage":"https://antunescode.com/plugins/ai-provider-for-ollama-local","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/roddyka.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-05-22T13:12:14.000Z","updated_at":"2026-05-26T07:48:29.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/roddyka/api-provider-for-ollama","commit_stats":null,"previous_names":["roddyka/api-provider-for-ollama"],"tags_count":null,"template":false,"template_full_name":null,"purl":"pkg:github/roddyka/api-provider-for-ollama","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/roddyka%2Fapi-provider-for-ollama","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/roddyka%2Fapi-provider-for-ollama/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/roddyka%2Fapi-provider-for-ollama/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/roddyka%2Fapi-provider-for-ollama/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/roddyka","download_url":"https://codeload.github.com/roddyka/api-provider-for-ollama/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/roddyka%2Fapi-provider-for-ollama/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33677258,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-05-29T02:00:06.066Z","response_time":107,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["ai-agents","ai-assistant","ai-model","wordpress","wordpress-ai-provider","wordpress-development","wordpress-plugin"],"created_at":"2026-05-30T01:30:41.568Z","updated_at":"2026-05-30T01:30:42.065Z","avatar_url":"https://github.com/roddyka.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Promptiva Connector for Ollama\n\n\u003e **Connect WordPress 7.0 AI to your own Ollama server — no API key, no cloud, no cost.**\n\n[![License: GPL v2](https://img.shields.io/badge/License-GPL%20v2-blue.svg)](https://www.gnu.org/licenses/old-licenses/gpl-2.0.en.html)\n[![WordPress 7.0+](https://img.shields.io/badge/WordPress-7.0%2B-blue?logo=wordpress)](https://wordpress.org)\n[![PHP 7.4+](https://img.shields.io/badge/PHP-7.4%2B-777bb4?logo=php)](https://php.net)\n[![Ollama](https://img.shields.io/badge/Ollama-OpenAI%20Compatible-black)](https://ollama.com)\n\nWordPress 7.0 ships with a native AI integration layer. The problem? It only comes with connectors for cloud providers that require an API key. **This plugin bridges that gap**, wiring the new WordPress AI Client directly to your local (or self-hosted) [Ollama](https://ollama.com) instance.\n\nRun Llama 3, Mistral, Gemma, Phi, Qwen — any model Ollama supports — and use it to power WordPress AI features without sending a single token to the cloud.\n\n---\n\n## ✨ Features\n\n| Feature | Details |\n|---|---|\n| **Zero API key** | Ollama uses its own local auth; no credentials needed |\n| **Dynamic model list** | Auto-discovers every model installed in Ollama via `/v1/models` |\n| **OpenAI-compatible** | Uses Ollama's `/v1/chat/completions` endpoint |\n| **wp-admin UI** | Custom connector card under **Settings → Connectors** |\n| **Runtime diagnostics** | Card shows connection status and available models live |\n| **Flexible base URL** | Option → constant → env var → sensible default |\n| **WP AI preferred models** | Injects your default model at the top of the preference list |\n| **GPL-2.0-or-later** | Free as in freedom |\n\n---\n\n## Requirements\n\n| Requirement | Minimum |\n|---|---|\n| WordPress | **7.0** (AI Client API introduced) |\n| PHP | **7.4** |\n| [Ollama](https://ollama.com/download) | Any recent release with OpenAI-compatible endpoint |\n\n\u003e **WordPress 7.0 is required.** This plugin depends on `WordPress\\AiClient`, the `wp_connectors_init` hook, and `@wordpress/connectors` — all introduced in WP 7.0.\n\n---\n\n## Installation\n\n### From this repository (recommended for testing)\n\n```bash\n# Clone directly into your wp-content/plugins directory\ncd /path/to/wordpress/wp-content/plugins\ngit clone https://github.com/roddyka/api-provider-for-ollama.git promptiva-connector-for-ollama\n\n```\n\nThen activate it from **Plugins → Installed Plugins** in wp-admin.\n\n### Manual upload\n\n1. Download the `.zip` from [Releases](https://github.com/roddyka/api-provider-for-ollama/releases)\n2. In wp-admin go to **Plugins → Add New → Upload Plugin**\n3. Choose the zip, install and activate\n\n---\n\n## Quick Start\n\n1. **Install Ollama** → [ollama.com/download](https://ollama.com/download)\n2. **Pull a model** (example):\n   ```bash\n   ollama pull llama3\n   ```\n3. **Verify Ollama is running** at `http://127.0.0.1:11434`\n4. **Activate this plugin** in WordPress\n5. Go to **Settings → Connectors** and open the **Ollama Local** card\n6. The card will auto-detect your running models — pick a default and save\n\nThat's it. WordPress AI features (Block Editor AI, AI assistants, etc.) will now use your local Ollama instance.\n\n---\n\n## Configuration\n\nThe base URL is resolved in this priority order:\n\n| Source | Example |\n|---|---|\n| wp-admin Connector card | Saved to `wp_options` |\n| PHP constant | `define('OLLAMA_API_BASE_URL', 'http://my-server:11434');` |\n| Environment variable | `OLLAMA_API_BASE_URL=http://my-server:11434` |\n| Built-in default | `http://127.0.0.1:11434/v1` |\n\nThe plugin automatically appends `/v1` if you omit it.\n\n### Remote Ollama\n\nIf Ollama runs on a different machine or Docker container, just set the base URL to that host. Make sure the Ollama port (default `11434`) is accessible from your WordPress server.\n\n---\n\n## Architecture\n\n```\npromptiva-connector-for-ollama.php  ← entry point, hooks, REST endpoint, settings\nsrc/\n  autoload.php           ← lightweight PSR-4 autoloader (no Composer needed)\n  Provider/\n    OllamaProvider.php   ← extends AbstractApiProvider; registers with WP AI Client\n  Models/\n    OllamaTextGenerationModel.php  ← OpenAI-compatible chat completions\n  Metadata/\n    OllamaModelMetadataDirectory.php  ← dynamic model discovery via /v1/models\n  Support/\n    OllamaConfig.php     ← centralised URL / model config with priority chain\nassets/\n  connector-card.js      ← React UI for the wp-admin Connectors screen\n```\n\n### How the WP 7.0 AI integration works\n\n```\nWordPress AI Client (core)\n       │\n       ├─ asks registry for available providers\n       │\n       └─ OllamaProvider (this plugin)\n              │\n              ├─ OllamaModelMetadataDirectory  →  GET /v1/models\n              └─ OllamaTextGenerationModel     →  POST /v1/chat/completions\n```\n\n---\n\n## Contributing\n\nContributions are welcome and encouraged! Here's how to get started:\n\n### 1. Fork \u0026 clone\n\n```bash\ngit clone https://github.com/roddyka/api-provider-for-ollama.git\ncd api-provider-for-ollama\n```\n\n### 2. Set up your environment\n\n- PHP 7.4+ with `php` in your PATH\n- A local WordPress 7.0 install (e.g. [wp-env](https://developer.wordpress.org/block-editor/reference-guides/packages/packages-env/), LocalWP, or plain LAMP/MAMP)\n- Ollama running locally\n\n### 3. Install into WordPress\n\nSymlink or copy the plugin folder into `wp-content/plugins/promptiva-connector-for-ollama/` and activate.\n\n### 4. Make your changes\n\nThe codebase is intentionally small and dependency-free (no Composer). Key extension points:\n\n| Want to… | Look at… |\n|---|---|\n| Add image/multimodal support | `OllamaModelMetadataDirectory` — extend `$textCapabilities` |\n| Support streaming responses | `OllamaTextGenerationModel` — override request handling |\n| Add vision/embedding models | New model class extending the base |\n| Improve the admin UI | `assets/connector-card.js` (plain React via `wp.element`) |\n| Add more config options | `OllamaConfig.php` + `promptiva-connector-for-ollama.php` REST callback |\n\n### 5. Open a Pull Request\n\n- Keep PRs focused on one thing\n- Describe *what* and *why* in the PR description\n- If it's a new feature, open an issue first to discuss\n\n### Reporting bugs\n\n[Open an issue](https://github.com/roddyka/api-provider-for-ollama/issues) with:\n- WordPress version\n- PHP version\n- Ollama version \u0026 model(s) in use\n- Steps to reproduce\n\n---\n\n## Roadmap\n\n- [ ] Streaming response support\n- [ ] Image / multimodal model support (LLaVA, Moondream)\n- [ ] Embedding model support\n- [ ] WordPress.org plugin directory submission\n- [ ] Unit test suite (PHPUnit)\n- [ ] GitHub Actions CI\n\n---\n\n## FAQ\n\n**Q: Does this work with Ollama on Docker / a remote server?**  \nA: Yes. Set the base URL in the connector card or via the `OLLAMA_API_BASE_URL` constant/env var.\n\n**Q: Does it conflict with other AI providers (OpenAI, Anthropic)?**  \nA: No. It registers as a separate provider (`ollama-local`) alongside any other connectors.\n\n**Q: What models are supported?**  \nA: Any text generation model you have pulled in Ollama. The plugin discovers them automatically.\n\n**Q: I see \"unreachable\" in the card — what do I do?**  \nA: Make sure `ollama serve` is running and accessible from the WordPress server. Try `curl http://127.0.0.1:11434/v1/models`.\n\n---\n\n## License\n\n[GPL-2.0-or-later](https://spdx.org/licenses/GPL-2.0-or-later.html) — free and open source.\n\nExample:\n\n```php\ndefine('OLLAMA_API_BASE_URL', 'http://127.0.0.1:11434/v1');\n```\n\n## Usage\n\n```php\nuse WordPress\\AiClient\\AiClient;\n\n$result = AiClient::prompt('Say hello in Portuguese.')\n    -\u003eusingProvider('ollama-local')\n    -\u003egenerateTextResult();\n\necho $result-\u003etoText();\n```\n\n## Notes\n\n- This first version focuses on text generation.\n- The provider relies on Ollama's OpenAI-compatible APIs (`/v1/models` and `/v1/chat/completions`).\n- The Connectors screen lists this provider as keyless (`authentication: none`), which is the normal setup for local Ollama.\n- The current WordPress Connectors UI only supports built-in auth fields (`api_key` or `none`), so custom fields like base URL/model are not first-class form inputs there yet.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Froddyka%2Fapi-provider-for-ollama","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Froddyka%2Fapi-provider-for-ollama","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Froddyka%2Fapi-provider-for-ollama/lists"}