Overview
Task Apps 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:- Task App - Your HTTP service (any language)
- Synth AI Backend - Coordinates optimization
- GEPA Optimizer - Evolutionary search engine
- Interceptor - Prompt transformation layer
- LLM Provider - Inference endpoint
Task App 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:
run_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: Task App Receives Baseline- ✅ Task App never sees optimized prompts
- ✅ Prompts stay secure in backend
- ✅ No Task App code changes needed
- ✅ Pattern-based transformations
GEPA Optimization Flow
Complete Optimization Cycle
Phase 1: Job SubmissionDeployment Architectures
Option 1: Embedded Task App
Option 2: Standalone Task App
Option 3: Cloud-Deployed Task App
Authentication Flow
Two Separate Auth Flows
1. Task App Authentication (X-API-Key)Data Flow: Complete Example
Banking77 Classification Example
1. Job SubmissionError Handling
Common Scenarios
Task App Unreachable:- Backend retries with exponential backoff
- Job fails after max retries
- Task App returns 502 Bad Gateway
- Backend marks rollout as failed
- Continues with other candidates
- Backend validates response structure
- Marks rollout as failed if invalid
- Task App should respond within timeout_seconds
- Backend cancels long-running rollouts
Performance Considerations
Throughput
Bottlenecks:- LLM inference latency (~1-3s per rollout)
- Network latency (Task App ↔ Backend)
- Task App processing time
- Parallel rollouts (max_concurrent)
- Minibatch gating (GEPA)
- Efficient Task App implementation
Scalability
Task App:- 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- Task App 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 Task Apps
- 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 Task App Walkthrough - Step-by-step guide