cirron compile
Compile your ML models for production deployment with architecture-specific optimizations and validation.Usage
Options
Architecture and Framework Support
Without
--arch, the architecture comes from inference.device in the model config, then from the project’s hardware block. PyTorch on Apple Silicon hardware (type: gpu, architecture: arm64, which the “Apple Silicon” preset in cirron hardware writes) resolves to mps.
Compilation reads src/model.py, optimizes for the target architecture, and writes:
- PyTorch →
models/model_{arch}.pth - TensorFlow →
models/model_{arch}/ - Scikit-learn →
models/model_{arch}.joblib(via joblib)
artifacts/model_info.json.
Validation
With--validate, the command verifies required files (src/model.py, requirements.txt), Python version compatibility, architecture-specific requirements (e.g. CUDA availability), model instantiation, and index file format. Every failed check is reported. Without --strict the failures are warnings and compilation continues; with --strict the command stops before compiling and exits with code 35 (VALIDATION_FAILED).
If compilation itself fails, the command exits non-zero (36, COMPILE_FAILED, unless a more specific code applies), with or without --strict, so CI jobs fail when no artifacts were produced.
Index Files
--index config/index.json or --index config/index.yaml.