run_ai
Run inference on Cloudflare Workers AI models for text generation, embeddings, or classification. Requires human approval to execute; without approval returns a preview.
Instructions
Run inference on a Workers AI model (text generation, embeddings, classification). Requires confirm:true (human-approval gate); without it returns a preview only.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| account_id | No | Cloudflare account ID. Falls back to CLOUDFLARE_ACCOUNT_ID env var when omitted. | |
| model | Yes | Model id, e.g. @cf/meta/llama-3.1-8b-instruct or @cf/baai/bge-base-en-v1.5. | |
| input | Yes | Model inputs as a JSON object. For text generation use { prompt } or { messages: [...] }; for embeddings use { text }. | |
| confirm | No | Human-approval gate: must be true to actually perform this mutating operation. Omit or set false to get a non-executing preview of what would happen (with secrets redacted). A human should approve before this is set to true. |