Drupal is a registered trademark of Dries Buytaert
drupal 11.4.1 Update released for Drupal core (11.4.1)! drupal 11.4.0 Update released for Drupal core (11.4.0)! drupal 10.6.12 Update released for Drupal core (10.6.12)! drupal 11.3.13 Update released for Drupal core (11.3.13)! drupal 10.6.11 Update released for Drupal core (10.6.11)! drupal 11.3.12 Update released for Drupal core (11.3.12)! drupal 11.2.14 Update released for Drupal core (11.2.14)! drupal 10.5.12 Update released for Drupal core (10.5.12)! cms 2.1.3 Update released for Drupal core (2.1.3)! drupal 10.5.11 Update released for Drupal core (10.5.11)! drupal 11.3.11 Update released for Drupal core (11.3.11)! drupal 11.2.13 Update released for Drupal core (11.2.13)! drupal 10.6.10 Update released for Drupal core (10.6.10)! cms 2.1.2 Update released for Drupal core (2.1.2)! drupal 11.1.10 Update released for Drupal core (11.1.10)! drupal 10.5.10 Update released for Drupal core (10.5.10)! drupal 10.4.10 Update released for Drupal core (10.4.10)! drupal 11.2.12 Update released for Drupal core (11.2.12)! drupal 11.3.10 Update released for Drupal core (11.3.10)! drupal 10.6.9 Update released for Drupal core (10.6.9)!

cloudflare_ai

No security coverage
View on drupal.org

A Drupal integration for Cloudflare's AI-group resources: it makes the AI Gateway, Vectorize and AI Search first-class configuration entities and provides the clients to use them.

Cloudflare's AI group is a set of hosted building blocks for AI applications: an AI Gateway that sits in front of AI providers and adds caching, logging, cost analytics and fallbacks; Vectorize, a vector database for semantic search; and AI Search (formerly AutoRAG), a managed pipeline that indexes a data source and answers questions over it. This module is the layer that lets Drupal provision and talk to them. It underpins the Cloudflare AI Gateway Provider, which connects the gateway to the Drupal AI module; its Vectorize and AI Search clients can also be used directly from your own code.

Features

  • AI Gateway: a gateway configuration entity (host, slug, default provider, and the credential set that authorizes it); URL building for the gateway's endpoint styles (the OpenAI-compatible endpoint, the universal endpoint, and per-provider passthrough); the cf-aig-* request headers for cache TTL, metadata and fallbacks; and access to the gateway's live model catalogue, cached per gateway. Each gateway has a detail page showing its request volume and cache hit-rate for the last 24 hours.
  • Vectorize: a Vectorize index configuration entity (name, vector dimensions, distance metric, and credential set), and a data-plane client that creates, describes and deletes indexes and upserts, queries, fetches and deletes vectors over the Vectorize v2 REST API.
  • AI Search: an AI Search instance configuration entity (data source, embedding and generation models, chunking, and sync interval), and a client that runs retrieval and OpenAI-compatible generation, triggers a re-sync, and reads index stats.
  • Each resource is a first-class asset that other modules reference, and credentials (account ID and token) are resolved from settings.php through the Cloudflare SDK, never stored in configuration.

Workers AI needs no configuration here: it is stateless inference reached through the AI Gateway, not a resource you provision.

Post-Installation

This module has no user-facing AI features on its own. It provides the clients and configuration that other modules (or your own code) build on. After enabling it:

  1. Add a credential set in the Cloudflare SDK module, and put its account ID and token in settings.php. Give the token the permissions for the resources you use (AI Gateway, Vectorize, and AI Search).
  2. Add resources under Configuration > Web services: Cloudflare AI Gateways, Cloudflare Vectorize, or Cloudflare AI Search. Each references the credential set that supplies its authorization token; the account is resolved from the credential set.

To route the Drupal AI module through a gateway, also install the Cloudflare AI Gateway Provider.

Additional Requirements

This module requires the Cloudflare SDK and Cloudflare API modules. The SDK provides the credential framework and shared HTTP client; the API module is the standalone Cloudflare v4 client this module calls. Installing with Composer pulls them in:

composer require drupal/cloudflare_ai

While the suite is in alpha, require it as drupal/cloudflare_ai:^1.0@alpha (or set your project's minimum-stability to alpha) so the pre-stable releases resolve. You also need a Cloudflare account.

Install the Cloudflare AI Gateway Provider to use a configured gateway with the AI module, so every AI feature in your site routes through it. It also provides the embeddings that a Vectorize-backed semantic search can consume.

Similar projects

The existing Cloudflare module focuses on CDN and cache management and does not cover the AI group. This module is part of a small Cloudflare suite built on the Cloudflare API and Cloudflare SDK, alongside the AI Gateway Provider.

Supporting this Module

Issue reports, patches and feedback are welcome in the project's issue queue.

Community Documentation

Cloudflare's documentation is at developers.cloudflare.com/ai-gateway, developers.cloudflare.com/vectorize, and developers.cloudflare.com/ai-search.

Activity

Total releases
1
First release
Jul 2026
Latest release
4 hours ago
Release cadence
Stability
0% stable

Releases

Version Type Release date
1.0.0-alpha1 Pre-release Jul 8, 2026