Mlops And Deploymentのロゴ

Mlops And Deployment

コミュニティ
Tibsfox
mlops-and-deployment

MLOps and the production ML lifecycle -- model packaging and serving, CI/CD for ML, experiment tracking, model registries, reproducibility, production monitoring for data and concept drift, retraining pipelines, A/B and shadow deployment, and rollback. Covers batch vs online/real-time inference, REST endpoints, feature stores, data and version pinning, deterministic pipelines, performance-decay detection, and retraining triggers. Use when deploying models to production, serving predictions, monitoring for data or concept drift, setting up ML CI/CD, tracking experiments, managing a model registry, or planning retraining, shadow rollout, and rollback.

概要

公開者Tibsfox
リポジトリgsd-skill-creator
スキル名mlops-and-deployment
スター
70
フォーク
9
同梱ファイル
指示のみ
リンク
  • Markdown形式の指示

    モデルが必要に応じて読み込むSKILL.mdファイルです。関連するリクエストがあったときだけトークンを消費します。

  • どのLLMでも利用可能

    AIスキルはプロバイダー固有のコードではなく、通常のMarkdownなので、GPT、Claude、Gemini、Grok、ローカルモデルで利用できます。

  • 指示だけで完結

    モデルに必要なものはすべて指示に含まれているため、別途同期するファイルはありません。

  • オープンソース

    TibsfoxがGitHubで公開しています。インストールする前にソースを確認してください。

インストール

AIスキル「Mlops And Deployment」をTypingMindにインストールすれば、どのLLMでも利用できます。SKILL.mdを読み取れる別のAIエージェントに追加することもできます。

1

TypingMindにインストール

TypingMindはGitHubフォルダから直接スキルをインストールします。SKILL.mdを読み取り、リソースファイルをまとめてローカルに保存します。

  1. アプリを開き、「プラグイン」→「スキル」に移動します。
  2. 「GitHubからインストール」を選択します。
  3. 以下のスキルフォルダのURLを貼り付けて確定します。
    https://github.com/Tibsfox/gsd-skill-creator/tree/main/examples/skills/data-science/mlops-and-deployment
  4. スキルを利用したいチャットごとに、そのスキルを有効にしてください。
「プラグイン」→「スキル」→「スキルを追加」→「GitHubのURLから」を選択し、フォルダのURLを貼り付けて「続行」を押します。
2

別のAIエージェントにインストール

Agent Skills形式を読み取れるAIエージェントなら、このスキルを利用できます。フォルダをそのAIエージェントのスキルディレクトリにコピーしてください。

Claude Code — .claude/skills
git clone --depth 1 https://github.com/Tibsfox/gsd-skill-creator.git /tmp/gsd-skill-creator
mkdir -p .claude/skills
cp -r /tmp/gsd-skill-creator/examples/skills/data-science/mlops-and-deployment .claude/skills/mlops-and-deployment
コピー後、新しいスキルを読み込むためにClaude Codeを再起動してください。

TypingMindで使用

TypingMindのチャットでMlops And Deploymentを有効にするだけで、あとはモデルが対応します。名前と説明がシステムプロンプトに含まれ、関連するリクエストがあると、モデルが指示の全文を自動で読み込みます。手動で呼び出す必要はなく、実際に使用されるまでトークンを消費しません。

関連するリクエストがあるとすぐに、モデルが自動的にMlops And Deploymentを読み込みます。

どのAIモデルでも利用可能

AIスキルはプロバイダー固有のコードではなく、通常のMarkdownで書かれた指示です。そのため、Mlops And Deploymentは作成時に想定されたモデルに縛られません。TypingMindに一度インストールすれば、ご自身のAPIキーを使って、GPT-5、Claude、Gemini、Grok、DeepSeek、Mistral、Llama、またはご自身で実行するローカルモデルで利用できます。

  • 必要なときだけ読み込み

    システムプロンプトには名前と説明だけが含まれます。関連するリクエストが初めてあったときに指示を取得するため、スキルを使わない間は指示の読み込みにトークンを消費しません。

  • チャットの途中でモデルを切り替え

    スキルはコードではなく指示なので、モデルを切り替えてもそのまま使えます。次のモデルも同じSKILL.mdを読み込みます。

スキルの指示

モデルが読み込むSKILL.mdの内容です。スキルはモデルが従う指示なので、インストールする前に確認してください。

