| 开发者 |
deshabhishek007
fitehal |
|---|---|
| 更新时间 | 2026年10月5日 04:13 |
| PHP版本: | 8.2 及以上 |
| WordPress版本: | 7.1 |
| 版权: | GPL-2.0-or-later |
| 版权网址: | 版权信息 |
aipcf_translate( $text, 'mr' ), 100 languages via M2M100 and 22 Indian languages via IndicTrans2.wp aipcf embed commands for large sites.[aipcf_related], or added automatically (after the content, before it or after a paragraph). Lists are built in the background from the stored vectors: no neurons, nothing runs when a visitor opens a page. Each entry can say why it is related.[aipcf_search] finds posts by meaning, for logged-in members (you choose which roles), and can lead the site's normal search results for them. Visitors who are not logged in get the normal WordPress search, so nobody outside can spend your neurons. Results only, no generated answers.aipcf_prompt filter.
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, Embeddings and the content tools, usage tracking, daily budget, and aipcf_translate() for developers) work without it.
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.
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: Backfill, Embeddings, Link assistant chat, the Site assistant, Member search, Search insights, image generation, image reading (alt text) and translation pause either way. 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.
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. The Models tab shows the neurons per 1,000 tokens for every model on your account, read from Cloudflare's price list.
That is expected for some requests, and the Overview and Models tabs 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 the Models tab. 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.
Not for AIPCF's own features (backfill, Embeddings and the content tools, 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.
Backfill, Embeddings, the content tools and the budget do, and so does aipcf_translate(). The in-editor buttons come from the WordPress AI plugin and need the block editor.
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 Embeddings 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.
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.
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 uses them for Related posts, the Link assistant, Member search and Search insights.
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).
Yes, without paying again. Pick the new store on the Embeddings tab (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 the Embeddings tab 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.
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. The Embeddings tab estimates your site before you start, and Embeddings has a daily limit.
Switch Embeddings off to stop sending anything. "Delete vectors" on the Embeddings tab 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.
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.
Switch off Backfill ("Run hourly") on the Backfill tab and it stops after the current batch. Descriptions it wrote are ordinary post meta; edit or clear them like any other. The tab shows the last skipped item, with "Retry skipped items" to try skipped items again.
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.
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.
Yes. The Prompts tab holds every prompt the plugin sends on its own behalf, with placeholders and a test button. Developers can also use the aipcf_prompt filter.
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.
WordPress asks administrators to allow each AI connector once. "Apply recommended defaults" does it for you; otherwise go to Tools > Connector Approvals and allow Cloudflare Workers AI there.
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.
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.
"Reset plugin" at the foot of the About card 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 the Embeddings tab 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 Embeddings exclusions and decorative marks, on every site of a network. The API token on Settings > Connectors is WordPress's own setting: remove it there.
Related posts: no neurons (lists come from stored vectors); one vector store query per post when its list is built. Member 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 Cloudflare AI > Settings > Content tools. 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.
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 the Budget tab, 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 Cloudflare AI > 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.
Administrators, under Cloudflare AI > Search 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.
Yes; settings and usage history carry over both ways. Versions before 1.9.0 do not know about Embeddings, 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.
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( ... ).
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 Embeddings are switched off.
wp aipcf related refresh [--all] # build related lists now
wp aipcf related show 123 # a post's list with scores
wp aipcf activity list [--tool=backfill] [--failed] # recent entries
wp aipcf activity export --file=activity.csv # the same CSV as Download CSV
[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 Content tools 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 Member search a <form class="aipcf-search"> with an <ol class="aipcf-search__list">; both take the theme's styles.
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 ).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 ).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).
No. The AI Client arrives in WordPress 7.0; the plugin does nothing on older versions.
wp aipcf embed move <store>, --status, --cancel and wp aipcf embed cleanup-old.why="yes" on the shortcode.aipcf_translate() in the last 30 days; AIPCF has no translation screen of its own.wp aipcf activity list and wp aipcf activity export.wp aipcf embed status | estimate | run --until-done | reconcile | retry | rebuild | purge | search.[aipcf_related] or after the content, built in the background from stored vectors: no neurons, nothing runs on page views.[aipcf_search], by meaning, for logged-in members; optionally leads the site's search results for them. Visitors keep the normal search.aipcf_translate().