Consolidate 4 separate ModelType enum definitions (ml 15 variants, model_loader 7, campaign 2, job_spawner 4) into a single canonical definition in common/src/model_types.rs with the union of all variants and all methods (file_extension, as_str, to_db_string, weight, from_str, Display). - ml/src/lib.rs: replace 15-variant enum with re-export - model_loader/src/lib.rs: replace 7-variant enum with re-export, update PascalCase names (Dqn->DQN, Tft->TFT, etc) - ml/hyperopt/campaign.rs: replace 2-variant enum with re-export - services/ml_training_service/job_spawner.rs: replace 4-variant enum with re-export, MAMBA2->MAMBA - Remove orphan impl ToString in ml/observability/metrics.rs (Display now provided by canonical type) - Update backtesting_service and model_loader tests for new names Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
ml_training_service
Model training orchestration and lifecycle management for the Foxhunt HFT trading system. Manages training jobs for DQN, PPO, TFT, Mamba2, TLOB, and Liquid models with progress tracking, resource allocation, and model artifact storage.
Building
# Default (minimal features)
cargo build --release -p ml_training_service
# With GPU acceleration (requires CUDA)
cargo build --release -p ml_training_service --features gpu
# With mock training data (testing only, bypasses database)
cargo build --release -p ml_training_service --features mock-data
Features
| Feature | Default | Description |
|---|---|---|
minimal |
Yes | Minimal ML feature set for financial models |
gpu |
No | SIMD GPU acceleration (requires CUDA) |
debug |
No | Additional debug logging |
mock-data |
No | Use mock training data instead of PostgreSQL |
Configuration
The gRPC listen port is set via the GRPC_PORT environment variable. Prometheus metrics are exposed on port 9094.
PostgreSQL (via sqlx) is used for job metadata, training history, and state management. Set the connection string with DATABASE_URL.
Running
GRPC_PORT=50053 DATABASE_URL="postgresql://user:pass@localhost:5432/foxhunt_training" \
./target/release/ml_training_service serve
Testing
# Unit tests (offline, no database required)
SQLX_OFFLINE=true cargo test -p ml_training_service --lib
# Integration tests (requires running PostgreSQL)
cargo test -p ml_training_service