Overview
Containers are HTTP services that evaluate prompts for Synth AI’s optimization algorithms. They implement a simple contract: receive rollout requests, execute episodes, and return rewards.High-Level Architecture
Key Components:- Container - Your HTTP service (any language)
- Synth AI Backend - Coordinates optimization
- GEPA Optimizer - Evolutionary search engine
- Interceptor - Prompt transformation layer
- LLM Provider - Inference endpoint
Container Contract
Required Endpoints
GET /health- Liveness probe (unauthenticated OK)
- Returns:
{"healthy": true}
- Dataset metadata (authenticated)
- Returns: Task description, seeds, rubric, inference mode
- Execute one episode (authenticated)
- Input:
trace_correlation_id,env.seed,policy.config - Returns: Trajectories, metrics, rewards
Request Flow
Rollout Request Structure
Response Flow
Rollout Response Structure
Interceptor Pattern (Critical)
How It Works
Step 1: Container Receives Baseline- ✅ Container never sees optimized prompts
- ✅ Prompts stay secure in backend
- ✅ No Container code changes needed
- ✅ Pattern-based transformations
GEPA Optimization Flow
Complete Optimization Cycle
Phase 1: Job SubmissionDeployment Architectures
Option 1: Embedded Container
Option 2: Standalone Container
Option 3: Cloud-Deployed Container
Authentication Flow
Two Separate Auth Flows
1. Container Authentication (X-API-Key)Data Flow: Complete Example
Banking77 Classification Example
1. Job SubmissionError Handling
Common Scenarios
Container Unreachable:- Backend retries with exponential backoff
- Job fails after max retries
- Container returns 502 Bad Gateway
- Backend marks rollout as failed
- Continues with other candidates
- Backend validates response structure
- Marks rollout as failed if invalid
- Container should respond within timeout_seconds
- Backend cancels long-running rollouts
Performance Considerations
Throughput
Bottlenecks:- LLM inference latency (~1-3s per rollout)
- Network latency (Container ↔ Backend)
- Container processing time
- Parallel rollouts (max_concurrent)
- Minibatch gating (GEPA)
- Efficient Container implementation
Scalability
Container:- Stateless design (scales horizontally)
- Efficient dataset loading
- Connection pooling for LLM calls
- Handles multiple jobs concurrently
- Manages Interceptor instances
- Efficient archive updates
Security Considerations
API Keys:ENVIRONMENT_API_KEY- Container authenticationSYNTH_API_KEY- Backend authenticationLLM_API_KEY- LLM provider authentication
- HTTPS for all connections
- Tunnel options for local development
- API key validation
- Prompts never sent to Containers
- Transformations registered securely
- No prompt leakage
Next Steps
- Local API Overview - Complete Local API guide
- Polyglot Local API - Multi-language examples
- GEPA Architecture - Deep dive into GEPA
- Deployed Container Walkthrough - Step-by-step guide