How-To Guides
CI/CD Integration
Automate model deployment with ZETIC Melange CLI in your CI/CD pipeline.
The ZETIC Melange CLI can be integrated into your CI/CD pipeline to automate model deployment whenever your model is retrained or updated.
Overview
A typical CI/CD workflow with Melange:
- Train or update your model in your ML pipeline.
- Export the model to a supported format (
.pt2or.onnx). - Use the Melange CLI to upload the new model version.
- The Melange backend compiles and optimizes the model.
- Your app automatically picks up the new version on next launch.
Setup
Install the CLI
pip install zeticAuthentication
For CI/CD environments, authenticate using environment variables or a pre-authenticated session:
# Interactive login (run once to cache credentials)
zetic auth loginStore your Personal Key as a CI/CD secret environment variable for automated workflows.
Example Pipeline
GitHub Actions
name: Deploy Model
on:
push:
paths:
- 'models/**'
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.10'
- name: Install ZETIC CLI
run: pip install zetic
- name: Deploy model
env:
ZETIC_PERSONAL_KEY: ${{ secrets.ZETIC_PERSONAL_KEY }}
run: |
zetic auth login
zetic gen \
-p ${{ vars.REPOSITORY_NAME }} \
-i models/input.npy \
models/model.onnxGeneral CI/CD Script
#!/bin/bash
set -e
# Install CLI
pip install zetic
# Authenticate
zetic auth login
# Upload model
zetic gen \
-p username/model-name \
-i input_0.npy \
-i input_1.npy \
model.pt2
echo "Model deployment initiated successfully"Best Practices
- Version your inputs alongside your model files.
- Use separate repositories for staging and production models.
- Monitor deployment status on the Melange Dashboard after upload.
- Pin model versions in production apps to avoid unintended updates.
Ensure your CI/CD environment has network access to the Melange API endpoints. The CLI requires internet connectivity for authentication and model upload.
Next Steps
- CLI Reference: Full CLI command reference
- Understanding Model Keys: Versioning and key management
- Web Dashboard: Monitor deployment status