aws-samples/sample-aiops-on-amazon-sagemakerai
GitHub: aws-samples/sample-aiops-on-amazon-sagemakerai
该仓库提供了一套在 Amazon SageMakerAI 上运维化 GenAI 与 ML 工作负载的示例和资源,涵盖 MLflow 集成、模型监控、LLM 质量观测及 Bedrock Agent 可观测性等 MLOps/GenAIOps 实践。
Stars: 12 | Forks: 20
## Amazon SageMakerAI 上的 AWS ModelOps
本仓库包含了一系列示例和资源,旨在帮助您在 SageMakerAI 上实现生成式 AI (GenAI) 和机器学习工作负载的运维化。
### 概述
AWS ModelOps 涵盖了涉及 SageMakerAI 资源(如 SageMaker 托管 MLflow、SageMaker pipelines)的 GenAIOps 和 MLOps 模式,并包含所有其他 AWS GenAI 相关功能(如 Amazon Bedrock)。本仓库提供了一组示例 notebook、脚本和配置,可帮助您探索 ModelOps 的不同方面。
### 仓库结构
```
.
├── workshops/ # Technical workshops
│ └── aiops-with-sagemaker-mlflow/ # ModelOps with SageMakerAI Managed MLflow
├── operations/ # Operational guides
│ └── sagemaker-mlflow-migration/ # MLflow data migration guide
├── monitoring/ # All monitoring and observability solutions
│ └── ...
├── examples/ # Integration examples
│ └── sagemaker-mlflow-agentcore-runtime/ # MLflow observability for Bedrock Agents
├── LICENSE # MIT-0 License
└── README.md # This file
```
### 研讨会
#### [基于 SageMakerAI 托管 MLflow 的 ModelOps](./workshops/aiops-with-sagemaker-mlflow/)
- 专为 ML 管理员、平台工程师、数据科学家、ML 工程师和 DevOps 工程师设计的专业技术研讨会,旨在帮助他们掌握管理和使用 Amazon SageMakerAI 托管 MLflow 的实操技能。
- 课程深入探讨了管理 SageMaker 托管 MLFlow 和示例工作负载等核心主题。- 参与者还将深入了解 MLflow 的核心构造,如实验、模型、提示词、SageMaker-MLflow 集成以及 tracing。
- 进阶部分将涵盖诸如 genai agents 和 LLM 模型训练等工作负载。
### 运维
#### [SageMaker MLflow 迁移](./operations/sagemaker-mlflow-migration/)
- 使用 SageMaker MLflow 服务在不同版本之间迁移 MLflow 数据的全面指南。
- 涵盖了从 MLflow v2.16 和 v3.0 tracking server 迁移到 MLflow v3.4 应用的场景。
- 包含用于数据设置、导出和导入流程的分步 notebook,并附带示例 MLflow 对象(实验、运行、trace、已注册的模型,以及特定于版本的功能如提示词和已记录的模型)。
### 监控
#### [预测式 ML Batch 监控 Pipeline](./monitoring/predictiveml-batch-monitoring-pipeline/)
使用 Evidently AI 进行偏差检测、追踪模型质量,并结合 SageMaker Pipelines 自动化以及 MLflow 集成,实现 Batch ML 监控。
#### [预测式 ML Endpoint 监控](./monitoring/predictiveml-endpoint-monitoring/)
结合 Evidently AI 数据偏差和模型质量评估实现实时 endpoint 监控,利用 CDK Lambda 进行生产级部署,并集成 MLflow tracking。
#### [自动化偏差与趋势监控](./monitoring/sagemaker-automated-drift-and-trend-monitoring/)
利用 Athena Iceberg 数据湖、QuickSight 仪表盘和 SNS 告警实现生产级偏差检测。完整解决方案请参见 [sample-mlops-bestpractices](https://github.com/aws-samples/sample-mlops-bestpractices)。
#### [LLM 推理监控](./monitoring/sagemaker-endpoint-llm-monitoring/)
利用 MLflow GenAI 评估和 Amazon Bedrock 实现 LLM endpoint 监控的 Serverless CDK 基础设施,采用事件驱动的 Step Functions 架构。
#### [使用 Grafana 实现 SageMaker 资源可观测性](./monitoring/resource-monitoring-grafana/)
使用 Amazon Managed Grafana 仪表盘进行 endpoint 基础设施监控——支持每 GPU、每容器的指标、成本归属以及 10 秒粒度的资源利用率监控。
#### [使用 Grafana 实现 LLM 质量可观测性](./monitoring/quality-monitoring-with-grafana/)
使用 GenAI 评估并以 Bedrock Claude 作为 LLM-as-judge 对 LLM 输出质量进行评分的 Grafana 仪表盘,并通过统一告警和 SNS 实现自动化告警。
### 示例
#### [在 Amazon Bedrock AgentCore 上使用 SageMaker 托管 MLflow 实现 Strands Agents 的可观测性](./examples/sagemaker-mlflow-agentcore-runtime/)
- 包含分步说明和部署 jupyter notebook 的示例,用于将 Amazon Bedrock AgentCore Runtime 中的 Strands Agents 与 Amazon SageMaker 托管 MLflow 集成以实现可观测性。
### 快速开始
要开始使用,请按照以下步骤操作:
将仓库克隆到您的本地计算机:
```
git clone https://github.com/aws-samples/sample-aiops-on-amazon-sagemakerai.git
```
导航到仓库目录:
```
cd sample-aiops-on-amazon-sagemakerai
```
浏览仓库内容,并按照每个子目录中 `README.md` 文件内的说明进行操作。
### 贡献
我们欢迎对本仓库的贡献!如果您有任何示例、改进或错误修复想要分享,请查看 [CONTRIBUTING](CONTRIBUTING.md#security-issue-notifications) 了解更多信息。
## 许可证
本库基于 MIT-0 许可证授权。详见 LICENSE 文件。
标签:Amazon Bedrock, Amazon SageMaker, C语言, MLflow, MLOps, NoSQL, 人工智能, 大模型运维, 用户模式Hook绕过, 逆向工具