All skills
openai avatar

/cloudflare-deploy

@bf9e226 official
by openaiopenai/skills28k stars
1,891

Deploy applications and infrastructure to Cloudflare using Workers, Pages, and related platform services. Use when the user asks to deploy, host, publish, or set up a project on Cloudflare.

Use this Skill: https://skilld.dev/gh/openai/skills/cloudflare-deploy

This session only. Nothing lands on disk.

referencesvectorizeREADME.md

Cloudflare Vectorize

Globally distributed vector database for AI applications. Store and query vector embeddings for semantic search, recommendations, RAG, and classification.

Status: Generally Available (GA) | Last Updated: 2026-01-27

Quick Start

// 1. Create index
// npx wrangler vectorize create my-index --dimensions=768 --metric=cosine

// 2. Configure binding (wrangler.jsonc)
// { "vectorize": [{ "binding": "VECTORIZE", "index_name": "my-index" }] }

// 3. Query vectors
const matches = await env.VECTORIZE.query(queryVector, { topK: 5 });

Key Features

  • 10M vectors per index (V2)
  • Dimensions up to 1536 (32-bit float)
  • Three distance metrics: cosine, euclidean, dot-product
  • Metadata filtering (up to 10 indexes)
  • Namespace support (50K namespaces paid, 1K free)
  • Seamless Workers AI integration
  • Global distribution

Reading Order

Task Files to Read
New to Vectorize README only
Implement feature README + api + patterns
Setup/configure README + configuration
Debug issues gotchas
Integrate with AI README + patterns
RAG implementation README + patterns

File Guide

  • README.md (this file): Overview, quick decisions
  • api.md: Runtime API, types, operations (query/insert/upsert)
  • configuration.md: Setup, CLI, metadata indexes
  • patterns.md: RAG, Workers AI, OpenAI, LangChain, multi-tenant
  • gotchas.md: Limits, pitfalls, troubleshooting

Distance Metric Selection

Choose based on your use case:

What are you building?
├─ Text/semantic search → cosine (most common)
├─ Image similarity → euclidean
├─ Recommendation system → dot-product
└─ Pre-normalized vectors → dot-product
Metric Best For Score Interpretation
cosine Text embeddings, semantic similarity Higher = closer (1.0 = identical)
euclidean Absolute distance, spatial data Lower = closer (0.0 = identical)
dot-product Recommendations, normalized vectors Higher = closer

Note: Index configuration is immutable. Cannot change dimensions or metric after creation.

Multi-Tenancy Strategy

How many tenants?
├─ < 50K tenants → Use namespaces (recommended)
│   ├─ Fastest (filter before vector search)
│   └─ Strict isolation
├─ > 50K tenants → Use metadata filtering
│   ├─ Slower (post-filter after vector search)
│   └─ Requires metadata index
└─ Per-tenant indexes → Only if compliance mandated
    └─ 50K index limit per account (paid plan)

Common Workflows

Semantic Search

// 1. Generate embedding
const result = await env.AI.run("@cf/baai/bge-base-en-v1.5", { text: [query] });

// 2. Query Vectorize
const matches = await env.VECTORIZE.query(result.data[0], {
  topK: 5,
  returnMetadata: "indexed"
});

RAG Pattern

// 1. Generate query embedding
const embedding = await env.AI.run("@cf/baai/bge-base-en-v1.5", { text: [query] });

// 2. Search Vectorize
const matches = await env.VECTORIZE.query(embedding.data[0], { topK: 5 });

// 3. Fetch full documents from R2/D1/KV
const docs = await Promise.all(matches.matches.map(m => 
  env.R2.get(m.metadata.key).then(obj => obj?.text())
));

// 4. Generate LLM response with context
const answer = await env.AI.run("@cf/meta/llama-3-8b-instruct", {
  prompt: `Context: ${docs.join("\n\n")}\n\nQuestion: ${query}\n\nAnswer:`
});

Critical Gotchas

See gotchas.md for details. Most important:

  1. Async mutations: Inserts take 5-10s to be queryable
  2. 500 batch limit: Workers API enforces 500 vectors per call (undocumented)
  3. Metadata truncation: "indexed" returns first 64 bytes only
  4. topK with metadata: Max 20 (not 100) when using returnValues or returnMetadata: "all"
  5. Metadata indexes first: Must create before inserting vectors

Resources

Source: SKILL.md on GitHub

2 warnings17d5 checks · Risk SAFE
  • Gen Agent Trust Hub17d

    This skill provides comprehensive guidance for deploying and managing infrastructure on the Cloudflare platform. It includes extensive educational material on secure development practices, such as preventing SQL injection and managing secrets effectively. No malicious patterns or security risks were identified.

  • Socket17d

    2 alerts: gptAnomaly

  • Snyk17d

    Risk: LOW · No issues

  • Runlayer7mo

    310/310 files flagged

  • ZeroLeaks5mo

    Score: 93/100 · 2 sections analyzed

Signed by skilld at bf9e226. This ties the file your Agent reads to that commit on GitHub. It does not review the instructions.

Last checked against GitHub 2 months ago.

Activeupdated 8 months ago

README badge

README badge for openai/skills/cloudflare-deploy

Deploys applications and infrastructure to Cloudflare's platform, including Workers, Pages, D1, R2, Durable Objects, KV, and other services. Use decision trees to route to the right Cloudflare product based on compute, storage, AI, networking, security, or media needs.

Generated from the current SKILL.md.

Does this skill cover all Cloudflare products?
The skill is a consolidated index covering compute, storage, AI, networking, security, media, and developer tools on Cloudflare. It uses decision trees to route you to the right product reference, then loads detailed guidance for that product.
What authentication is required before deploying?
Run `npx wrangler whoami` to check if authenticated. For local deployment, use `wrangler login` (one-time OAuth). For CI/CD, set the `CLOUDFLARE_API_TOKEN` environment variable.
What should I do if deployment fails due to network issues?
Rerun the deploy with `sandbox_permissions=require_escalated` to grant elevated network access, which is required for outbound requests to Cloudflare during deployment.
How long does a Cloudflare deployment typically take?
Deployments may take several minutes. Use appropriate timeout values in your configuration or CI/CD environment.

Generated from the current SKILL.md. These answers refresh after source changes.