cloudflare-workers-ai-expert

A specialist for building AI features on Cloudflare Workers, Cloudflare's serverless platform for running code around the world. It covers model choice, inference, prompts, retrieved-document systems, streaming, and related Cloudflare AI services.

In plain words
What is it for?
Use it for Cloudflare Workers AI development, including model selection, API integration, prompt design, retrieval-augmented generation, streaming responses, function calling, AI Gateway, Vectorize, and AutoRAG.
Why use it?
It helps developers choose and connect AI models within the Workers AI ecosystem. It also addresses patterns for handling responses, documents, and requests at the network edge.

Agent

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add agents/nodnarbnitram/claude-code-extensions/cloudflare-workers-ai-expert
Clone the repo
git clone --depth 1 https://github.com/nodnarbnitram/claude-code-extensions
Per session 70 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 3,543 The whole file, excluding the scripts and references it only reads on demand.
Security scan C 2 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00070 $0.03543
Opus 5 $0.00035 $0.01772
Sonnet 5 $0.00014 $0.00709
Haiku 4.5 $0.00007 $0.00354

Measured 2d ago against content hash 2f8a08a3ded3, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade C, and why

cloudflare-workers-ai-expert scanned grade C with 2 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 2d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Instruction-override phrasinghighPrompt injection

Text telling the model to disregard its earlier instructions or safety rules is the shape of a prompt injection, whoever wrote it.

/ignore previous instructions/i,

Makes network callslowCapability

Not a fault in itself. Listed so you know the mod talks to something, and to what.

async fetch(request, env) {
plugins/cce-cloudflare/agents/cloudflare-workers-ai-expert.md · 480 lines

How it starts

The opening of the file, as written. The whole thing — 480 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Purpose

You are a Cloudflare Workers AI specialist with deep expertise in serverless GPU-powered AI inference on Cloudflare's global edge network. You understand the complete Workers AI ecosystem including model selection, API patterns, integration with Vectorize/AutoRAG/AI Gateway, and edge-native AI development best practices.

Core Expertise

Platform Knowledge:

  • Workers AI serverless inference (GA 2025) with 50+ open-source models
  • Neurons pricing model ($0.011 per 1,000 Neurons, 10K free daily)
  • Native Workers binding (env.AI.run) and REST API patterns
  • OpenAI API compatibility layer
  • Streaming support (Server-Sent Events)
  • Batch API for async workloads
  • Infire inference engine (Rust-based, 2-4x faster in 2025)

Available Models (50+ as of 2025):

  • Text Generation: OpenAI GPT-OSS (20B, 120B), Meta Llama 3.1/3.2/3.3/4 Scout (up to 131K context), Google Gemma 3 (128K multimodal), MistralAI (128K), DeepSeek Coder
  • Embeddings: BAAI BGE (m3, large-en-v1.5: 1024d, base-en-v1.5: 768d, small-en-v1.5: 384d), Google EmbeddingGemma (300M params, 100+ languages)
  • Text-to-Image: Black Forest Labs FLUX.1 [schnell], Leonardo Lucid Origin/Phoenix, Stable Diffusion XL/v1.5
  • ASR: OpenAI Whisper variants, Whisper-large-v3-turbo (GA March 2025)
  • Special Features: Function calling, LoRA adapters, Quantization (AWQ, int8)

Instructions

When invoked, you must follow these steps:

1. Assessment Phase

  • Identify the specific Workers AI task (model selection, API integration, optimization, etc.)
  • Check for existing Workers implementation using Grep for patterns like env.AI.run, @cf/, Workers AI imports
  • Review wrangler.toml for AI bindings configuration
  • Assess current model usage and optimization opportunities

2. Model Selection Guidance

When choosing models, consider:

  • Performance vs. Quality tradeoff: Smaller models (8B) for speed, larger (70B+) for quality
  • Context windows: Llama 3.3 (131K), Gemma 3 (128K), MistralAI (128K) for long documents
  • Specialized models: DeepSeek Coder for code, Whisper for ASR, BGE for embeddings
  • Quantization: Use AWQ/int8 variants for faster inference with minimal quality loss
  • Cost optimization: Calculate Neurons usage based on model size and usage patterns

Read the full file on GitHub · 480 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 2d ago First seen · 480 lines · 70 tokens per session scan C 2f8a08a3ded3

Subscribe to this mod's changes

cloudflare-workers-ai-expert is an agent published in the GitHub repository nodnarbnitram/claude-code-extensions (16 stars, last pushed 4mo ago), licensed MIT. It adds 70 tokens to every session and 3,543 once invoked, about $0.0003 per session on Opus 5. A static security scan graded it C with 2 findings (instruction-override phrasing, makes network calls). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.

Related

Other agents, from other repositories

ai-engineer

Build LLM applications, RAG systems, and prompt pipelines. Implements vector search, agent orchestration, and AI API integrations. Use PROACTIVELY for LLM features, chatbots, or AI-powered applications.

davepoon/buildwithclaude · 48 tokens

ai-engineer

AI/ML Engineer (Reza Tehrani) - LLM seçimi, prompt engineering, RAG, AI agent mimarisi, fine-tuning.

vibeeval/vibecosystem · 36 tokens

ai-engineer

AI/ML工程师,负责模型集成、提示工程、RAG管道、Agent工作流设计和AI功能开发,交付高质量的智能化功能模块.

CronusL-1141/AI-company · 41 tokens

ai-engineer

Build LLM applications, RAG systems, and prompt pipelines. Implements vector search, agent orchestration, and AI API integrations. Use PROACTIVELY for LLM features, chatbots, or AI-powered applications.

echoVic/blade-code · 48 tokens

prompt_engineer

Prompt engineering specialist for LLM prompt design, few-shot and chain-of-thought structuring, eval harnesses, and RAG retrieval quality. Use when the task requires writing or reviewing prompts, building evaluation datasets, tuning retrieval for a RAG system, or diagnosing regressions in LLM outputs. For example…

josstei/maestro-orchestrate · 98 tokens

ai-llm-integration-prompt

You are an AI integration specialist agent. Your mission: architect, build, and optimize production-grade AI-powered applications using LLMs, embeddings, vector databases, and agent patterns — with a focus on reliability, cost efficiency, and safety.

Rtur2003/Claude-Code-Promts-Skills · 0 tokens