MLOps and Deployment

Machine learning foundations end where a trained, validated model sits on disk. MLOps begins there. It is the operational discipline of taking that model into production and keeping it reliable: packaging and serving it, versioning everything that produced it, automating the path from commit to deployment, watching it degrade against a shifting world, and closing the loop with retraining. A model that scores 0.94 on a held-out test set is a scientific result; a model that still scores 0.94 on live traffic six months later is an engineering achievement. This skill covers the second thing.

Agent affinity: breiman (model packaging, serving strategy, evaluation gates), nightingale (pipeline routing, deployment orchestration, monitoring synthesis)

Concept IDs: data-science-drift-detection, data-hypothesis-testing, data-data-quality, data-sampling-methods

The Production ML Lifecycle

Where the ML workflow stops at "deploy," MLOps treats deployment as the midpoint of a loop, not the finish line.

StageGoalKey operations
1. PackageFreeze the trained model into a portable artifactSerialize weights + preprocessing; pin dependencies; containerize
2. RegisterRecord the artifact as a governed, versioned assetModel registry entry with lineage, metrics, stage (staging/prod)
3. ServeExpose predictions to consumersBatch job or online endpoint; feature retrieval; latency/throughput SLOs
4. ReleaseMove new versions into traffic safelyShadow, canary, A/B; gated promotion; rollback plan ready
5. MonitorDetect degradation before users doOperational metrics + data drift + concept drift + performance decay
6. TriggerDecide when the model must changeScheduled, drift-based, or performance-based retraining triggers
7. RetrainProduce the next candidateRe-run the reproducible pipeline on fresh data; re-enter at stage 1

The distinguishing property of ML systems is that the code is not the only thing that changes -- the data changes underneath a static model. This is why MLOps is not "DevOps for models": you version and monitor data and models as first-class artifacts, not just source.

Model Packaging and Serving

The Artifact Boundary

A deployable model is more than its weights. Package the entire inference function:

  • Model weights / parameters (the serialized estimator, e.g. joblib, ONNX, SavedModel, TorchScript).
  • Preprocessing -- the exact fitted transformers (scalers, encoders, vocabularies). A model shipped without its scaler is a silent failure waiting to happen.
  • A signature -- input schema (names, dtypes, shapes) and output schema, so consumers and monitors can validate.
  • Environment -- pinned dependency versions, ideally a container image, so the runtime matches training.

Prefer an interchange format (ONNX, PMML) or a container over pickling a raw Python object: pickled objects are brittle across library versions and are a code-execution risk if the source is untrusted.

Serving Patterns

PatternLatencyHow predictions are producedUse when
Batch (offline)Hours/daysScore a whole dataset on a schedule; write results to a tableRecommendations, churn scores, risk lists -- consumers read precomputed output
Online / real-time (synchronous)msA request hits a REST/gRPC endpoint and blocks for the predictionFraud checks, search ranking, anything in a user request path
Streaming (async)sub-second to secondsScore events off a queue/stream, emit to a downstream topicEvent-driven pipelines, near-real-time enrichment
Edge / embeddedms, offlineModel runs on device (mobile, IoT)No connectivity, privacy, or hard latency constraints

Batch is cheaper and simpler; reach for online serving only when a fresh prediction must exist at request time for an input you could not have precomputed.

Online Endpoints (REST)

An online model is a service. Design it like one:

  • Contract: stable request/response schema; validate inputs against the model signature and reject malformed payloads (a 4xx beats a garbage prediction).
  • Health and readiness: liveness for the process, readiness that confirms the model artifact loaded.
  • Latency budget: the model is one hop; feature lookups, network, and serialization all count. Measure p99, not the mean.
  • Scaling: stateless replicas behind a load balancer; autoscale on throughput. Warm the model at startup so the first request is not a cold-start outlier.
  • Batching: micro-batch concurrent requests for throughput on GPU-bound models, trading a little latency.

Feature Stores

The hardest online-serving bug is training/serving skew: the features computed offline for training differ subtly from those computed online at inference. A feature store solves this by computing each feature once and serving it to both paths.

  • Offline store (columnar warehouse) provides point-in-time-correct features for training -- crucially, the feature as it was known at label time, never leaking the future.
  • Online store (low-latency key-value) serves the same feature definitions at inference in milliseconds.
  • Shared definitions guarantee the same transformation logic feeds training and serving, eliminating skew and enabling feature reuse across models.

