Linux 软件免费装
Banner图

AI Provider for Cloudflare

开发者 deepakbhojwani
更新时间 2026年8月1日 22:05
PHP版本: 7.4 及以上
WordPress版本: 7.0.2
版权: GPL-2.0-or-later
版权网址: 版权信息

标签

ai cloudflare connector workers-ai llama

下载

1.0.0

详情介绍:

This plugin adds Cloudflare Workers AI as a provider for the WordPress AI Client. Unlike text-only connectors, it brings three capabilities to any AI-Client-powered feature, plugin, or theme — text generation, image generation, and image understanding (vision / alt text) — all running on Cloudflare's global edge network. Cloudflare Workers AI offers a free daily allocation (Neurons) on the free plan, and a single API token works across many hosted models — chat (Llama, Mistral, Gemma, Qwen, DeepSeek, and more), FLUX image generation, and multimodal vision. What you get: The model list is read live from Cloudflare's model catalog, which is account-accurate, so only models your account can actually call are surfaced. Requirements: This plugin is a provider add-on: on its own it does nothing visible. It only takes effect once the PHP AI Client is available and another plugin (or your code) makes an AI request using the cloudflare provider.

安装:

  1. Upload the plugin files to /wp-content/plugins/ai-provider-for-cloudflare/, or install through the WordPress plugins screen.
  2. Activate the plugin through the 'Plugins' menu in WordPress.
  3. Ensure the PHP AI Client is available (bundled with WordPress 7.0, or via the WordPress AI plugin / the wordpress/php-ai-client package on WordPress 6.9).
  4. Configure your Cloudflare credentials. Cloudflare needs two values — your account ID and an API token — because the account ID is part of every Cloudflare API URL. Provide them in either of these ways:
  5. On the AI provider screen (recommended): in the Cloudflare API key field, enter both values joined by a colon, as account-id:api-token (for example cc3a43c9...:cfut_...). No file editing is needed.
  6. In wp-config.php: put the token in the key and the account ID in a constant (or set environment variables of the same names):
define( 'CLOUDFLARE_API_KEY', 'your-workers-ai-api-token' ); define( 'CLOUDFLARE_ACCOUNT_ID', 'your-account-id' );

常见问题:

How do I get a Cloudflare API token and account ID?

Sign in at dash.cloudflare.com, open Workers AI, and choose "Use REST API". From there you can create a Workers AI API token (it needs both the "Workers AI - Read" and "Workers AI - Edit" permissions) and copy your account ID, which is shown on the same page.

Why do I need an account ID as well as a token?

Cloudflare's API URL includes your account ID (for example …/accounts/{account_id}/ai/…), so the plugin cannot make any request without it, and a Workers AI token cannot reveal the account ID on its own. The easiest way is to enter account-id:api-token in the API key field; alternatively set the CLOUDFLARE_ACCOUNT_ID constant and put just the token in the key. The account ID is not a secret, but it is required.

Does this plugin work without the PHP AI Client?

No. This plugin requires the PHP AI Client. It provides the Cloudflare-specific implementation that the PHP AI Client uses, and registers itself automatically when the client is available.

Which models are supported?

The chat (text generation) models from Cloudflare's live catalog (Llama, Mistral, Gemma, Qwen, DeepSeek, GPT-OSS, and more), including vision-capable models that also accept image input, plus the FLUX.1 [schnell], FLUX.2 [dev], and FLUX.2 [klein] image generation models. JSON mode and function calling are available on the subset of models that support them.

Does this plugin generate images?

Yes. It supports the Cloudflare-hosted FLUX.1 [schnell] and FLUX.2 ([dev], [klein-4b], [klein-9b]) image generation models. Vision-capable chat models can additionally accept images as input.

Does image understanding / alt text generation work?

Yes. Image input (used by features such as alt text generation) is handled by a multimodal chat model. By default Mistral Small 3.1 is used: it is not license-gated (so it works on every account with no extra setup) and reliably follows accessibility instructions — writing real alt text for informative images and detecting decorative ones. Cloudflare's dedicated vision model, Llama 3.2 Vision, is also available for general image description, but it requires you to accept Meta's Llama license once before first use (open that model in the Cloudflare dashboard and click Agree, or send it one request with the prompt "agree"); until then it returns a 403, and it is not the default.

Is there a free tier?

Cloudflare Workers AI includes a free daily allocation on the free plan. Usage beyond that requires the Workers Paid plan. See Cloudflare's pricing for current limits.

Is this plugin affiliated with Cloudflare?

No. Cloudflare and Workers AI are trademarks of Cloudflare, Inc. This plugin is an independent integration and is not affiliated with, endorsed by, or sponsored by Cloudflare, Inc.

更新日志:

1.0.0