MCP HubMCP Hub
스킬 목록으로 돌아가기

register-ml-model

pjt222
업데이트됨 2 days ago
7 조회
17
2
17
GitHub에서 보기
개발aiautomationdata

정보

이 스킬은 MLflow 모델 레지스트리에 훈련된 모델을 완전한 버전 관리와 스테이지 관리(스테이징, 프로덕션, 보관) 기능과 함께 등록합니다. 거버넌스를 위한 승인 워크플로우를 구현하며, 배포 추적과 감사를 위한 포괄적인 메타데이터로 모델 계보를 관리합니다. 실험 단계에서 프로덕션으로 모델을 승격할 때, 여러 버전을 관리할 때, 또는 규정 준수를 위해 롤백할 때 사용하세요.

빠른 설치

Claude Code

추천
기본
npx skills add pjt222/agent-almanac -a claude-code
플러그인 명령대체
/plugin add https://github.com/pjt222/agent-almanac
Git 클론대체
git clone https://github.com/pjt222/agent-almanac.git ~/.claude/skills/register-ml-model

Claude Code에서 이 명령을 복사하여 붙여넣어 스킬을 설치하세요

문서

MLモデルの登録

See Extended Examples for complete configuration files and templates.

Implement MLflow Model Registry for systematic model versioning, stage management, and deployment governance.

使用タイミング

  • Promoting a trained model from experimentation to production
  • Managing multiple model versions across development stages
  • Implementing model approval workflows for governance
  • Tracking model lineage from training to deployment
  • Rolling back to previous model versions
  • Comparing deployed model versions for A/B testing
  • Auditing model changes for compliance requirements

入力

  • 必須: MLflow tracking server with Model Registry enabled
  • 必須: Trained model logged with MLflow (from tracking runs)
  • 必須: Model name for registry registration
  • 任意: Approval workflow integration (email, Slack, Jira)
  • 任意: CI/CD pipeline for automated promotion
  • 任意: Model validation metrics thresholds

手順

ステップ1: Configure Model Registry Backend

Set up MLflow Model Registry with database backend (file-based registry not recommended for production).

# Start MLflow server with Model Registry support
mlflow server \
  --backend-store-uri postgresql://user:pass@localhost:5432/mlflow \
  --default-artifact-root s3://mlflow-artifacts/models \
  --host 0.0.0.0 \
  --port 5000

Python configuration:

# model_registry_config.py
import mlflow
from mlflow.tracking import MlflowClient

# Set tracking URI (must support Model Registry)
MLFLOW_TRACKING_URI = "http://mlflow-server.company.com:5000"
mlflow.set_tracking_uri(MLFLOW_TRACKING_URI)

# ... (see EXAMPLES.md for complete implementation)

期待結果: Model Registry UI tab appears in MLflow, search_registered_models() returns successfully (even if empty), database contains registered_models table.

