cloudflare-workers-ai
Cloudflare Workers AI enables serverless GPU inference directly within Workers, supporting LLMs, embeddings, image generation, and vision models. Stream responses to avoid timeouts and buffer issues, integrate with AI Gateway for caching and cost tracking, and choose from optimized models like Llama, Qwen, and Flux.
Cloudflare Workers AI lets you run LLM inference with streaming on serverless GPU compute.
AI-generated summary based on this skill's SKILL.md
Decision gist · record as of 2026-07-25
Cloudflare Workers AI lets you run LLM inference with streaming on serverless GPU compute. Cloudflare Workers AI enables serverless GPU inference directly within Workers, supporting LLMs, embeddings, image generation, and vision models. Stream responses to avoid timeouts and buffer issues, integrate with AI Gateway for caching and cost tracking, and choose from optimized models like Llama, Qwen, and Flux.
Use it when
- Cloudflare Workers AI setup begins by adding an AI binding to your `wrangler.toml` file.
- Cloudflare Workers AI supports embeddings and vector search for RAG applications.
Verify before relying
Read SKILL.md below before installing (10 files). Open directory: indexed for reading, not audited.
Install
secondsky/claude-skills/cloudflare-workers-ai · repository language: TypeScript
Open directory. Skills are indexed for reading, not audited. Review a skill's body before installing it.
Frequently asked questions
AI-generated answers based on this skill's SKILL.md and metadata
How do I use Workers AI for LLM inference on Cloudflare?
Cloudflare Workers AI enables serverless GPU inference directly within Workers. Bind the AI service to your Worker, then call models like Llama or Qwen using the `ai.run()` method. Stream responses using the `stream` option to avoid timeouts and buffer issues. Integrate with AI Gateway for caching, cost tracking, and rate-limit management across your deployments.
What is cloudflare workers ai setup and how do I start?
Cloudflare Workers AI setup begins by adding an AI binding to your `wrangler.toml` file, then importing and calling the AI service in your Worker code. The service supports LLMs, embeddings, image generation, and vision models. Choose optimized models like Llama, Qwen, or Flux based on your task, and enable streaming for text generation to handle large responses efficiently.
How can I build RAG applications using Workers AI embeddings?
Cloudflare Workers AI supports embeddings and vector search for RAG applications. Use the embeddings model to vectorize your documents, store vectors in Vectorize, then retrieve relevant context during inference. Combine this with LLM calls in your Worker to generate responses grounded in your data. Stream the final output to avoid token-exceeded errors in production.
How do I troubleshoot workers ai rate limit and token exceeded errors?
Workers AI rate-limit and token-exceeded errors occur when requests exceed model capacity or response length. Enable streaming to process tokens incrementally and avoid buffer overflow. Use AI Gateway to monitor usage and implement backoff strategies. Check your model's token limits and consider splitting large requests or using smaller models for high-volume workloads.
Can I integrate OpenAI SDK with Cloudflare Workers AI?
Yes, Cloudflare Workers AI integrates with the OpenAI SDK and Vercel AI on Workers. Use compatible models and configure the SDK to point to your Workers AI binding. This allows you to leverage familiar APIs while running inference serverlessly on Cloudflare's GPU infrastructure, reducing latency and cost compared to external API calls.
What image generation and vision models does Workers AI support?
Cloudflare Workers AI supports Flux for image generation and multiple vision models for processing images serverlessly. Use these models to generate images or analyze visual content directly within Workers without external dependencies. Stream responses and monitor token usage to stay within rate limits and avoid model-not-found errors in production deployments.
SKILL.md
Rendered from the published skill. Quoted content, verbatim.
Cloudflare Workers AI - Complete Reference
Production-ready knowledge domain for building AI-powered applications with Cloudflare Workers AI.
Status: Production Ready ✅ Last Updated:
(truncated - see the full file via the links below)
File tree — 10 files
plugins/cloudflare-workers-ai/skills/cloudflare-workers-ai/SKILL.md
plugins/cloudflare-workers-ai/skills/cloudflare-workers-ai/references/best-practices.md
plugins/cloudflare-workers-ai/skills/cloudflare-workers-ai/references/integrations.md
plugins/cloudflare-workers-ai/skills/cloudflare-workers-ai/references/models-catalog.md
plugins/cloudflare-workers-ai/skills/cloudflare-workers-ai/templates/ai-embeddings-rag.ts
plugins/cloudflare-workers-ai/skills/cloudflare-workers-ai/templates/ai-gateway-integration.ts
plugins/cloudflare-workers-ai/skills/cloudflare-workers-ai/templates/ai-image-generation.ts
plugins/cloudflare-workers-ai/skills/cloudflare-workers-ai/templates/ai-text-generation.ts
plugins/cloudflare-workers-ai/skills/cloudflare-workers-ai/templates/ai-vision-models.ts
plugins/cloudflare-workers-ai/skills/cloudflare-workers-ai/templates/wrangler-ai-config.jsonc
Let your AI agent find skills like this
Example. Real query, live index.
You found this page by searching. An agent finds it by wishing: SkillFed indexes 56,283 agent skills by what they can do, searchable in plain language.
wish › “Run LLM inference on Cloudflare Workers with streaming”
Give your agent the search over MCP, or paste the wish link into any chat. No install? Search from any chat →
Related skills
Connect to Cloudflare's edge infrastructure to build and deploy serverless applications using Workers, managed databases, object storage, and AI services. Configure KV namespaces, D1 SQLite databases, R2 buckets, and Durable Objects through a unified platform.
Vectorize is a vector database that runs at the edge, letting you store high-dimensional embeddings and perform similarity queries for RAG pipelines, semantic search, and recommendation systems. Create indexes with preset dimensions or custom configurations, then insert, upsert, query, and delete vectors through a simple API. Integrates seamlessly with Workers AI for generating embeddings.
Master performance tuning for Cloudflare Workers through CPU optimization, memory management, and strategic caching. Learn to profile hot paths, stream large payloads, batch operations, and minimize cold starts while staying within platform limits.
Navigate Cloudflare's full platform—from serverless compute and data storage to AI inference and edge security. This skill maps your use case to the right product via decision trees, then points you to authoritative references for APIs, limits, and configuration. Always retrieves current docs over cached knowledge.
This skill provides structured guidance for building across Cloudflare's full platform—from edge compute with Workers and Pages to data storage, AI inference, and security. Decision trees route you to the right product for your use case, while retrieval-first design ensures you get current API details, limits, and pricing from official docs rather than stale knowledge.
cloudflare-deploy is a comprehensive guide to building on Cloudflare's platform, covering compute (Workers, Pages, Durable Objects), storage (KV, D1, R2), AI services (Workers AI, Vectorize), and infrastructure-as-code tools. Decision trees help you find the right product for your use case, while retrieval-first guidance ensures you access current API docs, limits, and configuration options rather than relying on outdated knowledge.
More skills cloudflare-agents (MIT) · cloudflare (MIT) · agents-sdk (Apache-2.0)