Linux 软件免费装
Banner图

AIPCF - AI Provider for Cloudflare

开发者 deshabhishek007
fitehal
更新时间 2026年10月27日 20:53
PHP版本: 8.2 及以上
WordPress版本: 7.1
版权: GPL-2.0-or-later
版权网址: 版权信息

标签

ai alt-text cloudflare image-generation meta-description

下载

2.0.0 1.8.12 1.8.13 1.0.0 1.0.1 1.0.3 1.0.2 1.9.0 1.10.0 1.11.0 1.8.14 1.11.1 1.11.2

详情介绍:

AIPCF connects WordPress to Cloudflare Workers AI. Once connected, the AI features built into WordPress 7.0+ and the WordPress AI plugin run on Cloudflare's models: excerpts, titles and meta descriptions in the editor, alt text on upload, image generation. On top of that, AIPCF can search your posts by meaning, answer questions from them, suggest related posts and internal links, and let AI agents such as Claude and ChatGPT search and quote your site. Everything runs inside Cloudflare's free daily allowance of 10,000 neurons, and a daily budget keeps a busy day from turning into a bill. AIPCF is an independent community plugin, not an official Cloudflare or WordPress product. It was built out of need, and love for the idea that every small site should get useful AI without a bill. New in 2.0 What it costs, measured on a live site What you get What you need
  1. A Cloudflare account. No credit card is needed for the Workers AI daily allowance.
  2. An API token created from the "Workers AI" template at dash.cloudflare.com/profile/api-tokens. To keep the content index in Cloudflare Vectorize, add Account > Vectorize > Edit. To count the whole account's use, add Account > Account Analytics > Read.
  3. Your Account ID, the 32-character code on the right of the Workers & Pages page in the Cloudflare dashboard.
The setup walks through all three. How it stays inside the allowance The content index The features that search your content need a content index: the posts you choose, turned into embeddings (lists of numbers that capture what a text is about) and kept in Cloudflare Vectorize, Qdrant or PostgreSQL. It stays in sync as you edit, shows its cost before anything is sent, and is off until you switch it on, on Settings > Content index. Indexing whoisabhi.com (166 posts and pages) took about 60 neurons. What the content index is used for Each feature is off until you switch it on under AIPCF > Features, and each has a daily limit. The AI plugin (recommended) AIPCF is the engine. The WordPress AI plugin adds the block-editor features that use it: excerpts, titles, meta descriptions, alt text on upload, summaries, image generation. It is recommended, not required; AIPCF's own features (Backfill, the content index and the features on it, usage tracking, the daily budget, and aipcf_translate() for developers) work without it.

安装:

  1. Install and activate the plugin. The setup opens: AIPCF > Setup.
  2. Connect: your Account ID, and your Cloudflare API token on Settings > Connectors (WordPress 7.0+ manages provider keys there). The setup has the exact clicks for creating the token.
  3. Choose what you want AIPCF to do. If a choice needs the content index, the setup builds it next.
  4. Check the recommended settings and the daily budget, and finish. You land on AIPCF > Home.
  5. Optional: install the WordPress AI plugin for AI in the block editor, and enter an AI Gateway name on Settings > Connection for edge caching and logs.
You can run the setup again from AIPCF > Help. wp-config.php constants (optional) define( 'CLOUDFLARE_WORKERS_AI_ACCOUNT_ID', 'your-account-id' ); define( 'CLOUDFLARE_WORKERS_AI_API_TOKEN', 'your-api-token' ); define( 'CLOUDFLARE_WORKERS_AI_DEFAULT_MODEL', '@cf/google/gemma-4-26b-a4b-it' ); define( 'CLOUDFLARE_AI_GATEWAY_TOKEN', 'gateway-auth-token' ); // only for authenticated gateways define( 'AIPCF_QDRANT_API_KEY', 'qdrant-api-key' ); // content index in Qdrant define( 'AIPCF_PG_PASSWORD', 'postgres-password' ); // content index in PostgreSQL Settings saved on the page take precedence over the constants. Environment variables with the same names are also read.