Reproducibility

If you cannot rebuild a model bit-for-bit from recorded inputs, you cannot debug it, audit it, or trust its retraining.

Version and Pin Everything

WhatHowWhy
CodeGit commit SHAThe transformation and training logic
DataDataset version / snapshot hash (DVC, lakeFS, immutable partitions)Data is the second half of the model; "latest" is not reproducible
Config / hyperparametersChecked-in config, logged per runThe knobs that produced this artifact
EnvironmentPinned lockfile + container image digestLibrary versions change numeric results
ModelRegistry version + hashThe output, linked back to all of the above

A model artifact should carry lineage: given a version, you can name the exact code SHA, data version, and config that produced it.

Deterministic Pipelines

  • Seed every stochastic step (splits, initialization, shuffling, augmentation) and record the seed.
  • Beware nondeterminism you do not control -- unordered parallel reductions, GPU kernel nondeterminism, dict/set ordering. Pin what you can; document what you cannot.
  • Make the pipeline idempotent: re-running a stage on the same inputs yields the same outputs, so partial failures re-run safely.

Experiment Tracking and Model Registries

Experiment Tracking

During development you will train hundreds of candidates. Track each run's parameters, metrics, code version, data version, and artifacts (MLflow, Weights & Biases, or equivalent) so you can compare runs, reproduce the winner, and answer "why did we ship this one?" months later. An untracked experiment is a result you cannot defend.

Model Registry

The registry is the governed inventory of models that are candidates for or are in production. It provides:

  • Versioning -- immutable, numbered model versions with their metrics and lineage.
  • Stage transitions -- None -> Staging -> Production -> Archived, with an explicit, often gated, promotion step.
  • A single source of truth -- serving infrastructure pulls "the Production version of model X," decoupling deployment from any one training run.
  • Governance -- who promoted what, when, and against which evaluation. This is the audit trail regulators and incident reviews ask for.

CI/CD for ML

Classic CI/CD ships code. ML adds two more moving parts -- data and models -- so the discipline extends to CI/CD/CT (continuous training).

  • Continuous Integration extends beyond unit tests to data validation (schema, ranges, distributions) and model validation (does the retrained candidate beat the current production model on a frozen evaluation set and on fairness/slice metrics?).
  • Continuous Delivery deploys not just a service but a training pipeline; the deliverable is a repeatable pipeline that can produce a model, not only the model.
  • Continuous Training automatically retrains and re-validates when triggered (see Retraining Triggers), producing a new registry candidate.

Gate promotion on evaluation, never on "it trained." A candidate must clear: no regression on the reference test set, acceptable performance on protected slices, and passing data-validation checks. Only then does it become eligible for release. Test the pipeline, not just the model -- most production failures are plumbing (a schema change, a null feature), not modeling.

Monitoring in Production

A deployed model degrades silently: it keeps returning confident predictions while the world drifts away from its training distribution. Monitor three layers.

1. Operational health (it is a service): latency, throughput, error rate, saturation. Necessary but not sufficient -- a model can be perfectly healthy operationally while making increasingly wrong predictions.

2. Data and model quality:

SignalWhat it meansHow to detectLatency to detect
Data drift (covariate shift)P(X) changes -- inputs no longer look like training dataCompare live feature distributions to a training baseline (PSI, KL divergence, KS test, Chi-square)Immediate -- needs only inputs
Concept driftP(y | X) changes -- the input/output relationship itself shiftsTrack prediction quality once labels arrive; monitor prediction distribution as an early proxyDelayed -- needs ground-truth labels
Label / prediction driftP(y-hat) shiftsCompare the output distribution to the training-time label distributionImmediate -- an early warning before labels land
Performance decayAccuracy/AUC/RMSE fall over timeRecompute metrics on labeled production data by time windowAs fast as labels arrive
Data quality breakNulls, new categories, out-of-range, schema changeAssertions/validation at the serving boundaryImmediate

Distinguish drift types because the fix differs: data drift may only need recalibration or retraining on recent data; concept drift means the learned relationship is stale and the model must relearn. Concept drift can be sudden (a policy change), gradual, incremental, or recurring (seasonality) -- and each calls for a different retraining cadence.

