Overview
Conductor integrates with multiple AI providers through a unified interface. Configure your providers, route through AI Gateway for caching and analytics, and switch between models effortlessly.Supported Providers
OpenAI
GPT-4, GPT-4o, GPT-4o-mini, o1
Anthropic
Claude 3.5 Sonnet, Claude 3.5 Haiku
Workers AI
Llama 3.1, Mistral, Gemma (edge models)
Groq
Ultra-fast Llama 3.1 inference
Setup
1. Install Conductor
2. Configure Environment Variables
Create.dev.vars for local development:
wrangler.toml for production:
3. Configure AI Gateway (Recommended)
- Go to AI Gateway
- Create new gateway
- Copy gateway ID to wrangler.toml
OpenAI Integration
Basic Configuration
Available Models
Structured Output
Function Calling
Anthropic Integration
Basic Configuration
Available Models
Extended Thinking
Claude’s new thinking feature for complex reasoning:Workers AI Integration
Basic Configuration
Available Models
No API Key Needed
Groq Integration
Basic Configuration
Available Models
Ultra-Fast Inference
Groq provides extremely fast inference (~200ms):Routing Modes
cloudflare-gateway (Recommended)
cloudflare (Workers AI Only)
direct
Multi-Provider Patterns
Cascade Pattern
Try fast model first, escalate if needed:Load Balancing
Distribute load across providers:Fallback Pattern
Primary provider with fallback:Cost Optimization
Use cheaper models when appropriate:Prompt Engineering
System Prompts
Few-Shot Examples
Dynamic Prompts
Response Handling
JSON Responses
Text Responses
Streaming (Custom Members)
Error Handling
Retry on Failure
Fallback Content
Timeout Handling
Cost Optimization
Use Cheaper Models
Cache Aggressively
Limit Token Usage
Monitor Spending
Check AI Gateway dashboard:- Cost per model
- Cache hit rates
- Request volume
- Set spending limits
Testing AI Members
Best Practices
- Use AI Gateway - Always route through gateway in production
- Start with cheaper models - Escalate to expensive models only when needed
- Cache aggressively - Long TTLs for stable queries
- Lower temperature for consistency - Use 0.1-0.3 for deterministic tasks
- Limit tokens - Set maxTokens to prevent runaway costs
- Use structured output - JSON schemas for type safety
- Handle errors gracefully - Retry with fallback providers
- Monitor costs - Check dashboard regularly
- Test with mocks - Fast, reliable tests
- Version your prompts - Use Edgit for prompt versioning (future)

