Model Jacket is a lightweight toolkit that wraps any ML model (Torch, ONNX, Scikit-learn) into a scalable, observable API server with one command. It provides Dockerized model APIs, metrics, Kubernetes deployment, and a PyPI-installable CLI — all in one place.
- 🐳 One-command containerization with
jacket build - 🔌 Framework-agnostic: PyTorch, ONNX, Scikit-learn supported
- ⚡ FastAPI-based async inference with Uvicorn
- 📊 Built-in Prometheus metrics and
/healthzendpoint - ☸️ Helm chart for scalable K8s deployment + HPA
- ✅ CI/CD to PyPI + GHCR on every Git tag push
- 🧪 Includes batching, versioning, and logging hooks
# export_model.py
from sklearn.datasets import load_iris
from sklearn.ensemble import RandomForestClassifier
import joblib
X, y = load_iris(return_X_y=True)
clf = RandomForestClassifier().fit(X, y)
joblib.dump(clf, "model.pkl")jacket build --framework sklearn --model-path model.pkl --tag iris-v1docker run -p 8000:8000 model-jacket:iris-v1curl -X POST http://localhost:8000/predict \
-H "Content-Type: application/json" \
-d '{"input_data": [[5.1, 3.5, 1.4, 0.2]]}'helm install iris ./helm/model-jacket \
--set image.repository=ghcr.io/shahwarcodes/model-jacket \
--set image.tag=iris-v1pip install model-jacketmodel-jacket/
├── jacket_cli/ # CLI for build & serve
├── runtime/ # FastAPI server + handlers
│ ├── api/
│ └── handlers/
├── helm/ # Helm chart for Kubernetes
├── .github/workflows/ # CI/CD pipeline
├── Dockerfile
├── setup.py
└── README.md
/metrics: Prometheus-compatible metrics (latency, QPS)/healthz: Liveness & readiness probes- Structured logs with model version + timing info
- Track every model as
model:v1,model:v1.1, etc. - Route production traffic to
v1, and shadow tov2 - Compare predictions and latency without user exposure
- Rollback safely using Helm or container tags
Contributions welcome! Feel free to fork, submit a PR, or open issues.