export command converts a trained Neurenix model to different formats for deployment across various platforms and frameworks.
Usage
Options
| Option | Type | Required | Default | Description |
|---|---|---|---|---|
--model | string | Yes | - | Path to the model file (.nrx format) |
--format | string | Yes | - | Export format (see formats below) |
--output | string | No | Auto-generated | Output file or directory path |
--optimize | flag | No | false | Optimize the exported model |
--quantize | string | No | none | Quantization type (int8, fp16, none) |
Supported Formats
| Format | Extension | Description | Use Case |
|---|---|---|---|
onnx | .onnx | Open Neural Network Exchange | Cross-platform deployment |
torchscript | .pt | PyTorch TorchScript | PyTorch production |
tensorflow | _tf/ | TensorFlow SavedModel | TensorFlow serving |
tflite | .tflite | TensorFlow Lite | Mobile and edge devices |
wasm | .wasm | WebAssembly | Browser and edge deployment |
c | .c | C source code | Embedded systems |
Examples
Export to ONNX
Export to TorchScript
Export to TensorFlow
Export to TensorFlow Lite
Export to WebAssembly
Export to C
Custom output path
Export with optimization
Export with quantization
Export with all optimizations
Quantization Options
INT8 Quantization
Reduces model size by ~75% with minimal accuracy loss:- Smaller model size (4x reduction)
- Faster inference on compatible hardware
- Lower memory usage
- Small accuracy degradation (typically less than 1%)
- Requires calibration data for best results
FP16 Quantization
Reduces model size by ~50% with negligible accuracy loss:- Smaller model size (2x reduction)
- Faster inference on GPUs
- Minimal accuracy loss
- Less size reduction than INT8
- Requires FP16-capable hardware for speedup
Format-Specific Details
ONNX (.onnx)
Best for: Cross-platform deployment, inference optimizationTorchScript (.pt)
Best for: PyTorch production environmentsTensorFlow Lite (.tflite)
Best for: Mobile apps (Android/iOS), edge devicesWebAssembly (.wasm)
Best for: Browser-based inference, edge computingC (.c)
Best for: Embedded systems, microcontrollersError Handling
Model not found
Invalid format
Export error
Best Practices
1. Test exported models
Always verify exported models match original performance:2. Choose appropriate format for target platform
3. Optimize for production
Always use optimization for production deployments:4. Version exported models
5. Document export settings
Create a script to reproduce exports:Deployment Workflow
See Also
- Serve command - Serve models as APIs
- Eval command - Evaluate models
- Optimize command - Optimize models
- Run command - Train models