Skip to main contentsynth_ai.sdk.task.in_process
In-process task app support for local development and demos.
Classes
InProcessTaskApp
Context manager for running task apps in-process with automatic tunneling.
This class simplifies local development and demos by:
- Starting a task app server in a background thread
- Opening a tunnel automatically (Cloudflare by default, or use preconfigured URL)
- Providing the tunnel URL for GEPA/MIPRO jobs
- Cleaning up everything on exit
Supports multiple input methods:
- FastAPI app instance (most direct)
- TaskAppConfig object
- Config factory function (Callable[[], TaskAppConfig])
- Task app file path (fallback for compatibility)
Tunnel modes:
- “quick”: Cloudflare quick tunnel (default for local dev)
- “named”: Cloudflare named/managed tunnel
- “local”: No tunnel, use localhost URL directly
- “preconfigured”: Use externally-provided URL (set via preconfigured_url param or
SYNTH_TASK_APP_URL env var). Useful for ngrok or other external tunnel providers.