zudo-cloudflare-wisdom
GitHub repository

Type to search...

to open search from anywhere

AI

Product map for Cloudflare AI, retrieval, and supporting storage

Product Map

Cloudflare AI applications usually combine several products. Keep the model call, provider control plane, retrieval index, and app state as separate decisions.

ProductRoleUse it when
Workers AICloudflare-hosted model inference through Worker bindings.You need text generation, embeddings, classification, speech, image, or other model tasks close to your Worker code.
AI GatewayRouting, observability, and policy controls for model providers.You need provider access, analytics, logs, caching, retries, fallback, rate limiting, or spend controls across Workers AI and external providers.
VectorizeVector database for embeddings and similarity search.You need semantic search, recommendations, memory, or RAG retrieval over your own content.
D1 / R2 / KV / Durable ObjectsStorage and state companions, not model products.You need to persist documents, metadata, assets, sessions, cache entries, coordination state, or per-user/per-tenant data around an AI workflow.

How The Pieces Fit

Workers AI is the inference layer. In a Worker, call a model through a Workers AI binding when Cloudflare-hosted inference is the right fit and the application logic lives in Workers.

AI Gateway sits in front of model providers. Use it when the hard part is controlling requests: routing traffic, switching providers, observing usage, adding caching, retrying failed requests, or enforcing limits. It can cover Workers AI as well as external providers, so it is the control plane rather than the model runtime itself.

Vectorize is the retrieval layer. Store embeddings generated by Workers AI or another embedding provider, then query the index to find semantically related content. For RAG, Vectorize returns the relevant references; a model still generates the final response.

D1, R2, KV, and Durable Objects are the app data layer around the AI system:

  • Use D1 for relational metadata, user records, job rows, and audit trails.

  • Use R2 for source documents, images, exports, and other large artifacts.

  • Use KV for read-heavy configuration, prompt snippets, cache keys, and lightweight lookup data.

  • Use Durable Objects for strongly consistent coordination, WebSockets, shared room state, or per-conversation state that must not split across requests.

Common Architectures

GoalTypical shape
Simple model callWorker + Workers AI binding. Add AI Gateway when you need logs, caching, fallback, or provider controls.
Streaming chatWorker receives the request, calls Workers AI, and streams the result back to the client.
RAG answerWorker loads source content from storage, embeds or queries with Vectorize, then sends retrieved context to a model.
Webhook botWorker acknowledges the webhook quickly, does longer work with ctx.waitUntil(), stores state in D1/KV/Durable Objects, and calls AI only when the bot behavior needs it.

Guides

  • Workers AI Models and Pricing -- practical model categories, a curated text-generation table, and cost calculation notes.

  • Chat Memory and RAG -- a request-boundary and storage guide for chat history, prompt assembly, and retrieval.

  • Resilient AI Routes -- a same-shape fallback pattern for guarding AI calls against budget limits, timeouts, and bad output.

Recipes

Keep This Page Stable

Do not copy pricing tables or the full model catalog here. Treat this page as the durable product map, then check the official Cloudflare docs when choosing exact models, providers, limits, or pricing.

Revision History

CreatedUpdated