Serverless AI inference
How to use
Cloudflare Workers AI.
Running open-source text, embedding, image, speech, and classification models in serverless Workers and combining them with AI Gateway and Vectorize.
Cloudflare Workers AI is a serverless GPU inference platform for running AI models on Cloudflare's global network. Running open-source text, embedding, image, speech, and classification models in serverless Workers and combining them with AI Gateway and Vectorize. This guide covers the whole path in one place: official access, a first session that produces something reviewable, the checks that make output trustworthy, and the permissions worth limiting before you connect real work.
AI should make the work easier to inspect. If the workflow removes the source, the owner, or the review step, redesign the workflow.
Access & setup
Find, install, and sign in to Cloudflare Workers AI
Get into the official Cloudflare Workers AI experience with the right account and a setup you understand.
- 01
Start at https://developers.cloudflare.com/workers-ai/ and confirm the domain before entering account or payment information.
- 02
Availability: Workers AI is available through Workers bindings, the Cloudflare REST API, dashboard, Wrangler development tooling, and integrations with AI Gateway and Vectorize.
- 03
A Cloudflare account, Worker or scoped API token and account ID, an approved catalog model, Wrangler for local development where used, and usage controls.
- 04
Sign in with the account you intend to keep using, then review plan, data, notification, and permission settings.
- 05
Run one low-risk test task before connecting sensitive files, repositories, or workspace data.
- Use official download pages.
- Review permissions during setup.
- Keep installers and applications updated.
First session
Your first useful Cloudflare Workers AI session
Learn the interaction loop using a small task with a clear outcome.
- 01
Create a development Worker and add a Workers AI binding without exposing account credentials to the client.
- 02
Choose a catalog model for one narrow task and record its ID, input schema, limits, pricing, and license information.
- 03
Implement a validated test endpoint with authentication, bounded inputs and outputs, timeouts, and structured errors.
- 04
Run quality, safety, latency, rate-limit, and cost fixtures before deploying the endpoint or retaining user data.
- State the outcome before the background.
- Provide the real source material.
- Review the result before expanding the task.
Quality control
Check the quality of Cloudflare Workers AI output
Establish that a change is safe to run in production and reversible if it is not.
- 01
Restate the intended end state and the blast radius before applying anything.
- 02
Review the generated configuration line by line against the provider's current documentation.
- 03
Apply to a non-production environment first and confirm the observed result matches the intended one.
- 04
Confirm the rollback path works by actually exercising it, not by assuming it exists.
- 05
Check cost, scaling limits, and network exposure before the change reaches production traffic.
- Test the rollback, do not assume it.
- Check what a configuration exposes to the public internet.
- Watch cost and rate limits as closely as correctness.
Privacy & permissions
Use Cloudflare Workers AI safely
Keep credentials, network exposure, and cost under deliberate control.
- 01
Use scoped, short-lived credentials, and never paste production secrets into a prompt or config file.
- 02
Confirm what each change exposes publicly before applying it, especially storage, databases, and admin endpoints.
- 03
Separate environments so a mistake in development cannot reach production data.
- 04
Set billing alerts and hard quotas before enabling autoscaling or usage-based services.
- 05
Review audit logs and revoke access for integrations that are no longer in use.
- Serverless inference can still expose sensitive inputs, unsafe outputs, public endpoints, logs, and unbounded cost. Protect bindings and tokens, authenticate and validate Workers, pin and benchmark model IDs, understand model licenses and limits, minimize logs and caching for sensitive data, set AI Gateway rate and spend controls, make retries safe, and preserve source identity and access rules in Vectorize.
- Follow your organisation's approved-use policy.
- Never treat fluent output as authorization to act.
Core workflows
Step-by-step ways to use Cloudflare Workers AI for the work it does best.
Each workflow is a separate guide with its own steps and review checkpoints.
Run a catalog model from a Cloudflare Worker with protected bindings, validation, Gateway controls, and production limits.
↗ 02 WorkflowBuild a source-aware RAG service with Workers AI and VectorizeCreate embeddings, index governed records in Vectorize, retrieve context, and generate answers with traceable evidence.
↗Official references
Check the current product documentation.
Features, plan limits, availability, and data controls change. These official pages are the starting points used for this guide.