Linux 软件免费装
Banner图

AI Valve

开发者 PerS
更新时间 2026年5月26日 16:01
PHP版本: 8.3 及以上
WordPress版本: 7.0
版权: GPL-2.0-or-later
版权网址: 版权信息

标签

ai tokens connector governance cost-control

下载

1.1.6

详情介绍:

AI Valve gives site administrators visibility and control over how plugins use the built-in WordPress AI connector. Features Requirements

安装:

  1. Install AI Valve from the WordPress plugin directory, or upload soderlind-aivalve.zip via Plugins → Add New → Upload Plugin.
  2. Activate the plugin.
  3. Go to Settings → AI Valve to configure.

屏幕截图:

  • Dashboard with usage summary cards and per-plugin breakdown.

升级注意事项:

0.4.0 Admin UI rebuilt with React for faster, client-side rendering. 0.3.0 Dashboard enhancements: model filter, provider+model breakdown, per-plugin bar chart, side-by-side layout. 0.2.0 Bug fixes for log status storage and filtering. New: date range filter, context breakdown, per-plugin alerts, CSV export. 0.1.0 Initial release.

常见问题:

What are tokens?

Tokens are the units AI models use to measure input and output. Roughly 1 token ≈ ¾ of a word. Both the text you send (prompt tokens) and the text the AI returns (completion tokens) count toward your usage.

What does "limit = 0" mean?

A limit of 0 means unlimited — no cap is enforced. Set a positive number to restrict token usage.

How does AI Valve identify which plugin made an AI request?

It walks the PHP call stack (debug_backtrace()) and matches file paths against the plugins directory to determine the originating plugin slug.

Will this work with future WordPress updates?

Yes. AI Valve relies only on the stable public hooks (wp_ai_client_prevent_prompt, wp_ai_client_before_generate_result, wp_ai_client_after_generate_result) provided by the WordPress AI connector API.

Are there developer hooks?

Yes. See the developer hooks documentation for available filters and actions.

Does AI Valve work on multisite?

Yes. Each subsite has its own log table, settings, and budgets.

What happens when a plugin is blocked?

The plugin receives a WP_Error with code prompt_prevented instead of an AI response. The denied request is logged with the reason. See how-blocking-works.md for the full explanation.

How do I block all plugins and only allow specific ones?

  1. Go to Settings → AI Valve → Settings.
  2. Set the Default policy to Deny.
  3. Switch to the Dashboard tab.
  4. In the Per-plugin access table, set the plugins you want to allow to Allow.
Only explicitly allowed plugins will be able to make AI requests; everything else is denied by default.

更新日志:

1.1.6 1.1.5 1.1.4 1.1.3 1.1.2 1.1.1 1.1.0 1.0.4 1.0.3 1.0.2 1.0.1 1.0.0 0.6.0 0.5.0 0.4.0 0.3.0 0.2.0 0.1.0