skills/aimlops/model-deployment/SKILL.md
Deploys machine learning models to production using containers and orchestration tools.
npx skillsauth add alphaonedev/openclaw-graph model-deploymentInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
This skill automates the deployment of machine learning models to production environments using containers (e.g., Docker) and orchestration tools (e.g., Kubernetes), ensuring scalable and reliable ML model serving.
resources: limits: cpu: 2.To use this skill, first prepare your model in a Docker-friendly format, then build and deploy it. Always set environment variables for authentication, like $KUBECONFIG for Kubernetes access.
Pattern 1: Basic deployment
model.h5) and write a Dockerfile.Pattern 2: Update an existing deployment
Always verify cluster access before starting; check with kubectl get nodes to ensure connectivity.
Use these CLI commands for core operations. For API interactions, reference Kubernetes REST API endpoints.
Build and tag a Docker image:
docker build -t mymlmodel:v1 .
This creates an image from the current directory.
Push the image to a registry:
docker push mymlmodel:v1
Requires authentication via $DOCKER_REGISTRY_TOKEN as an env var.
Deploy to Kubernetes:
kubectl apply -f deployment.yaml
Where deployment.yaml includes:
apiVersion: apps/v1
kind: Deployment
metadata: name: myml-deployment
spec: replicas: 3, template: spec: containers: - name: model-server image: mymlmodel:v1
Scale the deployment:
kubectl scale deployment myml-deployment --replicas=5
API endpoint for querying deployments:
Use the Kubernetes API at GET /apis/apps/v1/namespaces/default/deployments with authentication via bearer token in $KUBE_API_TOKEN.
For config formats, use Kubernetes YAML files, e.g.:
apiVersion: v1
kind: Service
metadata: name: model-service
spec: selector: app: mymlmodel, ports: - protocol: TCP port: 80
Integrate this skill with CI/CD tools like GitHub Actions or Jenkins by adding steps in your pipeline YAML. For example, in GitHub Actions:
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- run: docker build -t mymlmodel:${{ github.sha }} .
- run: kubectl apply -f k8s/deployment.yaml --context=$KUBE_CONTEXT
Set env vars for secrets, e.g., $GITHUB_TOKEN for repo access and $KUBE_CONTEXT for cluster selection. Ensure your ML pipeline outputs are in a standard format, like a pickled model file, for seamless Docker integration.
Handle common errors proactively. If docker build fails with "no such file," verify the Dockerfile path and required files. For Kubernetes errors like "image pull failed," check image registry credentials via $DOCKER_REGISTRY_TOKEN.
kubectl logs <pod-name> and ensure resources match in deployment YAML, e.g., add resources: requests: memory: "1Gi".KUBECONFIG=~/.kube/config, and test with kubectl get pods.$KUBE_API_TOKEN and use exponential backoff in scripts.Always include try-catch in automation scripts, e.g.:
import subprocess
try:
subprocess.run(["kubectl", "apply", "-f", "deployment.yaml"], check=True)
except subprocess.CalledProcessError as e:
print(f"Deployment failed: {e}")
tools
Root web development: project structure, tooling selection, deployment decisions
development
WebAssembly: Rust/Go/C to WASM, wasm-bindgen, Emscripten, WASM Component Model
development
Vue 3: Composition API script setup, Pinia, Vue Router 4, SFCs, Vite, Nuxt 3
tools
Tailwind CSS 4: utility classes, config, JIT, arbitrary values, darkMode, plugins, shadcn/ui