屏幕截图:

  • The setup, from nothing to a working site: what AIPCF does, what it costs and where your data goes.
  • Features: one card for each feature, each off until you switch it on.
  • Settings > Models: who does what now, and the model for each kind of request, with its cost.
  • Settings > Budget: the daily budget, what happens when it is reached, and the whole account's use.
  • AI agents: let agents such as Claude search and quote your site, read-only, with how to connect them.
  • Backfill: missing meta descriptions and alt text, filled in the background within a daily limit.
  • Help: checks, recent errors and a diagnostics report for support.

升级注意事项:

2.0.0 A new, simpler admin: AIPCF > Home, Features, Insights, Settings, Activity and Help, with a guided setup. Adds Best matches in the site's search, answers for AI agents, and counting the whole account's use. All settings are kept; new features are off until you switch them on. 1.11.2 If the AI plugin (1.3.0) blocks this plugin, Site Health now says to approve it on Tools > Connector Approvals instead of blaming your token. 1.11.1 Fixes the Site assistant page: the usage bar now shows the day's use, and the description follows who can use the chat. 1.11.0 Adds the Site assistant: a chat for members, or every visitor, that answers from your own posts, with guardrails you can add to. Switching vector stores now copies the vectors (no neurons, no gap in related posts or search) and offers to delete what is left in the old store. 1.10.0 Adds Cloudflare AI > Activity: what people did in the plugin and what it did on its own, with every change Backfill made, and a CSV download. Administrators only; entries are kept 90 days by default. 1.9.0 Requires PHP 8.2+. Adds Embeddings (beta) in Vectorize, Qdrant or PostgreSQL, and on them Related posts, the Link assistant, Member search and Search insights. All off until switched on; existing features unchanged. 1.8.14 Fixes a crash when saving a customised prompt, plus backfill and budget fixes. The settings now show which model answers each kind of request (alt text uses a vision model, usually Llama 3.2 Vision), and Meta's licence for it can be accepted with one click. Settings are kept. 1.8.12 Big update from 1.0.3: new "Cloudflare AI" menu (old links redirect), newer models, neuron budget guard, AI Gateway, backfill, images, translation. Credentials and model choice are kept; recommended defaults are offered, nothing changes until you click.

常见问题:

Is it really free?

Cloudflare Workers AI includes 10,000 neurons a day on every account, with no card on file. Measured on a live site, a meta description costs about 2 neurons and an alt text about 17, so a normal site never gets near the limit. Above the allowance Cloudflare bills per neuron at its published rate; the plugin's daily budget is there so that does not happen by accident.

What happens when the daily budget is reached?

You choose: pause AI requests until midnight UTC, or switch text requests to the cheapest model on your account. Only text requests have a cheaper model: Everything else pauses either way: Backfill, the content index, Link assistant chat, the Site assistant, Search, Search insights, AI agents, image generation, image reading (alt text) and translation. Generated images count about 170 neurons each when Cloudflare does not report the figure. Either way you get an email at 80% and at 100%. The count resets at midnight UTC.

Which model should I use?

Start with the recommended defaults: Gemma 4 26B for writing and Granite 4 Micro for short tasks. They were picked by measuring output quality against neurons on real posts. Llama 3.3 70B writes a little better and costs several times more per token. Settings > Models shows the neurons per 1,000 tokens for every model on your account, read from Cloudflare's price list.

I picked a model, but the logs show a different one (often Llama)

That is expected for some requests, and Home and Settings > Models list the model for each one under "Current model setup". Writing uses your default model. Short tasks (titles, excerpts, meta descriptions, alt text wording) use the light model if you set one; a model you pick for a feature in the AI plugin is used as picked. Anything that reads an image, such as alt text, uses the vision model, because text models cannot see images; on most accounts that is Llama 3.2 11B Vision, and you can pick another vision model on Settings > Models. Generated images use the image model, translation uses M2M100 or IndicTrans2, and once the daily budget is used up text requests can switch to the cheapest model. The AI Gateway logs show which feature sent each request in the metadata field.

Which Workers AI models can I use?

