ai  by cloudflare

Cloudflare AI SDKs for building multimodal applications

Created 11 months ago
918 stars

Top 39.5% on SourcePulse

GitHubView on GitHub
Project Summary

This repository provides packages and examples for integrating AI capabilities into applications hosted on Cloudflare. It targets developers seeking to leverage Cloudflare's infrastructure for AI workloads, offering pre-built providers for popular AI SDKs like Vercel AI SDK and TanStack AI, enabling features such as chat, image generation, embeddings, and more, with enhanced control via Cloudflare's AI Gateway.

How It Works

The project offers modular packages that act as adapters, bridging Cloudflare's Workers AI services and AI Gateway with frontend AI SDKs. workers-ai-provider integrates directly with the Vercel AI SDK for core AI tasks. @cloudflare/tanstack-ai extends TanStack AI with Workers AI and AI Gateway support, enabling routing to various third-party models (OpenAI, Anthropic, Gemini, Grok, OpenRouter) through the gateway for centralized management. The AI Gateway provider specifically adds caching, rate limiting, and observability to AI requests.

Quick Start & Requirements

  • Primary install/run command: Clone the repository, navigate to the root, and run pnpm install. To run an example, cd examples/workers-ai and execute pnpm dev.
  • Non-default prerequisites: Requires pnpm package manager. End-to-end tests necessitate Cloudflare credentials.
  • Links:
    • Examples: examples/workers-ai, examples/tanstack-ai
    • Package tests: packages/workers-ai-provider

Highlighted Details

  • Supports a comprehensive suite of AI capabilities: chat (with tool calling), image generation, embeddings, transcription, text-to-speech, and reranking.
  • TanStack AI adapters provide multi-provider support, routing requests through Cloudflare's AI Gateway for features like caching and rate limiting.
  • Examples demonstrate full-featured playgrounds and multi-provider setups, showcasing binding and REST API modes for Workers AI.

Maintenance & Community

The release process is managed via Changesets, automating version bumping and publishing to npm upon merging PRs to the main branch. No explicit community channels (like Discord or Slack) or roadmap links are provided in the README.

Licensing & Compatibility

The license is not explicitly stated in the provided README content. This omission requires further investigation for commercial use or integration into closed-source projects.

Limitations & Caveats

The project is tightly coupled with the Cloudflare ecosystem. Development and testing rely on the pnpm package manager, and running end-to-end tests requires valid Cloudflare credentials. The absence of a stated license is a significant caveat for adoption.

Health Check
Last Commit

2 days ago

Responsiveness

Inactive

Pull Requests (30d)
18
Issues (30d)
7
Star History
38 stars in the last 30 days

Explore Similar Projects

Starred by Eric Zhu Eric Zhu(Coauthor of AutoGen; Research Scientist at Microsoft Research), Elvis Saravia Elvis Saravia(Founder of DAIR.AI), and
15 more.

semantic-kernel by microsoft

0.2%
27k
SDK for building intelligent AI agents and multi-agent systems
Created 3 years ago
Updated 1 day ago
Feedback? Help us improve.