.claude/skills/ai-ml-development/mlops-pipeline/SKILL.md
MLOps Pipeline
npx skillsauth add ViggyV/claude-skills mlops-pipelineInstall 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.
You are an expert at building production ML pipelines with proper MLOps practices.
This skill activates when the user needs help with:
Ask about:
┌─────────────────────────────────────────────────────────────────┐
│ MLOPS PIPELINE │
├─────────────────────────────────────────────────────────────────┤
│ │
│ DATA TRAINING DEPLOYMENT MONITORING │
│ ┌─────┐ ┌─────┐ ┌─────┐ ┌─────┐ │
│ │Data │───────▶│Train│─────────▶│Deploy│────────▶│Monitor│ │
│ │Prep │ │Model│ │Model │ │Perf │ │
│ └──┬──┘ └──┬──┘ └──┬──┘ └──┬──┘ │
│ │ │ │ │ │
│ ┌──▼──┐ ┌──▼──┐ ┌──▼──┐ ┌──▼──┐ │
│ │Valid│ │Eval │ │A/B │ │Alert│ │
│ │ ate │ │uate │ │Test │ │ │ │
│ └──┬──┘ └──┬──┘ └──┬──┘ └──┬──┘ │
│ │ │ │ │ │
│ ┌──▼──┐ ┌──▼──┐ ┌──▼──┐ ┌──▼──┐ │
│ │Store│ │Regis│ │Scale│ │Retrain│ │
│ │ │ │ter │ │ │ │Trigger│ │
│ └─────┘ └─────┘ └─────┘ └─────┘ │
│ │
└─────────────────────────────────────────────────────────────────┘
import mlflow
from mlflow.tracking import MlflowClient
# Setup
mlflow.set_tracking_uri("http://localhost:5000")
mlflow.set_experiment("my-experiment")
# Training with tracking
with mlflow.start_run(run_name="experiment-v1"):
# Log parameters
mlflow.log_params({
"learning_rate": 0.001,
"batch_size": 32,
"epochs": 10
})
# Train model
model = train_model(...)
# Log metrics
mlflow.log_metrics({
"accuracy": 0.95,
"f1_score": 0.93,
"loss": 0.05
})
# Log model
mlflow.sklearn.log_model(model, "model")
# Log artifacts
mlflow.log_artifact("confusion_matrix.png")
# Model registry
client = MlflowClient()
client.create_registered_model("production-model")
client.create_model_version(
name="production-model",
source="runs:/abc123/model",
run_id="abc123"
)
Kubeflow Pipeline:
from kfp import dsl, compiler
@dsl.component
def preprocess_data(input_path: str) -> str:
# Preprocessing logic
return output_path
@dsl.component
def train_model(data_path: str, epochs: int) -> str:
# Training logic
return model_path
@dsl.component
def evaluate_model(model_path: str) -> float:
# Evaluation logic
return accuracy
@dsl.pipeline(name="ml-training-pipeline")
def training_pipeline(input_data: str, epochs: int = 10):
preprocess_task = preprocess_data(input_path=input_data)
train_task = train_model(
data_path=preprocess_task.output,
epochs=epochs
)
evaluate_task = evaluate_model(model_path=train_task.output)
compiler.Compiler().compile(training_pipeline, "pipeline.yaml")
FastAPI Serving:
from fastapi import FastAPI
import mlflow
app = FastAPI()
model = mlflow.pyfunc.load_model("models:/production-model/latest")
@app.post("/predict")
async def predict(features: dict):
prediction = model.predict([features])
return {"prediction": prediction.tolist()}
@app.get("/health")
async def health():
return {"status": "healthy", "model_version": "1.0"}
Docker Deployment:
FROM python:3.10-slim
WORKDIR /app
COPY requirements.txt .
RUN pip install -r requirements.txt
COPY model/ /app/model/
COPY serve.py /app/
EXPOSE 8080
CMD ["uvicorn", "serve:app", "--host", "0.0.0.0", "--port", "8080"]
from evidently import ColumnMapping
from evidently.report import Report
from evidently.metrics import DataDriftTable, DatasetDriftMetric
def detect_drift(reference_data, current_data):
report = Report(metrics=[
DatasetDriftMetric(),
DataDriftTable()
])
report.run(
reference_data=reference_data,
current_data=current_data
)
drift_detected = report.as_dict()['metrics'][0]['result']['dataset_drift']
return drift_detected, report
Provide:
data-ai
Use this skill for reinforcement learning tasks including training RL agents (PPO, SAC, DQN, TD3, DDPG, A2C, etc.), creating custom Gym environments, implementing callbacks for monitoring and control,
testing
You are an expert at optimizing SQL queries for performance and efficiency.
tools
Knowledge and utilities for creating animated GIFs optimized for Slack. Provides constraints, validation tools, and animation concepts. Use when users request animated GIFs for Slack like "make me a G
tools
21 production-ready scripts for iOS app testing, building, and automation. Provides semantic UI navigation, build automation, accessibility testing, and simulator lifecycle management. Optimized for A