How imosudi/resimhub works
ReSimHub is a hybrid Flask/FastAPI backend for managing RL experiments, environments, training runs, and agent benchmarks. The main workflow is a client request into FastAPI, asynchronous training dispatch through Celery, progress/status reporting, and persisted run history; separate APIs support evaluation, analytics, metrics, and dashboards. Flask provides a legacy gateway/bridge. The README also documents Prometheus/Grafana observability and distributed Redis/Celery capabilities. Some routers and integrations are unsampled, so their internal links are omitted or marked unverified.
Main entry points: main.py FastAPI Entry · services/orchestrator.py Training Worker · db.py SQL Database · routers/orchestrator.py Training API
Components 26
API Services
- FastAPI Entry
backend/fastapi_app/main.py - Flask Gateway
backend/flask_app/__init__.py - Training Bridge
backend/flask_app/routes/training_bridge.py - API Proxy
backend/flask_app/services/api_proxy.py
Experiment Workflow
- Experiment API
backend/fastapi_app/routers/experiments.py - Environment API
backend/fastapi_app/routers/environments.py - Experiment Models
shared/models/experiment_model.py
Training Execution
- Training API
backend/fastapi_app/routers/orchestrator.py - Training Worker
backend/fastapi_app/services/orchestrator.py - Progress Broadcast
backend/fastapi_app/services/progress_broadcast.py - Training Run Model
shared/models/training_model.py - Train Routes
backend/fastapi_app/routers/train.py - Task Status Routes
backend/fastapi_app/routers/status.py
Evaluation Analytics
- Benchmark API
backend/fastapi_app/routers/benchmark.py - Benchmark Service
backend/fastapi_app/services/benchmark_service.py - Benchmark Models
shared/models/benchmark_model.py - Analytics API
backend/fastapi_app/routers/analytics.py - Analytics Service
backend/fastapi_app/services/analytics_service.py - Metrics API
backend/fastapi_app/routers/metrics.py - Dashboard API
backend/fastapi_app/routers/dashboard.py
State And Observability
- SQL Database
backend/fastapi_app/core/db.py - Configuration
backend/fastapi_app/core/config.py - Redis
- Celery Queue
- Prometheus / Grafana
Other components
- REST Client
Connections 36
- REST Client → FastAPI Entry: sends requests
README.md - FastAPI Entry → Experiment API: registers router
backend/fastapi_app/main.py - FastAPI Entry → Environment API: registers router
backend/fastapi_app/main.py - FastAPI Entry → Training API: registers router
backend/fastapi_app/main.py - FastAPI Entry → Train Routes: registers router
backend/fastapi_app/main.py - FastAPI Entry → Task Status Routes: registers router
backend/fastapi_app/main.py - FastAPI Entry → Benchmark API: registers router
backend/fastapi_app/main.py - FastAPI Entry → Analytics API: registers router
backend/fastapi_app/main.py - FastAPI Entry → Metrics API: registers router
backend/fastapi_app/main.py - FastAPI Entry → Dashboard API: registers router
backend/fastapi_app/main.py - FastAPI Entry → SQL Database: initializes
backend/fastapi_app/main.py - FastAPI Entry → Progress Broadcast: connects at startup
backend/fastapi_app/main.py - Experiment API → Experiment Models: uses models
backend/fastapi_app/routers/experiments.py - Experiment API → SQL Database: accesses sessions
backend/fastapi_app/routers/experiments.py - Environment API → Experiment Models: uses models
backend/fastapi_app/routers/environments.py - Environment API → SQL Database: accesses sessions
backend/fastapi_app/routers/environments.py - Training API → Training Worker: queues task
backend/fastapi_app/routers/orchestrator.py - Training API → Training Run Model: records queued run
backend/fastapi_app/routers/orchestrator.py - Training API → Progress Broadcast: subscribes to updates
backend/fastapi_app/routers/orchestrator.py - Training Worker → Celery Queue: dispatches tasks
README.md - Training Worker → Redis: publishes progress
backend/fastapi_app/services/orchestrator.py - Training Worker → SQL Database: persists run state
backend/fastapi_app/services/orchestrator.py - Progress Broadcast → Redis: publishes and subscribes
backend/fastapi_app/services/progress_broadcast.py - Task Status Routes → Training Worker: checks task status
backend/fastapi_app/routers/status.py - Train Routes → Training Worker: uses task service
backend/fastapi_app/routers/train.py - Benchmark API → Benchmark Service: uses evaluator
- Benchmark Service → Benchmark Models: persists evaluation
backend/fastapi_app/services/benchmark_service.py - Benchmark Service → SQL Database: reads and writes
backend/fastapi_app/services/benchmark_service.py - Benchmark Service → Redis: caches results
backend/fastapi_app/services/benchmark_service.py - Analytics API → Analytics Service: uses service
backend/fastapi_app/routers/analytics.py - Dashboard API → Progress Broadcast: uses broadcaster
backend/fastapi_app/routers/dashboard.py - Flask Gateway → Training Bridge: registers routes
backend/flask_app/__init__.py - Training Bridge → API Proxy: delegates requests
backend/flask_app/routes/training_bridge.py - Configuration → SQL Database: configures connection
backend/fastapi_app/core/db.py - REST Client → Flask Gateway: uses gateway
README.md - Prometheus / Grafana → Metrics API: observes metrics
README.md