Complete knowledge domain for Cloudflare Workers AI - Run AI models on serverless GPUs across Cloudflare's global network. Use when: implementing AI inference on Workers, running LLM models, generating text/images with AI, configuring Workers AI bindings, implementing AI streaming, using AI Gateway, integrating with embeddings/RAG systems, or encountering "AI_ERROR", rate limit errors, model not found, token limit exceeded, or neurons exceeded errors. Keywords: workers ai, cloudflare ai, ai bindings, llm workers, @cf/meta/llama, workers ai models, ai inference, cloudflare llm, ai streaming, text generation ai, ai embeddings, image generation ai, workers ai rag, ai gateway, llama workers, flux image generation, stable diffusion workers, vision models ai, ai chat completion, AI_ERROR, rate limit ai, model not found, token limit exceeded, neurons exceeded, ai quota exceeded, streaming failed, model unavailable, workers ai hono, ai gateway workers, vercel ai sdk workers, openai compatible workers, workers ai vectorize
Complete knowledge domain for Cloudflare Workers AI - Run AI models on serverless GPUs across Cloudflare's global network.
This skill provides complete Workers AI knowledge including:
| Issue | Description | Prevention |
|-------|-------------|------------|
| Rate limit errors (429) | Text generation exceeds 300 req/min | Implement exponential backoff retry |
| Response buffering | Large responses timeout without streaming | Always use stream: true for text generation |
| Token limit exceeded | Input exceeds model context window | Validate prompt length before inference |
| Model not found | Invalid model ID | Use correct @cf/ or @hf/ prefixes from catalog |
| Missing cost tracking | Production costs unmonitored | Always use AI Gateway for logging |
| Free tier exhaustion | Exceeds 10,000 neurons/day | Plan for Workers Paid ($0.011/1000 neurons) |
import { Hono } from 'hono';
type Bindings = {
AI: Ai;
};
const app = new Hono<{ Bindings: Bindings }>();
// Text generation with streaming
app.post('/chat', async (c) => {
const { prompt } = await c.req.json<{ prompt: string }>();
const stream = await c.env.AI.run(
'@cf/meta/llama-3.1-8b-instruct',
{
messages: [{ role: 'user', content: prompt }],
stream: true,
}
);
return new Response(stream, {
headers: { 'content-type': 'text/event-stream' },
});
});
export default app;
wrangler.jsonc:
{
"ai": {
"binding": "AI"
}
}
Without this skill:
With this skill:
Use this skill when you see keywords like:
npx skills add jackspace/cloudflare-workers-ai下载完整 Skill 目录,包含 SKILL.md 及所有相关文件
Search for places (restaurants, cafes, etc.) via Google Places API proxy on localhost.
Interact with GitHub using the `gh` CLI. Use `gh issue`, `gh pr`, `gh run`, and `gh api` for issues, PRs, CI runs, and advanced queries.
Create or update AgentSkills. Use when designing, structuring, or packaging skills with scripts, references, and assets.
Start voice calls via the OpenClaw voice-call plugin.
Notion API for creating and managing pages, databases, and blocks.
Gemini CLI for one-shot Q&A, summaries, and generation.
Category:developer