Install command
Provided
Run AI inference and serverless functions on Cloudflare Workers AI: call hosted models like Llama, Whisper, and Stable Diffusion through the Workers AI binding, deploy with wrangler, and use D1/R2/KV storage plus the free daily Neuron allocation.
Open the source and read safety notes before installing.
Source-backed facts for citing this resource, derived directly from the registry — also available as plain text for AI assistants.
Decision playbook
Signals are comparatively strong, but you should still validate source, privacy posture, and package provenance for your environment.
0
96
—
No baseline selected
No major trust-signal divergence detected in the current selection.
Confirm ownership and provenance before trusting install instructions.
Source link availableRequired
Open the canonical repository and verify ownership.
Source provenance statusRequired
Marked as first-party.
Metadata reviewed
Registry metadata indicates a reviewed listing.
Validate risk disclosures before installation or API wiring.
Safety notes presentRequired
Review the listed safety guidance before running commands.
Privacy notes presentRequired
Review data handling notes before connecting accounts or secrets.
Trust level risk gateRequired
Trust level does not block evaluation.
Check package metadata and artifact integrity signals.
Install payload available
Install or copy payload is available for review.
Package verification flag
Package marked verified.
Checksum metadata
SHA-256 hash is present.
Use compare context to validate trade-offs before adoption.
Compare tray has multiple entries
Add at least one more entry to compare trust differences.
Baseline comparison available
No baseline peer selected yet.
Diverging trust signals identified
No major trust-signal divergence found.
Setup at a glance
Copy-ready — paste the snippet to get started.
Install command
Provided
Config snippet
Not provided
Copy snippet
Provided
Prerequisites
6 to clear
Platforms
6 listed
Difficulty
100/100
Adoption plan
Current risk score 0/100. Use staged verification before broader rollout.
Validate source and review signals before any execution.
Confirm source provenanceRequired
Source URL/provenance metadata is present.
Confirm metadata review state
Listing has review metadata.
Verify install payload
Install/config payload exists and can be inspected.
Confirm safety, privacy, and package integrity signals.
Review safety notesRequired
Safety notes are present.
Review privacy notesRequired
Privacy notes are present.
Verify package integrity metadata
Package verification/checksum metadata is available.
Adopt in controlled steps based on the selected plan.
Run in isolated sandbox firstRequired
Use a constrained sandbox and observe behavior across multiple tasks.
Roll out graduallyRequired
Roll out to a small cohort before wider usage.
Set monitoring and fallback
Define rollback path and monitor errors after adoption.
Evidence readiness
Required evidence gates are covered (6/6 signals complete).
Source repository/provenance is listed.
Required in this preset
Review metadata is present.
Required in this preset
Safety notes are present.
Required in this preset
Privacy notes are present.
Optional in this preset
Package integrity metadata is present.
Optional in this preset
Install payload is available.
Required in this preset
Required evidence gates are covered for this preset.
Decision timeline
6/6 steps complete with no blocking gaps for this preset.
triage
Source/provenance metadata is available.
triage
Review metadata is available.
verify
Safety notes are available.
verify
Privacy notes are available.
verify
Package integrity metadata is available.
rollout
Install payload is available.
No required blockers for this timeline preset.
Prerequisite readiness
6 prerequisites to line up before setup. Have accounts and credentials ready first.
Safety & privacy surface
2 safety and 2 privacy notes across 4 risk areas. Review closely: credentials & tokens, network access.
| Platform | Support | Install path |
|---|---|---|
| claude-code | Native | .claude/skills/<skill-name>/SKILL.md |
| codex | Native | .agents/skills/<skill-name>/SKILL.md |
| windsurf | Native | .windsurf/skills/<skill-name>/SKILL.md |
| gemini | Native | .gemini/skills/<skill-name>/SKILL.md or .agents/skills/<skill-name>/SKILL.md |
| cursor | Adapter | .cursor/rules/<skill-name>.mdc |
| cli | Manual | AGENTS.md or tool-specific context file |
export interface Env {
AI: any;
}
export default {
async fetch(request: Request, env: Env): Promise<Response> {
if (request.method !== 'POST') {
return new Response('Method not allowed', { status: 405 });
}
const { messages } = await request.json<{ messages: any[] }>();
const response = await env.AI.run('@cf/meta/llama-2-7b-chat-int8', {
messages: [
{ role: 'system', content: 'You are a helpful assistant.' },
...messages,
],
stream: true,
});
return new Response(response, {
headers: {
'content-type': 'text/event-stream',
'cache-control': 'no-cache',
},
});
},
};Run AI inference and serverless functions on Cloudflare Workers AI. Call hosted open-source models such as Llama, Whisper, and Stable Diffusion through the Workers AI binding, with pay-per-use Neuron pricing (including a free daily allocation), integrated D1/R2/KV storage, and deployment to Cloudflare's global edge network.
Claude can build and deploy AI-powered serverless functions on Cloudflare's global edge network. Workers run on V8 isolates (no per-request cold start), and the Workers AI binding (env.AI.run) gives functions direct access to Cloudflare's catalog of hosted models, bringing inference close to users worldwide.
SKILL.md.SKILL.md content as reusable workflow instructions..gemini/skills/<skill-name>/SKILL.md or .agents/skills/<skill-name>/SKILL.md where supported..cursor/rules/*.mdc adapter for project rules.Required:
npm install -g wrangler)What Claude handles automatically:
Prompt: "Create a Cloudflare Worker that responds to HTTP requests with JSON data and deploys to the edge."
Claude will:
fetch event handlerwrangler.toml configurationwrangler publishPrompt: "Build a Cloudflare Worker that uses Llama-2 to generate chat responses. Accept POST requests with user messages and stream the AI responses back."
Claude will:
Prompt: "Create an edge function that generates images using Stable Diffusion XL. Accept a text prompt via API and return the generated image URL stored in R2."
Claude will:
Prompt: "Build a translation API using Cloudflare Workers AI that detects the source language and translates to the target language. Support 50+ languages with edge caching."
Claude will:
Workers AI is one of several ways to run model inference without managing GPUs:
| Platform | Model hosting | Runs at the edge | Notable for |
|---|---|---|---|
| Cloudflare Workers AI | Built-in model catalog on Cloudflare's network | Yes | Run inference inside Workers, close to users |
| Vercel AI SDK | Bring-your-own provider via a unified SDK | Partial (serverless functions) | One API across many model providers |
| Replicate | Hosted API for a large open-model catalog | No | Run almost any open model via API |
Choose Workers AI for low-latency inference co-located with your edge app; the Vercel AI SDK for provider-agnostic app code, or Replicate for breadth of open models behind an API.
Leverage V8 Isolates: Workers use V8 isolates that start in <5ms and use 1/10th the memory of Node.js. Design stateless functions that take advantage of this architecture.
Use Durable Objects for State: For stateful operations (WebSockets, real-time collaboration), request Durable Objects implementation instead of external databases.
Model Selection: Choose appropriate AI models based on latency requirements. Smaller models like Llama-2-7B offer faster inference than larger variants.
Edge Caching: Implement Cache API or KV storage for frequently accessed data to reduce AI inference costs.
Cost Optimization: Workers AI charges per request. Use caching, rate limiting, and request batching to optimize costs.
Geographic Routing: Workers automatically route to the nearest data center. For AI models, consider pinning specific regions for data residency compliance.
"Create a complete AI-powered application on Cloudflare:
1. Workers AI for text generation (Llama-2)
2. D1 database for storing conversations
3. R2 for file uploads and generated content
4. KV for session management and caching
5. Pages for frontend deployment
6. Queue for background job processing
Include TypeScript types and deployment scripts."
"Build an edge API that:
1. Accepts text content via POST request
2. Uses Workers AI to detect harmful content
3. Classifies content as safe/unsafe with confidence scores
4. Logs results to D1 database
5. Returns moderation decision in <100ms
6. Handles 10,000 requests per minute"
"Create a Cloudflare Worker that:
1. Intercepts image requests
2. Analyzes image with Workers AI (OCR, object detection)
3. Automatically optimizes images for device/bandwidth
4. Stores optimized versions in R2
5. Serves from edge cache on subsequent requests
6. Includes usage analytics and cost tracking"
"Build a WebSocket-based sentiment analysis service:
1. Accept streaming text via WebSocket
2. Process chunks with Workers AI sentiment model
3. Return real-time sentiment scores
4. Store aggregate results in D1
5. Support 1000 concurrent connections
6. Deploy across all Cloudflare edge locations"
Issue: Worker exceeds CPU time limits Solution: Workers have a 50ms CPU time limit on free tier (30s on paid). Optimize by using streaming responses, reducing synchronous processing, or upgrading to Unbound workers for longer execution.
Issue: AI model inference too slow Solution: Use smaller model variants (e.g., Llama-2-7B instead of 13B), implement request queuing with Workers Queue, or cache common responses in KV storage.
Issue: CORS errors when calling from frontend Solution: Add proper CORS headers in Worker response. Ask Claude to include OPTIONS method handler and appropriate Access-Control-* headers.
Issue: Workers AI billing concerns Solution: Implement rate limiting with Durable Objects or KV, cache responses aggressively, use smaller models for simpler tasks, and set up billing alerts in Cloudflare dashboard.
Issue: Cannot access environment variables
Solution: Ensure secrets are set with wrangler secret put and bindings are properly configured in wrangler.toml. Access via env.SECRET_NAME in Worker code.
Issue: Cold start latency for complex Workers Solution: Minimize dependencies (Workers bundle size should be <1MB), use dynamic imports for optional features, and consider splitting into multiple Workers for different routes.
Show that Cloudflare Workers AI Edge Functions Skill is listed on HeyClaude. Paste this Markdown into your README — it renders the badge and links back to this page.
[](https://heyclau.de/entry/skills/cloudflare-workers-ai-edge)Cloudflare Workers AI Edge Functions Skill side by side with 2 alternatives on trust, install, platform support, and disclosed safety notes — all from reviewed registry metadata.
2 trust signals differ across this comparison (Package trust, Source provenance).
| Field | Run AI inference and serverless functions on Cloudflare Workers AI: call hosted models like Llama, Whisper, and Stable Diffusion through the Workers AI binding, deploy with wrangler, and use D1/R2/KV storage plus the free daily Neuron allocation. Open dossier | Expert Cloudflare capability skill for designing workers that combine D1, KV, and R2 with clear consistency, caching, and security boundaries. Open dossier | Expert OpenNext + Cloudflare capability skill for Next.js on Workers, runtime constraints, cache strategy, and production-safe deploy architecture. Open dossier |
|---|---|---|---|
| Next steps | |||
| Trust | |||
| Review status | ReviewedMaintainer reviewed | ReviewedMaintainer reviewed | ReviewedMaintainer reviewed |
| Package trustDiffers | Package verified2025-10-16 | Package verified2026-04-10 | Package verified2026-04-10 |
| Source provenanceDiffers | Source-backed | No submission link | No submission link |
| Submitter | — | — | — |
| Install risk | Review first | Low risk | Low risk |
| Notes | Safety ✓ Privacy ✓ | Safety ✓ Privacy ✓ | Safety ✓ Privacy ✓ |
| Brand | |||
| Category | skills | skills | skills |
| Source | first-party | first-party | first-party |
| Author | JSONbored | JSONbored | JSONbored |
| Added | 2025-10-16 | 2026-04-10 | 2026-04-10 |
| Platforms | Claude CodeCodexWindsurfGeminiCursorCLI | Claude CodeCodexWindsurfGeminiCursorCLI | Claude CodeCodexWindsurfGeminiCursorCLI |
| Source repo | — | — | — |
| Safety notes | ✓Deploying with wrangler writes Workers and bindings to your Cloudflare account; review what you deploy, since it serves live traffic. Running Workers AI models consumes paid Neurons beyond the free daily allocation; set usage expectations before deploying inference at scale. | ✓May produce commands or configuration for live infrastructure, CI, releases, or indexing; test changes in staging or dry-run mode first. Use least-privilege API tokens and review workflow, deploy, DNS, cache, and release changes before applying them to production. | ✓May produce commands or configuration for live infrastructure, CI, releases, or indexing; test changes in staging or dry-run mode first. Use least-privilege API tokens and review workflow, deploy, DNS, cache, and release changes before applying them to production. |
| Privacy notes | ✓Requests sent to Workers AI models are processed on Cloudflare's network; review what data your function forwards to the model. Keep Cloudflare API tokens in wrangler's secret store or environment variables, never hard-coded or committed. | ✓Inputs can include repository metadata, workflow logs, deployment settings, domain names, analytics exports, and service configuration. Redact tokens, account IDs, private URLs, customer data, and proprietary deployment details before sharing generated reports or prompts. | ✓Inputs can include repository metadata, workflow logs, deployment settings, domain names, analytics exports, and service configuration. Redact tokens, account IDs, private URLs, customer data, and proprietary deployment details before sharing generated reports or prompts. |
| Prerequisites |
|
|
|
| Install | | | |
| Config | — | — | — |
| Citations | |||
| Claim | Unclaimed | Unclaimed | Unclaimed |
Loading live community signals…
A short, calm digest of reviewed Claude resources. Unsubscribe any time.