How aaarya2117/quadrants works
ML Model Swap is a Python tool for comparing compatible model checkpoints, promoting a candidate by updating a role registry, smoke-testing the change, and rolling back. The main workflow starts at the CLI, runs through a shared command dispatcher and selected engine, then reaches comparison or swap logic; applications can separately load the registry’s active model at inference time. The README also describes MATLAB visualization, but no MATLAB source appears in the supplied tree, so that capability is not mapped as an implemented component.
Main entry points: compare.py Model Comparison · swap.py Swap and Rollback · runtime.py Role Runtime · cli.py CLI
Components 19
CLI and Demo
- CLI
modelswap/cli.py - Scripted Demo
modelswap/demo.py - Command Dispatcher
modelswap/commands.py - Result Rendering
modelswap/render.py
Model Evaluation
- Model Comparison
modelswap/compare.py - Checkpoint Architecture
modelswap/arch.py - Evaluation Dataset
data/test.npz - Model Checkpoints
models/model_a.pt
Swap Management
- Engine Selection
modelswap/engine.py - Stub Backend
modelswap/stub_engine.py - Registry Backend
modelswap/real_engine.py - Shared Result Types
modelswap/results.py - Swap and Rollback
modelswap/swap.py - Role Registry
models.yaml - Swap Audit Records
Runtime Serving
- Role Runtime
modelswap/runtime.py - Loaded Active Model
modelswap/arch.py
Other components
- Operator
- Application
Connections 24
- Operator → CLI: runs commands
README.md - CLI → Engine Selection: selects backend
modelswap/cli.py - CLI → Command Dispatcher: dispatches operation
modelswap/cli.py - CLI → Scripted Demo: runs demo
modelswap/cli.py - Scripted Demo → Command Dispatcher: executes steps
modelswap/demo.py - Command Dispatcher → Engine Selection: calls engine
modelswap/commands.py - Command Dispatcher → Result Rendering: renders output
modelswap/commands.py - Engine Selection → Registry Backend: loads backend
modelswap/engine.py - Engine Selection → Stub Backend: falls back
modelswap/engine.py - Registry Backend → Role Runtime: resolves role
modelswap/real_engine.py - Registry Backend → Model Comparison: compares models
modelswap/real_engine.py - Registry Backend → Swap and Rollback: applies or rolls back
modelswap/real_engine.py - Model Comparison → Checkpoint Architecture: checks signatures
modelswap/compare.py - Model Comparison → Evaluation Dataset: evaluates against
modelswap/compare.py - Model Comparison → Model Checkpoints: loads candidates
- Model Comparison → Shared Result Types: returns metrics
modelswap/real_engine.py - Swap and Rollback → Role Registry: updates atomically
modelswap/swap.py - Swap and Rollback → Model Comparison: smoke-tests model
modelswap/swap.py - Swap and Rollback → Swap Audit Records: writes audit
modelswap/swap.py - Swap and Rollback → Shared Result Types: returns swap status
modelswap/real_engine.py - Role Runtime → Role Registry: reads role config
modelswap/runtime.py - Role Runtime → Checkpoint Architecture: loads checkpoint
modelswap/runtime.py - Application → Role Runtime: requests active role
README.md - Role Runtime → Loaded Active Model: returns loaded model
modelswap/runtime.py