Models Training Runtime ADR
May 3, 2026 ยท View on GitHub
Status: Accepted Last updated: 2026-05-01 05:19 EDT
Context
batchalign3 models ... currently delegates to the Python training runtime:
python -m batchalign.models.training.run ...
The CLI/server control plane has migrated to Rust, but model training still depends on Python-first ML stacks and training code paths.
Decision
Keep models as a Python bridge for now, with explicit boundaries:
- Rust owns argument parsing, UX, and process orchestration.
- Python owns training/inference library integration for model training.
- Interpreter resolution must remain uv-friendly:
BATCHALIGN_PYTHON->VIRTUAL_ENV->python3.
Rationale
- Training-specific dependencies are Python-native and already production validated.
- Rewriting training loops in Rust now would be high-risk, low-ROI versus finishing CLI/server/runtime migration.
- The bridge keeps migration momentum while avoiding duplicate training stacks.
Consequences
- Shipping still requires a compatible Python runtime for
models. - CLI/server/runtime operations remain Rust-first.
- Migration accounting treats
modelsas an intentional Python-core island rather than accidental legacy code.
Exit Criteria For Future Rust Port
Revisit only when all are true:
- A Rust training stack is selected and benchmarked with parity targets.
- Feature parity test corpus exists for training outputs.
- Operational benefits (startup, packaging, observability, maintenance) clearly exceed migration cost.