The model list is read from your account and cached for 12 hours. Each entry shows context window, neurons per 1,000 tokens from your account's current price list, and whether it supports tool calling or image input.

  • Chat models: Llama, Gemma, GPT-OSS, Qwen, Mistral, DeepSeek, GLM, Granite, Kimi, Nemotron and whatever Cloudflare adds next. Requests use Cloudflare's OpenAI-compatible endpoint, so new families work without a plugin update.
  • Tool calling, JSON output with schema, system instructions, stop sequences and penalties through the standard AI Client API. Reasoning models keep their thinking on the AI Client's thought channel, out of the answer.
  • Vision: a vision model (Llama 3.2 11B Vision on most accounts, selectable on Settings > Models) reads inline and remote images. Your default text model is not used for images.
  • Image generation: FLUX.1 schnell, SDXL Lightning, SDXL, DreamShaper, Leonardo Lucid Origin and Phoenix.

Do I need the WordPress AI plugin?

Not for AIPCF's own features (Backfill, the content index and the features on it, usage tracking, daily budget, and aipcf_translate() for developers). You need it for AI inside the block editor: excerpts, titles, meta descriptions, summaries, alt text on upload and image generation. Install it from wordpress.org; AIPCF registers itself as the provider.

Does it work with the Classic editor?

Backfill, the content index and the features on it, and the budget do, and so does aipcf_translate(). The in-editor buttons come from the WordPress AI plugin and need the block editor.

Where does my content go?

To Cloudflare. When a feature runs, the post title and content (or the image) go to Cloudflare Workers AI on your own account. Nothing is sent until you enter your credentials, and the External Services section below lists every endpoint. With an AI Gateway you decide in the Cloudflare dashboard whether prompts are logged. If you switch the content index on, the content you selected is also stored, with its embeddings, in the vector store you chose: Cloudflare Vectorize on your account, your Qdrant server or Qdrant Cloud cluster, or your PostgreSQL database. Nothing else receives it. Embedding requests go through your AI Gateway (when you use one) with payload logging off, so the gateway's logs never hold a copy of your content. Author names are embedded only if you tick "Author name", and change in the vector store when a name changes or a user's posts are reassigned.

Where is my API token stored?

On WordPress 7.0+ it lives in the core Connectors screen (Settings > Connectors), like every other AI provider key. You can also define it as a constant in wp-config.php. The plugin never sends it anywhere except Cloudflare.

What goes into the content index, and where is it kept?

  • You choose what goes in: post types (products and other custom types too), images, published and/or private content, which fields (title, content, excerpt, categories and tags, author, SEO description, custom fields), a date cut-off, and categories or tags to include or leave out. Any post can be left out from its editor, and password-protected content never goes in.
  • You choose where it is stored: Cloudflare Vectorize on the same account (included in the Workers Free plan), a Qdrant server or Qdrant Cloud, or PostgreSQL with pgvector. Switching store later moves the index, at no neuron cost.
  • It stays in sync: saving, trashing or deleting a post updates the index within about a minute; an unchanged save costs nothing.
  • You see the cost first: an estimate of parts of posts, neurons and storage before anything is sent. Indexing whoisabhi.com (166 posts and pages) took about 60 neurons, well inside one day's allowance, with a daily limit of its own on top of the daily budget.
  • Test search on the settings screen, and wp aipcf embed commands for large sites.
The default model is BGE-M3 (multilingual, 1,024 dimensions). Search, the Site assistant and AI agents order results by your words and their meaning together. The best 20 can be checked again with BGE Reranker, so the parts that really answer the question come first.

What are embeddings for?

An embedding is a list of numbers that captures what a piece of text is about, so text with a similar meaning gets similar numbers. Kept in a vector store, they let a site find posts by meaning instead of by keyword ("how much does it cost" finds the pricing page) and suggest truly related posts. AIPCF keeps them as the content index, for the Site assistant, Related posts, Search, the Link assistant, Search insights and AI agents.

Which vector store should I choose?

Cloudflare Vectorize if you want nothing else to run: it uses the same Cloudflare account and token (add the permission Account > Vectorize > Edit), and the Workers Free plan stores about 4,900 passages at 1,024 dimensions, enough for a few hundred posts. Bigger sites need Workers Paid ($5 a month, 10 million stored dimensions included). Qdrant if you already run it or want Qdrant Cloud's free 1 GB cluster. PostgreSQL with pgvector if you have such a database; your host's PHP needs the pdo_pgsql extension, which many do not enable (the settings page tells you).

