MLOps Deployment Pipeline — Gap-Filling Skill
Bridge declarativo entre ai_ml_ml (onde modelos são treinados) e engineering_devops
(onde infraestrutura de deployment existe). Fecha o Gap-1 do APEX: modelos treinados
ficavam sem pipeline de produção.
Why This Skill Exists
O APEX tem skills ricas em ai_ml_ml para treinamento de modelos e skills em
engineering_devops para CI/CD e Kubernetes. O gap: nenhuma skill faz a ponte
entre model artifact e production serving endpoint. Modelos treinados ficam como
artefatos locais, sem pipeline de containerização, validação, deployment, drift monitoring
ou A/B testing declarativo. Esta skill fecha o Gap-1 identificado na análise de sinergia:
é o pipeline MLOps completo do modelo ao endpoint monitorado.
When to Use
Use esta skill quando:
- Um modelo foi treinado (via
ai_ml_ml) e precisa ser servido em produção
- Quiser adicionar drift monitoring a um modelo já em produção
- Precisar de A/B testing entre duas versões de modelo
- Construindo pipeline CI/CD para re-treinamento automático
What If Fails
| Fase |
Falha |
Ação |
| Validação |
Performance abaixo do baseline |
Bloquear deployment; reportar delta das métricas |
| Containerização |
Build falha |
Verificar dependências e versões de framework |
| Deployment |
Endpoint unhealthy |
Rollback automático para versão anterior |
| Drift Monitor |
PSI > threshold |
Trigger retrain pipeline; alertar equipe |
| A/B Test |
Sem significância |
Manter modelo atual; aumentar período de teste |
MLOps Pipeline Stages
STAGE 1: Model Validation
→ Carrega model_artifact_path
→ Avalia em hold-out set
→ Compara com performance_baseline
→ GATE: métricas >= baseline (bloqueia se não)
STAGE 2: Containerization
→ Gera Dockerfile otimizado por model_framework
→ Build e push da imagem para registry
→ Escaneia imagem por CVEs (via security-gate-injector)
→ Output: container_image_tag
STAGE 3: Deployment
→ Gera manifest (Kubernetes Deployment + Service, ou serverless config)
→ Deploy com health check e readiness probe
→ Output: serving_endpoint
→ GATE: endpoint healthy após deploy
STAGE 4: Drift Monitoring Setup
→ Configura coleta de distribuição de features em produção
→ Define alertas para PSI/KL-divergence > drift_threshold
→ Output: monitoring_config com dashboards
STAGE 5: A/B Test Configuration [se há versão anterior]
→ Configura traffic split entre champion e challenger
→ Define métricas de comparação e sample size
→ Output: ab_test_config
→ GATE: resultado estatisticamente significativo antes de promover
Framework → Serving Stack Map
| model_framework |
Serving Stack |
Container Base |
| sklearn |
FastAPI + joblib |
python:3.11-slim |
| pytorch |
TorchServe / FastAPI |
pytorch/torchserve |
| tensorflow |
TF Serving |
tensorflow/serving |
| huggingface |
HuggingFace Inference |
huggingface/transformers-pytorch-gpu |
| onnx |
ONNX Runtime Server |
mcr.microsoft.com/onnxruntime |
Diff History
- v00.36.0: Criado via OPP-Phase4-super-skills — Gap-1 bridge: ai_ml_ml ↔ engineering_devops (MLOps)
1---2skill_id: engineering_mlops.model_deployment_pipeline3name: mlops-deployment-pipeline4description: "Um modelo foi treinado (via `ai_ml_ml`) e precisa ser servido em produção"5 Bridge MLOps entre ai_ml_ml (treinamento de modelos) e engineering_devops (CI/CD).6 Orquestra: validação de modelo → containerização → deployment → drift monitoring →7 A/B testing de modelos em produção. Resolve o Gap-1: modelos treinados não têm8 pipeline de produção declarado no APEX.9version: v00.36.010status: ADOPTED11tier: 212executor: HYBRID13domain_path: engineering_mlops/model_deployment_pipeline14risk: medium15opp: OPP-Phase4-super-skills16anchors:17 - mlops18 - model_deployment19 - drift_monitoring20 - ab_testing21 - ml_pipeline22 - containerization23 - production_ml24 - monitoring25 - ci_cd26 - model_validation27input_schema:28 - name: model_artifact_path29 type: string30 description: "Path do modelo treinado (pickle, ONNX, SavedModel, etc.)"31 required: true32 - name: model_framework33 type: string34 enum: [sklearn, pytorch, tensorflow, huggingface, onnx, custom]35 description: "Framework do modelo"36 required: true37 - name: serving_target38 type: string39 enum: [rest_api, batch, streaming, edge]40 description: "Modalidade de serving do modelo"41 required: false42 default: "rest_api"43 - name: performance_baseline44 type: object45 description: "Métricas de performance mínimas: accuracy, latency_p99, throughput"46 required: false47 - name: drift_threshold48 type: number49 description: "Threshold de PSI/KL-divergence para alertar drift de dados"50 required: false51 default: 0.252output_schema:53 - name: deployment_manifest54 type: string55 description: "Path do manifest de deployment (Dockerfile, helm chart, etc.)"56 - name: serving_endpoint57 type: string58 description: "URL ou configuração do endpoint de serving"59 - name: monitoring_config60 type: object61 description: "Configuração de drift monitoring + alertas + dashboards"62 - name: ab_test_config63 type: object64 description: "Configuração de A/B testing entre versões de modelo"65synergy_map:66 complements:67 - engineering_devops.ci-cd-pipeline-builder68 - engineering_devops.docker-best-practices69 - engineering_devops.kubernetes-operations70 - engineering_devops.senior-ml-engineer71 - engineering_devops.senior-data-scientist72 cross_domain_bridges:73 - domain: ai_ml_ml74 strength: 0.9575 note: "Consumes trained model artifacts from ml training skills"76 - domain: engineering_devops77 strength: 0.9278 note: "Uses CI/CD infrastructure for model deployment automation"79 - domain: data80 strength: 0.8581 note: "Drift monitoring requires data pipeline integration"82 - domain: engineering_testing83 strength: 0.8084 note: "A/B testing integrates with testing infrastructure"85security:86 level: standard87 pii: false88 approval_required: false89 note: "Models trained on PII data require security.level = high"90what_if_fails: >91 Se model validation falha (performance abaixo do baseline): bloquear deployment e reportar delta.92 Se drift detectado (PSI > drift_threshold): trigger retrain pipeline automaticamente.93 Se serving endpoint unhealthy: rollback para versão anterior imediatamente.94 Se A/B test sem significância estatística: manter modelo atual; não promover challenger.95metadata:96 source: https://skillmd.com/skills/thiagofernandes1987-create/mlops-deployment-pipeline97---9899# MLOps Deployment Pipeline — Gap-Filling Skill100101Bridge declarativo entre `ai_ml_ml` (onde modelos são treinados) e `engineering_devops`102(onde infraestrutura de deployment existe). Fecha o Gap-1 do APEX: modelos treinados103ficavam sem pipeline de produção.104105## Why This Skill Exists106107O APEX tem skills ricas em `ai_ml_ml` para treinamento de modelos e skills em108`engineering_devops` para CI/CD e Kubernetes. **O gap**: nenhuma skill faz a ponte109entre `model artifact` e `production serving endpoint`. Modelos treinados ficam como110artefatos locais, sem pipeline de containerização, validação, deployment, drift monitoring111ou A/B testing declarativo. Esta skill fecha o Gap-1 identificado na análise de sinergia:112é o pipeline MLOps completo do modelo ao endpoint monitorado.113114## When to Use115116Use esta skill quando:117- Um modelo foi treinado (via `ai_ml_ml`) e precisa ser servido em produção118- Quiser adicionar drift monitoring a um modelo já em produção119- Precisar de A/B testing entre duas versões de modelo120- Construindo pipeline CI/CD para re-treinamento automático121122## What If Fails123124| Fase | Falha | Ação |125|------|-------|------|126| Validação | Performance abaixo do baseline | Bloquear deployment; reportar delta das métricas |127| Containerização | Build falha | Verificar dependências e versões de framework |128| Deployment | Endpoint unhealthy | Rollback automático para versão anterior |129| Drift Monitor | PSI > threshold | Trigger retrain pipeline; alertar equipe |130| A/B Test | Sem significância | Manter modelo atual; aumentar período de teste |131132## MLOps Pipeline Stages133134```135STAGE 1: Model Validation136 → Carrega model_artifact_path137 → Avalia em hold-out set138 → Compara com performance_baseline139 → GATE: métricas >= baseline (bloqueia se não)140141STAGE 2: Containerization142 → Gera Dockerfile otimizado por model_framework143 → Build e push da imagem para registry144 → Escaneia imagem por CVEs (via security-gate-injector)145 → Output: container_image_tag146147STAGE 3: Deployment148 → Gera manifest (Kubernetes Deployment + Service, ou serverless config)149 → Deploy com health check e readiness probe150 → Output: serving_endpoint151 → GATE: endpoint healthy após deploy152153STAGE 4: Drift Monitoring Setup154 → Configura coleta de distribuição de features em produção155 → Define alertas para PSI/KL-divergence > drift_threshold156 → Output: monitoring_config com dashboards157158STAGE 5: A/B Test Configuration [se há versão anterior]159 → Configura traffic split entre champion e challenger160 → Define métricas de comparação e sample size161 → Output: ab_test_config162 → GATE: resultado estatisticamente significativo antes de promover163```164165## Framework → Serving Stack Map166167| model_framework | Serving Stack | Container Base |168|----------------|--------------|----------------|169| sklearn | FastAPI + joblib | python:3.11-slim |170| pytorch | TorchServe / FastAPI | pytorch/torchserve |171| tensorflow | TF Serving | tensorflow/serving |172| huggingface | HuggingFace Inference | huggingface/transformers-pytorch-gpu |173| onnx | ONNX Runtime Server | mcr.microsoft.com/onnxruntime |174175## Diff History176- **v00.36.0**: Criado via OPP-Phase4-super-skills — Gap-1 bridge: ai_ml_ml ↔ engineering_devops (MLOps)