register-ml-model
Acerca de
Esta habilidad registra modelos entrenados en el Registro de Modelos de MLflow con control de versiones y gestiona las transiciones de etapa (Pruebas, Producción, Archivado) mediante flujos de trabajo de aprobación. Maneja el linaje del modelo, el seguimiento de metadatos y el historial de despliegue para gobernanza y cumplimiento. Úsela al promover modelos a producción, gestionar múltiples versiones o auditar cambios en los modelos.
Instalación rápida
Claude Code
Recomendadonpx skills add pjt222/agent-almanac -a claude-code/plugin add https://github.com/pjt222/agent-almanacgit clone https://github.com/pjt222/agent-almanac.git ~/.claude/skills/register-ml-modelCopia y pega este comando en Claude Code para instalar esta habilidad
Documentación
註 ML 模
於 MLflow Model Registry 註已訓之模附版控、行階轉(Staging、Production、Archived)附審流、管模系附詳屬與部署之追。
See Extended Examples for complete configuration files and templates.
施 MLflow Model Registry 以系統行模之版、階管、部署治。
用時
- 升已訓之模自試至產乃用
- 管多模版於諸發階乃用
- 為治施模之審流乃用
- 追模系自訓至部署乃用
- 退至前模版乃用
- 較部署之模版以行 A/B 試乃用
- 為合規審模之變乃用
入
- 必要:MLflow tracking 服附 Model Registry 啟
- 必要:以 MLflow 錄之已訓之模(自 tracking 之行)
- 必要:模名以註於庫
- 可選:審流之集成(郵、Slack、Jira)
- 可選:自動升之 CI/CD 線
- 可選:模驗指之閾
法
第一步:設模庫之後端
立 MLflow Model Registry 附庫後端(產不宜檔基庫)。
# 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 配置:
# 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 之頁現於 MLflow,search_registered_models() 順返(雖空),庫含 registered_models 表。
敗則:驗 MLflow 版 ≥1.2(Model Registry 始於 1.2),察庫後端(SQLite 不全持 Model Registry),確 --backend-store-uri 指庫(非 file://),驗庫之用戶有 CREATE TABLE 之權,察 MLflow 服日誌之遷誤。
第二步:自訓行註模
註已錄之模於 Model Registry 附詳屬。
# 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)
得:新模版現於 Model Registry 之 UI,版含述與標,模件可由 models:/<model-name>/<version> URI 取,模簽與入例已存。
敗則:驗 run_id 存且已畢(client.get_run(run_id)),察模件路合錄之件(mlflow.search_runs() 以察),確模以正之框錄(mlflow.sklearn.log_model 非 mlflow.log_artifact),驗模名無特字(用短橫非下橫),察件存可訪。
第三步:施階轉附驗
行模版過諸階(None → Staging → Production → Archived)附驗察。
# stage_management.py
import mlflow
from mlflow.tracking import MlflowClient
from datetime import datetime
client = MlflowClient()
class ModelStageManager:
# ... (see EXAMPLES.md for complete implementation)
得:模版之階更於庫,舊版自存檔,轉之時錄於標,退復前產之版。
敗則:察版存且於望階,驗 archive_existing_versions 旗之行(若僅一版或不檔),確庫持並發以更階,察階轉之鎖(一版一時一轉),驗審流之集成。
第四步:施模別名與引
用模別名以行穩之部署引(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)
得:別名現於 Model Registry 之 UI,由別名載模可(models:/name@alias),更別名立影新載,A/B 試之基設可行。
敗則:升 MLflow 至 ≥2.0 以原生持別名,老版退用標基,驗別名之命(獨字母數字與短橫),察別名之衝(一模版一別名)。
第五步:施模系之追
追自數據至部署之全系附詳屬。
# 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)
得:模版之標含詳系信,get_model_lineage() 返全史,JSON 報含數源、訓細、部署信。
敗則:驗標值為串(化字典為 JSON),察標鍵之命(無空或特字),確系資於訓時捕,驗 run_id 有效可訪。
第六步:以 CI/CD 自動庫之操
集模註於 CI/CD 線以自動升。
# .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 自動文:
# 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 流於手動發起,驗試過,模升至目階,Slack 報送,部署線自起。
敗則:察 GitHub secrets 之 MLFLOW_TRACKING_URI 配置,驗自 GitHub Actions 至 MLflow 服之網訪(或需 VPN 或 IP 許列),確驗本有正指閾,察 Slack webhook 配置,驗 Python 文之執權。
驗
- Model Registry 可訪且後端已設
- 模自訓行順註
- 階轉行(None → Staging → Production → Archived)
- 驗察行質之閾
- 模別名設且解正
- 系屬詳捕
- 退之能復前版
- CI/CD 線自動升
- 階變之團報行
- 模 URI 諸階皆解正
陷
- SQLite 之限:Model Registry 產用須庫後端(PostgreSQL/MySQL)——檔基致並發患
- 階衝:同階多版生惑——用
archive_existing_versions=True自檔 - 缺行繫:註模無 run_id 失系——必自 MLflow 行註,非自原檔
- 別名惑:用階為部署目而非別名——階為流,別名為部署引
- 驗略:升至產而無察——於 CI/CD 線施必驗
- 無退計:產患而無退能——存前產版於 Archived 階
- 標過載:過多無構之標——立標式與命之規
- 手流:人驅升易誤而緩——以 CI/CD 與審流自動之
- 失件:模註而件刪——確件留之策合模生命
參
track-ml-experiments— 註前先錄模於 MLflowdeploy-ml-model-serving— 部署已註之模至供基設run-ab-test-models— 用庫之別名行 A/B 模試orchestrate-ml-pipeline— 自動模訓與註version-ml-data— 版訓數據以資模系
Repositorio GitHub
Habilidades relacionadas
qmd
Desarrolloqmd es una herramienta CLI de búsqueda e indexación local que permite a los desarrolladores indexar y buscar en archivos locales mediante búsqueda híbrida que combina BM25, embeddings vectoriales y reranking. Es compatible tanto con uso desde la línea de comandos como con modo MCP (Model Context Protocol) para integración con Claude. La herramienta utiliza Ollama para los embeddings y almacena los índices localmente, lo que la hace ideal para buscar documentación o bases de código directamente desde la terminal.
subagent-driven-development
DesarrolloEsta habilidad ejecuta planes de implementación asignando un nuevo subagente para cada tarea independiente, con revisión de código entre tareas. Permite una iteración rápida mientras mantiene controles de calidad a través de este proceso de revisión. Úsala cuando trabajes en tareas mayormente independientes dentro de la misma sesión para garantizar un progreso continuo con verificaciones de calidad integradas.
mcporter
DesarrolloLa habilidad mcporter permite a los desarrolladores gestionar y llamar servidores del Protocolo de Contexto de Modelo (MCP) directamente desde Claude. Proporciona comandos para listar servidores disponibles, llamar a sus herramientas con argumentos, y manejar la autenticación y el ciclo de vida del daemon. Utiliza esta habilidad para integrar y probar la funcionalidad de servidores MCP en tu flujo de trabajo de desarrollo.
adk-deployment-specialist
DesarrolloEsta habilidad despliega y orquesta agentes Vertex AI ADK utilizando el protocolo A2A, gestionando el descubrimiento de AgentCard, el envío de tareas y soportando herramientas como el Sandbox de Ejecución de Código y el Banco de Memoria. Permite construir sistemas multiagente con patrones de orquestación secuencial, paralela o en bucle en Python, Java o Go. Úsela cuando se le solicite desplegar agentes ADK u orquestar flujos de trabajo de agentes en Google Cloud.