3. The label-latency problem: ground truth often arrives late (a loan default surfaces months later) or never. When you cannot measure accuracy in real time, use proxy signals -- input drift, prediction drift, and business KPIs -- as leading indicators, and reserve delayed labels for confirmation.

Retraining Triggers and Pipelines

Retraining is the loop that keeps a model current. Choose a trigger policy:

TriggerMechanismBest for
ScheduledRetrain on a fixed cadence (nightly/weekly)Steady, predictable drift; simplest to operate
Performance-basedRetrain when a monitored metric crosses a thresholdCostly retraining; you retrain only when quality demands it
Drift-basedRetrain when input/prediction drift exceeds a boundFast-moving inputs where labels lag
Data-volume-basedRetrain when N new labeled examples accumulateCold-start growth; label-scarce domains

A retraining pipeline is the same reproducible pipeline used originally, re-run on fresh data: assemble and validate new data, retrain, evaluate the candidate against the current production model on a frozen set, and -- only if it wins and passes checks -- register it and hand it to the release stage. Automate the candidate; keep a human (or a hard gate) on promotion. Guard against feedback loops: when a model's own predictions influence the data it later trains on (a ranker teaches users what to click), naive retraining amplifies its own biases. Log the decisions the model influenced so you can correct for them.

Progressive Deployment and Rollback

Never flip 100% of traffic to a new model version at once. Release progressively so a bad model is contained.

StrategyHow it worksWhat it answers
Shadow (dark launch)New model scores live traffic in parallel; its output is logged, not served"Does it behave sanely on real inputs?" -- zero user risk
CanaryRoute a small % of traffic to the new version, watch metrics, ramp up"Is it safe to widen?"
A/B testSplit traffic between versions and compare a business metric with statistical rigor"Is the new model actually better for users?"
Blue-greenStand up the new version alongside the old, switch over, keep old warmInstant cutover with an instant fallback

Shadow answers correctness, A/B answers value. Shadow deployment catches operational and sanity failures before any user is affected; A/B testing measures whether the offline metric gain translates to a real outcome (offline AUC gains routinely fail to move the business metric).

Rollback is the non-negotiable safety net. Because the previous model is an immutable, registered artifact, rollback is a version pointer change, not a rebuild: repoint the serving layer at the last-known-good Production version. Keep the prior version deployable and warm; define, in advance, the metric thresholds that trigger an automatic rollback. A deployment strategy without a tested rollback path is not a deployment strategy.

Common Mistakes

MistakeWhy it failsFix
Shipping the model without its preprocessingServing computes features differently than trainingPackage the fitted transformers with the model; or use a feature store
Training/serving skewOffline and online feature logic divergeSingle feature definition serving both paths; monitor feature parity
Monitoring only latency/errorsThe model degrades silently while "healthy"Add data-drift, prediction-drift, and performance monitors
Assuming labels arrive quicklyPerformance can't be measured for weeks/monthsUse drift and prediction proxies as leading indicators
"Latest" data, no versioningThe model is irreproducible; you can't audit or debugPin data version + code SHA + config in the model's lineage
Promoting on "it trained"Regressions and fairness violations slip to prodGate promotion on evaluation vs the current production model
Big-bang 100% deployA bad version hits every user at onceShadow, then canary/A-B, with a tested rollback
Ignoring feedback loopsThe model trains on data it shaped, amplifying biasLog influenced decisions; hold out control traffic

Cross-References

  • breiman agent: Model selection and evaluation -- the quality gate a retrained candidate must clear before promotion.
  • nightingale agent: Department routing and synthesis -- orchestrating the deploy/monitor/retrain loop across specialists.
  • machine-learning-foundations skill: The training-side counterpart; produces the validated model this skill takes to production. Its final workflow stage ("deployment") is this skill's entire subject.
  • experimental-design-ds skill: The statistical backbone of A/B tests and shadow evaluations -- randomization, sample size, and causal reading of a rollout.
  • ethics-governance skill: Fairness monitoring, model cards, and the accountability trail that model registries and gated promotion make enforceable.
  • data-wrangling skill: The reproducible transformation chain that feature stores and retraining pipelines depend on.