Can I switch to another vector store later?

Yes, without paying again. Pick the new store on Settings > Content index (set up its connection first) and save: the vectors are copied from the old store, not embedded again, so it costs no neurons. Related posts and search keep using the old store until the move is done, and you can cancel it. Afterwards Settings > Content index offers to delete what is left in the old store. Posts edited since they were embedded, and a change of embedding model, do need new embeddings. From WP-CLI: wp aipcf embed move qdrant.

How much does the content index cost?

With BGE-M3, about 1,070 neurons per million tokens. Cloudflare reports no usage for embeddings, so the plugin estimates it from text length and shows it with a "~". A typical blog post of 2,000 characters costs under 1 neuron; a 150-post blog about 60. Settings > Content index estimates your site before you start, and Embeddings has a daily limit.

Can I stop the content index, or remove what is stored?

Switch the content index off to stop sending anything. "Delete vectors" on Settings > Content index switches it off and deletes this site's vectors from the vector store (the whole index when it is the site's own, only this site's entries when the index is shared). Resetting or deleting the plugin removes its own tables and settings but never deletes anything in the vector store, so use "Delete vectors" first if you want them gone.

Will the backfill overwrite descriptions or alt text I wrote?

No. It only fills empty fields. Posts that already have a meta description and images that already have alt text are never touched. It writes to the meta key of your SEO plugin (Yoast, Rank Math, AIOSEO or SEOPress), so you can edit the result where you always do.

Can I stop the backfill, or undo it?

Switch off Backfill ("Run every hour") on AIPCF > Features > Backfill and it stops after the current batch. Descriptions it wrote are ordinary post meta; edit or clear them like any other. The screen shows the last skipped item, with "Retry skipped items" to try skipped items again.

Does it slow my site down?

No. Requests only happen when a feature runs, and the backfill runs in the background through WP-Cron, one batch an hour. Visitors never wait on Cloudflare.

What does an AI Gateway add?

Enter a gateway name on Settings > Connection and requests go through Cloudflare AI Gateway for edge caching, rate limits, spend limits, logs and analytics. Each request is tagged with the site, feature, model and user, so the gateway's analytics answer "which feature is spending my neurons". If the gateway ever refuses a request, the plugin falls back to direct calls for an hour and tells you.

Can I use one Cloudflare account for several sites?

Yes, and many people do. Keep in mind the 10,000-neuron allowance is per Cloudflare account, not per site, so set each site's daily budget to a share of it. An AI Gateway shows the usage of all sites in one place.

Can I change what the plugin asks the model?

Yes. Settings > Prompts holds every prompt the plugin sends on its own behalf, with placeholders and a test button. Developers can also use the aipcf_prompt filter.

A model says "Model Agreement: Prior to using this model, you must submit the prompt 'agree'"

This is Meta's license for its Llama models, not a license of this plugin. Cloudflare will not run some Meta models (Llama 3.2 Vision) on your account until Meta's Llama Community License and Acceptable Use Policy have been accepted once, and Cloudflare keeps the record of that acceptance. AIPCF has no license of its own to accept: it shows a notice with Meta's terms and an "Accept Meta's license and send it to Cloudflare" button, which sends it with your own token. A curl command is included if you prefer to send it yourself.

I get "connector has not been approved"

WordPress asks administrators to allow each AI connector once. The setup does it for you; otherwise go to Tools > Connector Approvals and allow Cloudflare Workers AI there.

Requests time out

The plugin waits up to 60 seconds. 70B-class and reasoning models can take longer on a cold start. Raise the limit with the aipcf_request_timeout filter or pick a smaller model.

Reasoning models return an empty answer

Qwen3, GLM and GPT-OSS spend tokens thinking before they answer. The plugin turns thinking off by default where the model allows it and applies a 2,048-token output limit when the caller sets none. If you still see empty answers, raise max_tokens or pick a non-reasoning model.

How do I start over, or remove everything?