失敗時: Verify MLflow version ≥1.2 (Model Registry introduced in 1.2), check database backend (SQLite not fully supported for Model Registry), ensure --backend-store-uri points to database (not file://), verify database user has CREATE TABLE permissions, check MLflow server logs for migration errors.

ステップ2: Register Model from Training Run

Register a logged model to the Model Registry with comprehensive metadata.

# register_model.py
import mlflow
from mlflow.tracking import MlflowClient
from model_registry_config import MLFLOW_TRACKING_URI

mlflow.set_tracking_uri(MLFLOW_TRACKING_URI)
client = MlflowClient()

# ... (see EXAMPLES.md for complete implementation)

期待結果: New model version appears in Model Registry UI, version includes description and tags, model artifacts are accessible via models:/<model-name>/<version> URI, model signature and input example are preserved.

失敗時: Verify run_id exists and has completed (client.get_run(run_id)), check model artifact path matches logged artifact (mlflow.search_runs() to inspect), ensure model was logged with proper framework flavor (mlflow.sklearn.log_model not mlflow.log_artifact), verify no special characters in model name (use hyphens not underscores), check artifact storage accessibility.

Step 3: Implement Stage Transitions with バリデーション

Move model versions through stages (None → Staging → Production → Archived) with validation checks.

# stage_management.py
import mlflow
from mlflow.tracking import MlflowClient
from datetime import datetime

client = MlflowClient()

class ModelStageManager:
# ... (see EXAMPLES.md for complete implementation)

期待結果: Model version stage updates in registry, old versions archived automatically, transition timestamps recorded in tags, rollback restores previous production version.

失敗時: Check version exists and is in expected stage, verify archive_existing_versions flag behavior (may not archive if only one version), ensure database supports concurrent transactions for stage updates, check for stage transition locks (only one transition per version at a time), verify approval workflow integration.

ステップ4: Implement Model Aliasing and References

Use model aliases for stable deployment references (MLflow ≥2.0).

# model_aliases.py
from mlflow.tracking import MlflowClient

client = MlflowClient()

def set_model_alias(model_name, version, alias):
    """
    Set an alias for a model version (MLflow 2.0+).
# ... (see EXAMPLES.md for complete implementation)

期待結果: Aliases appear in Model Registry UI, loading models by alias works (models:/name@alias), updating alias immediately affects new loads, A/B test infrastructure functional.

失敗時: Upgrade MLflow to ≥2.0 for native alias support, use tag-based fallback for older versions, verify alias naming (alphanumeric and hyphens only), check for alias conflicts (one alias per model version).

ステップ5: Implement Model Lineage Tracking

Track full lineage from data to deployment with comprehensive metadata.

# model_lineage.py
import mlflow
from mlflow.tracking import MlflowClient
import json

client = MlflowClient()

def enrich_model_metadata(model_name, version, lineage_data):
# ... (see EXAMPLES.md for complete implementation)

期待結果: Model version tags include comprehensive lineage information, get_model_lineage() returns full history, JSON report contains data source, training details, and deployment info.

失敗時: Verify tag values are strings (convert dicts to JSON), check tag key naming (no spaces or special chars), ensure lineage data captured during training, verify run_id is valid and accessible.

ステップ6: Automate Registry Operations with CI/CD

Integrate model registration into CI/CD pipelines for automated promotion.

# .github/workflows/model_promotion.yml
name: Model Promotion Pipeline

on:
  workflow_dispatch:
    inputs:
      model_name:
        description: 'Model name to promote'
# ... (see EXAMPLES.md for complete implementation)

Python automation script:

# scripts/promote_model.py
import argparse
from stage_management import ModelStageManager

def main():
    parser = argparse.ArgumentParser()
    parser.add_argument("--model-name", required=True)
    parser.add_argument("--version", type=int, required=True)
# ... (see EXAMPLES.md for complete implementation)

期待結果: GitHub Actions workflow triggers on manual dispatch, validation tests pass, model promoted to target stage, Slack notification sent, deployment pipeline triggered automatically.

失敗時: Check GitHub secrets configuration for MLFLOW_TRACKING_URI, verify network access from GitHub Actions to MLflow server (may need VPN or IP allowlist), ensure validation script has correct metric thresholds, check Slack webhook configuration, verify Python script executable permissions.

バリデーション

  • Model Registry accessible and backend configured
  • Models register successfully from training runs
  • Stage transitions work (None → Staging → Production → Archived)
  • Validation checks enforce quality thresholds
  • Model aliases set and resolved correctly
  • Lineage metadata captured comprehensively
  • Rollback functionality restores previous versions
  • CI/CD pipeline automates promotions
  • Team notifications working for stage changes
  • Model URIs resolve correctly in all stages

よくある落とし穴

  • SQLite limitations: Model Registry requires database backend (PostgreSQL/MySQL) for production - file-based registry causes concurrency issues
  • Stage conflicts: Multiple versions in same stage cause confusion - use archive_existing_versions=True to auto-archive
  • Missing run linkage: Registering models without run_id loses lineage - always register from MLflow runs, not raw files
  • Alias confusion: Using stages as deployment targets instead of aliases - stages are for workflow, aliases for deployment references
  • Validation skipped: Promoting to Production without checks - implement mandatory validation in CI/CD pipeline
  • No rollback plan: Production issues without rollback capability - maintain previous Production version in Archived stage
  • Tag overload: Too many unstructured tags - standardize tag schema and naming conventions
  • Manual processes: Human-driven promotions are error-prone and slow - automate with CI/CD and approval workflows
  • Lost artifacts: Model registered but artifacts deleted from storage - ensure artifact retention policies align with model lifecycle

関連スキル

  • track-ml-experiments - Log models to MLflow before registering them
  • deploy-ml-model-serving - Deploy registered models to serving infrastructure
  • run-ab-test-models - A/B test models using registry aliases
  • orchestrate-ml-pipeline - Automate model training and registration
  • version-ml-data - Version training data for model lineage

GitHub 저장소

pjt222/agent-almanac
경로: i18n/ja/skills/register-ml-model
0
agentsagentskillsai-assisted-developmentclaude-codeskillsteams

연관 스킬

qmd

개발

qmd는 BM25, 벡터 임베딩, 재순위화를 결합한 하이브리드 검색을 통해 로컬 파일을 색인화하고 검색할 수 있는 로컬 검색 및 색인화 CLI 도구입니다. 명령줄 사용과 Claude 통합을 위한 MCP(Model Context Protocol) 모드를 모두 지원합니다. 이 도구는 임베딩에 Ollama를 사용하고 색인을 로컬에 저장하여 터미널에서 직접 문서나 코드베이스를 검색하는 데 이상적입니다.

스킬 보기

subagent-driven-development

개발

이 스킬은 각 독립적인 작업마다 새로운 하위 에이전트를 배치하고 작업 사이에 코드 리뷰를 진행하여 구현 계획을 실행합니다. 이 리뷰 프로세스를 통해 품질 게이트를 유지하면서 빠른 반복 작업을 가능하게 합니다. 동일한 세션 내에서 대부분 독립적인 작업을 진행할 때 내장된 품질 검증과 함께 지속적인 진행을 보장하기 위해 사용하세요.

스킬 보기

mcporter

개발

mcporter 스킬은 개발자가 Claude에서 직접 Model Context Protocol(MCP) 서버를 관리하고 호출할 수 있도록 합니다. 이 스킬은 사용 가능한 서버를 나열하고, 인수를 사용해 해당 서버의 도구를 호출하며, 인증 및 데몬 생명주기를 처리하는 명령어를 제공합니다. 개발 워크플로우에서 MCP 서버 기능을 통합하고 테스트할 때 이 스킬을 사용하세요.

스킬 보기

adk-deployment-specialist

개발

이 스킬은 A2A 프로토콜을 사용하여 Vertex AI ADK 에이전트를 배포하고 오케스트레이션하며, AgentCard 검색, 작업 제출, 코드 실행 샌드박스 및 메모리 뱅크와 같은 지원 도구를 관리합니다. Python, Java 또는 Go 언어로 순차, 병렬 또는 루프 오케스트레이션 패턴을 갖춘 다중 에이전트 시스템 구축을 가능하게 합니다. Google Cloud에서 ADK 에이전트 배포 또는 에이전트 워크플로우 오케스트레이션을 요청받았을 때 사용하세요.

스킬 보기