References

  • Sculley, D., et al. (2015). "Hidden Technical Debt in Machine Learning Systems." Advances in Neural Information Processing Systems (NeurIPS), 28.
  • Breck, E., Cai, S., Nielsen, E., Salib, M., & Sculley, D. (2017). "The ML Test Score: A Rubric for ML Production Readiness and Technical Debt Reduction." IEEE International Conference on Big Data, 1123-1132.
  • Huyen, C. (2022). Designing Machine Learning Systems. O'Reilly Media.
  • Gama, J., Zliobaite, I., Bifet, A., Pechenizkiy, M., & Bouchachia, A. (2014). "A Survey on Concept Drift Adaptation." ACM Computing Surveys, 46(4), 1-37.
  • Paleyes, A., Urma, R.-G., & Lawrence, N. D. (2022). "Challenges in Deploying Machine Learning: A Survey of Case Studies." ACM Computing Surveys, 55(6), 1-29.

よくある質問

AIスキル「Mlops And Deployment」では何ができますか?

MLOps and the production ML lifecycle -- model packaging and serving, CI/CD for ML, experiment tracking, model registries, reproducibility, production monitoring for data and concept drift, retraining pipelines, A/B and shadow deployment, and rollback. Covers batch vs online/real-time inference, REST endpoints, feature stores, data and version pinning, deterministic pipelines, performance-decay detection, and retraining triggers. Use when deploying models to production, serving predictions, monitoring for data or concept drift, setting up ML CI/CD, tracking experiments, managing a model reg...

TypingMindでMlops And Deploymentを使うメリットは何ですか?

一度インストールすれば、どのモデルでも使えるからです。Mlops And Deploymentはプロバイダー固有のコードではなく、通常のMarkdownで記述されているため、同じスキルをGPT-5、Claude、Gemini、Grok、ローカルモデルで利用できます。チャットの途中でモデルを切り替えても、そのまま使い続けられます。TypingMindは自分のAPIキーで動作するため、シート単位のサブスクリプションではなく、プロバイダーに直接料金を支払います。スキルとチャットは自分のストレージに保持されます。

TypingMindにMlops And Deploymentをインストールするにはどうすればよいですか?

TypingMindで「プラグイン」→「スキル」→「GitHubからインストール」を開き、https://github.com/Tibsfox/gsd-skill-creator/tree/main/examples/skills/data-science/mlops-and-deploymentを貼り付けてください。TypingMindがSKILL.mdを読み込み、チャットごとに有効にできるスキルとしてインストールします。

Mlops And Deploymentを使えるAIモデルはどれですか?

TypingMindに接続したどのモデルでも利用できます。AIスキルはプロバイダー固有のコードではなく、通常のMarkdownで書かれた指示です。そのため、GPT、Claude、Gemini、Grok、ローカルモデルのいずれも、リクエストの内容がこのスキルの用途に合ったときに、このスキルを読み込めます。

Mlops And Deploymentで使えるAIモデルの数に制限はありますか?

数に制限はありません。スキルに対応したモデルであれば、GPT、Claude、Gemini、Grok、DeepSeek、Mistral、Llamaなど、どのモデルでもMlops And Deploymentを利用できます。すべてTypingMind上で、自分のAPIキーを使って利用できます。

AIスキル「Mlops And Deployment」は無料ですか?

TibsfoxがGitHubで公開しています。ライセンス条件はリポジトリでご確認ください。ご利用のAIプロバイダーに支払うのは、使用したトークンの料金だけです。

AIスキルとは何ですか?

AIスキルは、特定のタスクの実行方法をAIモデルに教える、再利用可能な指示のセットです。オープンなAgent Skills形式に従い、名前と説明を含むSKILL.mdファイルに加え、モデルが必要とするスクリプト、テンプレート、参照ファイルで構成されます。モデルはリクエストがスキルに合致したときだけ指示を読み込むため、インストール済みのスキルも、使うまでは費用がかかりません。

AIスキルは、プラグインやMCPサーバーとどう違いますか?

プラグインやMCPサーバーは、モデルが呼び出せる新しいツールを提供します。ツールとは、どこかで実行され、結果を返すコードです。一方、AIスキルは、タスクへの取り組み方、従うべき手順、望ましい出力の例といった知識や進め方をモデルに伝えます。スキルは通常のMarkdownで記述されているため、サーバー、APIキー、実行環境は不要で、どのモデルでも利用できます。

すべて見る

今すぐ自分専用のAIワークスペースを作成

ニュースレターに登録すると、新機能や今後のプレゼント企画のお知らせが届きます👇