"Reset AIPCF" at the foot of AIPCF > Help deletes the plugin's settings, including the credentials saved in them, your prompt edits, usage history, backfill progress, caches, embeddings tracking, the Link assistant's data, logged searches and the "What to write next" analysis, and the Related lists. It keeps what the plugin wrote into your posts (meta descriptions, alt text), the posts you left out of Embeddings and the images you marked decorative. Credentials set in wp-config.php or environment variables are not touched. Reset does not touch the vector store: vectors already there stay, and "Delete vectors" on Settings > Content index deletes them. Use it before Reset if you want them gone. Deleting the plugin from the Plugins screen does the same cleanup and also removes the content index exclusions and decorative marks, on every site of a network. The API token on Settings > Connectors is WordPress's own setting: remove it there.

Do Related posts, Search or Search insights cost anything?

Related posts: no neurons (lists come from stored vectors); one vector store query per post when its list is built. Search: about 0.03 neurons per search, one vector store query, cached for an hour. Search insights: about 0.03 neurons per distinct search compared, and one request to your default model when you ask "What to write next". The Link assistant's suggestions are free; each chat message is one short request to your light model. Each tool has a daily limit in AIPCF > Features. On the Vectorize free plan (30 million queried dimensions a month, about 29,000 queries), Site Health warns when the month's queries are heading past it.

What does the Site assistant cost, and what does it store?

Each question is one search (about 0.03 neurons) and one answer from your default text model, typically 10 to 30 neurons; the optional safety check adds a small Llama Guard request per question and per answer. It has its own daily limit on its screen, and visitors (if you let them in) get only a share of it and a number of questions each per day. Chats are stored in your database only when the person ticks "save this chat": their name (no email), the questions, the answers and the posts cited. Administrators see them under AIPCF > Features > Site assistant, with a CSV download. They are deleted after 90 days (adjustable), are covered by WordPress's personal data export and erase tools, and the suggested privacy-policy text describes them. Visitors' IP addresses are never stored: the daily count uses a one-way key that changes every day.

Who can see Search insights, and what is stored?

Administrators, under AIPCF > Insights. For each search: the text, when, how many results, the best match and whether the searcher was logged in. No user account, IP address or browser details. Bots are skipped, a repeat by the same visitor within an hour counts once, rows are capped each day, and searches are deleted after 90 days (adjustable). Off by default; the suggested privacy-policy text covers it.

Can I go back to an earlier version?

Yes; settings and usage history carry over both ways. Versions before 1.9.0 do not know about the content index, so they do not follow edits meanwhile; when 1.9.0 or later is back, it checks every item again and catches up (unchanged content costs nothing). The same happens after the plugin has been deactivated. Deleting the plugin while an earlier version is installed leaves the data added in 1.9.0 behind (tables, options and post meta for Embeddings and the Content tools). The same goes for the activity log added in 1.10.0 and the saved chats added in 1.11.0. Reinstall the latest version and delete it again to remove everything.

How do I use it from my own code?

Any feature or plugin built on the WordPress AI Client uses Cloudflare Workers AI once the plugin is configured. Direct calls: use WordPress\AiClient\AiClient; // Uses the model chosen in Settings. $result = AiClient::prompt( 'Summarize this post in two sentences.' ) ->usingProvider( 'cloudflare-workers-ai' ) ->generateTextResult(); echo $result->toText(); // A specific model: $model = AiClient::defaultRegistry()->getProviderModel( 'cloudflare-workers-ai', '@cf/qwen/qwen2.5-coder-32b-instruct' ); $result = AiClient::prompt( 'Write a PHP function that slugifies a string.' )->usingModel( $model )->generateTextResult(); // Translation: echo aipcf_translate( 'Good morning', 'mr' ); // Marathi via IndicTrans2 echo aipcf_translate( 'Bonjour', 'en', 'fr' ); // any pair via M2M100 Structured output and tools use the standard AI Client API: ->asJsonResponse( $schema ) and ->usingFunctionDeclarations( ... ).

Which WP-CLI commands are there?

