synth-ai queue manages the Celery worker that processes experiment jobs locally. The queue system allows you to submit multiple prompt learning experiments (GEPA/MIPRO) and have them processed automatically by a background worker.
Overview
The experiment queue system consists of:- Queue Worker: A Celery worker that processes jobs from the queue
- Beat Scheduler: Periodically checks for queued jobs and dispatches them (runs every 5 seconds)
- Database: SQLite database stores experiment metadata and job status
- Redis Broker: Redis handles task queuing and result storage
Prerequisites
-
Redis: Install and start Redis
-
Environment Variables: Set required environment variables
Quick Start
Commands
queue start
Start the experiment queue worker in the background.
--concurrency INTEGER- Worker concurrency (default:1)--loglevel TEXT- Celery log level:debug,info,warning,error(default:info)--pool {solo|prefork|threads|gevent|eventlet}- Worker pool type (default:prefork)--background / --foreground- Run in background or foreground (default:--background)--beat / --no-beat- Run Celery Beat scheduler (default:--beat)--extra TEXT- Extra arguments forwarded to celery worker (can be used multiple times)
- Automatically kills any existing workers before starting
- Validates that
EXPERIMENT_QUEUE_DB_PATHis set - Ensures only one worker instance runs at a time
- Logs are written to
logs/experiment_queue_worker.login background mode - Beat scheduler runs periodic queue checks every 5 seconds
queue stop
Stop all running experiment queue workers.
queue status
Show status of experiment queue workers and configuration.
Environment Variables
| Variable | Required | Default | Description |
|---|---|---|---|
EXPERIMENT_QUEUE_DB_PATH | ✅ Yes | None | Path to SQLite database file for experiment metadata |
EXPERIMENT_QUEUE_BROKER_URL | No | redis://localhost:6379/0 | Redis URL for Celery broker |
EXPERIMENT_QUEUE_RESULT_BACKEND_URL | No | redis://localhost:6379/1 | Redis URL for Celery result backend |
EXPERIMENT_QUEUE_TRAIN_CMD | No | Auto-detected | Training command override (defaults to venv Python) |
Workflow
- Start Worker:
synth-ai queue startlaunches the worker - Submit Experiments: Use
synth-ai experiment submitto add jobs to the queue - Automatic Processing: Beat scheduler dispatches jobs every 5 seconds
- Monitor: Use
synth-ai queue statusorsynth-ai experiments --watchto monitor progress - Stop Worker:
synth-ai queue stopwhen done
Troubleshooting
Worker won’t start
Error:EXPERIMENT_QUEUE_DB_PATH environment variable must be set
Solution: Set the environment variable before starting:
Redis connection errors
Error:Error connecting to Redis
Solution: Ensure Redis is running:
Jobs not being dispatched
Symptoms: Jobs remain in QUEUED status Checklist:- Verify worker is running:
synth-ai queue status - Check Beat scheduler is enabled:
synth-ai queue start --beat(default) - Check Redis connectivity:
redis-cli ping - Review worker logs:
tail -f logs/experiment_queue_worker.log
Multiple workers detected
Warning:Some workers are using different database paths!
Solution: The system enforces a single database path. Stop all workers and restart:
Logs
Worker logs are written tologs/experiment_queue_worker.log when running in background mode. To monitor logs in real-time:
Related Commands
synth-ai experiment submit- Submit experiments to the queuesynth-ai experiments- View experiment dashboardsynth-ai train- Direct training (bypasses queue)