Skip to main content
Machine learning models run at the edge via Cloudflare Workers AI. Access them through Conductor’s think operation using the workers-ai provider.

Overview

Workers AI provides serverless GPU inference for ML models:
  • Free tier: 10,000 requests/day
  • Latency: Runs at edge, near your users
  • Provider: Use workers-ai in think operation
  • Binding: Requires [ai] binding in wrangler.toml
Model Categories:
  • Text Embeddings (7 models)
  • Image Classification (1 model)
  • Object Detection (1 model)
  • Image-to-Text (2 models)
  • Vision Models (2 multimodal LLMs)
  • Text Classification (2 models)

Configuration

wrangler.toml

Environment Variable

Set CONDUCTOR_AI_PROVIDER=workers-ai or configure per-agent.

Text Embeddings

Convert text into vector representations for semantic search, RAG, clustering, and similarity tasks.

Available Models

English Models (BGE):
  • @cf/baai/bge-small-en-v1.5 - 384 dimensions, fastest
  • @cf/baai/bge-base-en-v1.5 - 768 dimensions, balanced
  • @cf/baai/bge-large-en-v1.5 - 1024 dimensions, most accurate
Multilingual:
  • @cf/baai/bge-m3 - 1024 dims, 100+ languages, multi-vector retrieval
Specialized:
  • @cf/google/embeddinggemma-300m - From Gemma 3, 100+ languages
  • @cf/pfnet/plamo-embedding-1b - Japanese text
  • @cf/qwen/qwen3-embedding-0.6b - Chinese/multilingual

Generate Embeddings

Store in Vectorize

Choosing an Embedding Model

Use bge-small-en-v1.5 when:
  • Speed is critical
  • Low latency required
  • English-only content
  • Cost-sensitive (fewer dimensions = cheaper storage)
Use bge-base-en-v1.5 when:
  • Balanced performance needed
  • General-purpose embeddings
  • English content with some multilingual
Use bge-large-en-v1.5 when:
  • Maximum accuracy required
  • Complex semantic understanding
  • Willing to trade speed for quality
Use bge-m3 when:
  • Multilingual content (100+ languages)
  • Need multi-vector retrieval
  • Cross-language search

Image Classification

Classify images into categories using ResNet-50.

Model

  • @cf/microsoft/resnet-50 - 1000 ImageNet classes

Classify Image

Output:

Use Cases

Content Moderation:
Auto-Tagging:

Object Detection

Detect objects in images with bounding boxes and class labels.

Model

  • @cf/facebook/detr-resnet-50 - Detection Transformer

Detect Objects

Output:

Use Cases

Count Objects:
Scene Understanding:

Image-to-Text

Generate text descriptions or answers from images.

Models

  • @cf/llava-hf/llava-1.5-7b-hf - Vision Q&A and captioning
  • @cf/unum/uform-gen2-qwen-500m - Lightweight image-to-text

Generate Caption

Image Q&A

Example:

Use Cases

Accessibility:
Product Descriptions:

Vision Models (Multimodal LLMs)

Advanced vision understanding using multimodal language models.

Models

  • @cf/meta/llama-3.2-11b-vision-instruct - Llama with vision
  • @cf/google/gemma-3-12b-it - Gemma with image support

Visual Reasoning

Document OCR

Visual Q&A with Context

Use Cases

Invoice Processing:
Chart Analysis:

Text Classification & Reranking

Classify text or rerank search results for better relevance.

Models

Reranking:
  • @cf/baai/bge-reranker-base - Semantic similarity scoring
Sentiment Analysis:
  • @cf/huggingface/distilbert-sst-2-int8 - Positive/negative classification

Rerank Search Results

Sentiment Analysis

Output:

Complete Examples

Semantic Search with Reranking

Image Upload Pipeline

Visual Document Processing

Best Practices

Model Selection

Embeddings:
  • English-only → bge-base-en-v1.5
  • Multilingual → bge-m3
  • Speed critical → bge-small-en-v1.5
  • Max accuracy → bge-large-en-v1.5
Vision:
  • Simple classification → resnet-50
  • Object detection → detr-resnet-50
  • Image Q&A → llava-1.5-7b-hf
  • Complex reasoning → llama-3.2-vision or gemma-3

Caching

Workers AI responses can be cached:

Error Handling

Performance Tips

  1. Batch requests when possible
  2. Use smaller models for simple tasks
  3. Cache embeddings for repeated queries
  4. Parallelize independent operations
  5. Choose appropriate dimensions (smaller = faster + cheaper storage)

Limitations

Free Tier:
  • 10,000 requests/day
  • Rate limits apply
Image Requirements:
  • Max size varies by model
  • Supported formats: JPEG, PNG, WebP
  • Must be accessible URLs or base64
Model Availability:

Next Steps

think Operation

Full think operation reference

storage Operation

Store embeddings in Vectorize

RAG Pipeline

Complete RAG example

Workers AI Docs

Cloudflare Workers AI documentation