wp aipcf embed status [--store] # embedded, waiting, failed; the vector store's own count wp aipcf embed estimate # passages, tokens, neurons and storage for the selection wp aipcf embed run --until-done # embed everything now (large sites); resumable wp aipcf embed search "query" # test a search wp aipcf embed reconcile | retry | rebuild | purge wp aipcf embed move [--index=] # copy the vectors to another store, no neurons wp aipcf embed move --status | --cancel wp aipcf embed cleanup-old # delete what a move left in the old store run, reconcile and rebuild refuse to work while the content index is switched off. wp aipcf related refresh [--all] # build related lists now wp aipcf related show 123 # a post's list with scores wp aipcf doctor # run every check; exits 1 if something needs fixing wp aipcf diagnostics export --file=report.txt # the diagnostics report from Help, without secrets wp aipcf activity list [--tool=backfill] [--failed] # recent entries wp aipcf activity export --file=activity.csv # the same CSV as Download CSV

Which shortcodes are there?

[aipcf_related count="5" title="Related posts" heading="h2" excerpt="no" thumbnail="no"] [aipcf_search placeholder="Search by meaning" results="10"] count is 1 to 12 (default: the Related posts setting, 5), heading is h2, h3, h4 or p, and only posts at least as similar as the "Minimum similarity" setting (default 0.55, a 55% match) are listed. results is 1 to 20. Related posts outputs a <nav class="aipcf-related"> list and Search a <form class="aipcf-search"> with an <ol class="aipcf-search__list">; both take the theme's styles.

Which filters are there?

  • aipcf_prompt( $text, $key, $vars ): final say on any plugin-owned prompt.
  • aipcf_route_text_model( $model, $requested, $task ): override which model serves a request.
  • aipcf_available_models( $models ): adjust the model list before it is cached.
  • aipcf_request_timeout( $seconds, $model ), aipcf_default_max_tokens, aipcf_disable_thinking, aipcf_system_instruction_suffix.
  • aipcf_gateway_headers( $headers, $task, $model ), aipcf_gateway_metadata, aipcf_gateway_enabled.
  • aipcf_over_budget, aipcf_cheapest_model, aipcf_local_cache_ttl, aipcf_regenerate_window.
  • aipcf_backfill_meta_description_key, aipcf_backfill_alt_prompt, aipcf_vision_model.
  • aipcf_image_neurons_estimate( $neurons, $model ), aipcf_translation_neurons_per_1k( $rate, $model ): what to count when Cloudflare reports no neurons; aipcf_vision_byte_array_max( $bytes ).
  • Search: aipcf_best_matches_auto (return false to place the Best matches block yourself with do_action( 'aipcf_best_matches' ) in the search template), aipcf_search_styles (return false to leave out the plugin's search styles). The accent colour is the CSS variable --aipcf-search-accent, which can be set on any element around the results.
  • Content index: aipcf_embed_should_index( $bool, $post ), aipcf_embed_text( $text, $post ), aipcf_embed_metadata( $metadata, $post ), aipcf_embed_post_types( $types ), aipcf_embed_locale( $locale, $post ), aipcf_embedding_models( $models ), aipcf_vector_store( $store, $id, $index ) (supply your own store), aipcf_vectorize_token( $token ).
Actions: aipcf_usage_recorded, aipcf_cache_hit, aipcf_gateway_marked_down, aipcf_backfill_meta_description, aipcf_backfill_alt_text, aipcf_defaults_applied, aipcf_model_licence_accepted( $model, $owner ) (after Cloudflare confirms your acceptance of a model publisher's license, such as Meta's). REST (users who can edit posts): GET /wp-json/aipcf/v1/last (last request's receipt), GET /wp-json/aipcf/v1/usage (today's totals).

Does this work without WordPress 7.0?

No. The AI Client arrives in WordPress 7.0; the plugin does nothing on older versions.

更新日志:

2.0.0 One simple, consistent plugin that answers well, for people and for AI agents. Your settings, stored data, shortcodes, hooks and WP-CLI commands carry over unchanged. 1.11.2 1.11.1 1.11.0 1.10.0 1.9.0 1.8.14 1.8.13 1.8.12 The first update since 1.0.3. If you are coming from 1.0.3, this is what changed: 1.7.8 1.6.0 1.5.0 1.4.8 1.3.0 1.2.0 1.1.2 1.0.0