How deepak00singh/gen-model-alignment-synthetic-worlds works
Synthetic-Eval is a framework for measuring LLM generalization and alignment inside invented-rule worlds. A user selects a model, environment, and evaluation focus in the dashboard; the API initializes a model and environment, runs a sandbox step, and returns state and log data. The documented programmatic path also loads a scenario and scores generalization and adversarial alignment. The API excerpt currently returns mocked metrics, so its response should not be read as the full evaluator pipeline. Connections for unsampled evaluator and provider modules rely on README or SOURCE INDEX references.
Main entry points: routes.py Evaluation API · model_wrapper.py Model router · sandbox.py Simulation sandbox · app.py Flask application
Components 22
Web application
- Browser dashboard
src/api/templates/index.html - Flask application
src/api/app.py - Evaluation API
src/api/routes.py - JWT authentication
src/api/auth.py - Request security
src/api/middlewares.py - Web extensions
src/api/extensions.py
Synthetic worlds
- Environment loader
src/world_engine/environment.py - World definitions
data/environments - Simulation sandbox
src/world_engine/sandbox.py - Rule engine
src/world_engine/rule_engine.py - Mutable world state
src/world_engine/world_state.py
Evaluation
- Evaluation scenarios
data/scenarios - Alignment scoring
src/evaluators/alignment_evaluator.py - Generalization scoring
src/evaluators/generalization_evaluator.py
Model access
- Model router
src/models/model_wrapper.py - OpenAI backend
src/models/openai_model.py - HuggingFace backend
src/models/hf_model.py - Anthropic backend
src/models/anthropic_model.py
Persistence and utilities
- User records
src/api/models.py - Logging utilities
src/utils/logging_utils.py
Other components
- Dashboard user
- LLM provider
Connections 27
- Dashboard user → Browser dashboard: uses
README.md - Browser dashboard → Evaluation API: requests evaluation
README.md - Flask application → Evaluation API: registers
src/api/app.py - Flask application → JWT authentication: registers
src/api/app.py - Flask application → Request security: applies headers
src/api/app.py - Flask application → Web extensions: initializes
src/api/app.py - Evaluation API → Request security: validates input
src/api/routes.py - JWT authentication → User records: reads and writes
src/api/auth.py - JWT authentication → Web extensions: uses services
src/api/auth.py - Evaluation API → World definitions: lists definitions
src/api/routes.py - Evaluation API → Environment loader: loads environment
src/api/routes.py - Evaluation API → Model router: selects model
- Evaluation API → Simulation sandbox: creates and steps
src/api/routes.py - Simulation sandbox → Rule engine: initializes
src/world_engine/sandbox.py - Simulation sandbox → Mutable world state: initializes
src/world_engine/sandbox.py - Simulation sandbox → Evaluation scenarios: loads scenario
README.md - Simulation sandbox → Alignment scoring: runs evaluator
src/world_engine/sandbox.py - Simulation sandbox → Generalization scoring: runs evaluator
src/world_engine/sandbox.py - Alignment scoring → Model router: requests responses
- Generalization scoring → Model router: requests responses
- Model router → OpenAI backend: routes calls
src/models/model_wrapper.py - Model router → HuggingFace backend: routes calls
src/models/model_wrapper.py - Model router → Anthropic backend: routes calls
src/models/model_wrapper.py - OpenAI backend → LLM provider: calls API
src/models/openai_model.py - HuggingFace backend → LLM provider: calls provider
- Anthropic backend → LLM provider: calls provider
- Model router → Logging utilities: logs through
src/models/model_wrapper.py