Deploy Your Agent¶
Get your trained agent to production.
Deployment Options¶
Local Deployment¶
iovalence deploy --model model.pkl --target local
Make predictions:
iovalence predict --model model.pkl --input "text here"
Docker Deployment¶
iovalence deploy --model model.pkl --target docker
docker run -p 5000:5000 my-agent:latest
Cloud Deployment (AWS, GCP, Azure)¶
iovalence deploy --model model.pkl --target aws
# or --target gcp, --target azure
REST API Server¶
iovalence serve --model model.pkl --port 5000
API endpoint:
curl -X POST http://localhost:5000/predict \
-H "Content-Type: application/json" \
-d '{"input": "your text here"}'
Pre-Deployment Checklist¶
- [ ] Model achieves desired accuracy
- [ ] All dependencies listed
- [ ] Configuration files included
- [ ] Data preprocessing documented
- [ ] Error handling implemented
- [ ] Security configured
- [ ] Monitoring enabled
Model Optimization¶
Quantization (Smaller model)¶
iovalence quantize --model model.pkl \
--output model_optimized.pkl \
--bits 8
Reduces model size by 4x with minimal accuracy loss.
Compression¶
iovalence compress --model model.pkl \
--output model_compressed.pkl
Deployment Monitoring¶
After deployment, monitor:
iovalence monitor --model deployed-model
Metrics: - Request rate - Latency - Error rate - Model accuracy on live data
Version Control¶
iovalence tag --model model.pkl --version v1.0
iovalence tag --model model.pkl --version v1.1
List versions:
iovalence list-versions --model model.pkl
A/B Testing¶
Compare two models:
iovalence ab-test \
--model-a model_v1.pkl \
--model-b model_v2.pkl \
--split 0.5
Update Model¶
When retraining:
iovalence update --model new-model.pkl
Automatic rollback if accuracy drops.
Common Deployment Issues¶
| Issue | Solution |
|---|---|
| Model not found | Check path and permissions |
| Out of memory | Use quantization |
| Slow inference | Increase batch processing |
| High error rate | Validate data preprocessing |
Best Practices¶
- Always version your models
- Test before production
- Monitor in production
- Have rollback plan
- Document everything
Next Steps¶
- 📈 Monitor Performance
- 📚 Production Guide
- 🔧 Troubleshooting