Cloudflare builds the adapter layer between your AI SDK and its edge
This monorepo provides official adapters that wire the Vercel AI SDK and TanStack AI directly into Cloudflare Workers AI and AI Gateway.

What it does
Cloudflare’s official collection of provider packages and example applications for running AI workloads on its edge platform. The three published packages bridge popular frontend AI frameworks—specifically the Vercel AI SDK and TanStack AI—to Cloudflare’s Workers AI inference and AI Gateway routing layers. It also includes a playground demo and focused examples for patterns like tool calling, structured output, and MCP servers.
The interesting bit
Rather than forcing a choice between Cloudflare’s infrastructure and familiar AI SDK ergonomics, it acts as a translation layer. The ai-gateway-provider is particularly notable: it intercepts Vercel AI SDK requests to add Cloudflare-native caching, rate limiting, and observability without requiring application rewrites.
Key highlights
workers-ai-providerexposes chat, image generation, embeddings, transcription, text-to-speech, and reranking through the Vercel AI SDK.@cloudflare/tanstack-aiadds Workers AI and AI Gateway support to TanStack AI, with gateway routing for OpenAI, Anthropic, Gemini, Grok, and OpenRouter.ai-gateway-providertransparently routes Vercel AI SDK traffic through Cloudflare AI Gateway for caching, rate limiting, and observability.- Examples and demos cover both Workers binding and REST API modes, plus patterns like agents, tool calling, structured output, and MCP server integration.
Caveats
- End-to-end tests require live Cloudflare credentials, so fully validating the stack locally is gated.
Verdict
Worth a look if you are already using Vercel AI SDK or TanStack AI and want to migrate inference or routing to Cloudflare’s edge without rewriting your application layer. Less compelling if you are not targeting Workers or AI Gateway.
Frequently asked
- What is cloudflare/ai?
- This monorepo provides official adapters that wire the Vercel AI SDK and TanStack AI directly into Cloudflare Workers AI and AI Gateway.
- Is ai open source?
- Yes — cloudflare/ai is open source, released under the MIT license.
- What language is ai written in?
- cloudflare/ai is primarily written in TypeScript.
- How popular is ai?
- cloudflare/ai has 1.1k stars on GitHub.
- Where can I find ai?
- cloudflare/ai is on GitHub at https://github.com/cloudflare/ai.