BentoML模型打包器Skill bentoml-model-packager

BentoML模型打包器是一款专业的机器学习模型部署工具,专注于模型打包、API服务化和容器化部署。支持多种主流ML框架(如sklearn、PyTorch、TensorFlow),提供完整的模型生命周期管理,包括版本控制、Docker容器构建、Kubernetes部署配置生成和自适应批处理优化。适用于AI模型生产化部署、MLOps流水线集成和云原生AI应用开发。

AI应用 0 次安装 0 次浏览 更新于 2/23/2026

name: bentoml-model-packager description: 用于模型打包、服务和容器化的BentoML技能 allowed-tools:

  • Read
  • Write
  • Bash
  • Glob
  • Grep

bentoml-model-packager

概述

支持多种机器学习框架的BentoML技能,用于模型打包、服务和容器化。

功能

  • Bento创建与版本管理
  • 多框架模型支持(sklearn、PyTorch、TensorFlow等)
  • 带验证的API端点定义
  • Docker容器化
  • Kubernetes部署YAML生成
  • 自适应批处理配置
  • 模型签名与运行器
  • 服务组合

目标流程

  • 带金丝雀发布的模型部署流水线
  • 模型训练流水线
  • 机器学习系统集成测试

工具与库

  • BentoML
  • Docker
  • Kubernetes

输入模式

{
  "type": "object",
  "required": ["action"],
  "properties": {
    "action": {
      "type": "string",
      "enum": ["save", "build", "serve", "containerize", "push", "list"],
      "description": "要执行的BentoML操作"
    },
    "modelConfig": {
      "type": "object",
      "properties": {
        "name": { "type": "string" },
        "framework": { "type": "string" },
        "modelPath": { "type": "string" },
        "signatures": { "type": "object" }
      }
    },
    "serviceConfig": {
      "type": "object",
      "properties": {
        "servicePath": { "type": "string" },
        "port": { "type": "integer" },
        "workers": { "type": "integer" },
        "batchConfig": {
          "type": "object",
          "properties": {
            "maxBatchSize": { "type": "integer" },
            "maxLatencyMs": { "type": "integer" }
          }
        }
      }
    },
    "buildConfig": {
      "type": "object",
      "properties": {
        "bentoName": { "type": "string" },
        "version": { "type": "string" },
        "includeFiles": { "type": "array", "items": { "type": "string" } },
        "pythonRequirements": { "type": "string" }
      }
    },
    "containerConfig": {
      "type": "object",
      "properties": {
        "imageName": { "type": "string" },
        "registry": { "type": "string" },
        "dockerOptions": { "type": "object" }
      }
    }
  }
}

输出模式

{
  "type": "object",
  "required": ["status", "action"],
  "properties": {
    "status": {
      "type": "string",
      "enum": ["success", "error"]
    },
    "action": {
      "type": "string"
    },
    "modelTag": {
      "type": "string"
    },
    "bentoTag": {
      "type": "string"
    },
    "imageTag": {
      "type": "string"
    },
    "endpoint": {
      "type": "string"
    },
    "kubernetesYaml": {
      "type": "string"
    }
  }
}

使用示例

{
  kind: 'skill',
  title: '打包并容器化模型',
  skill: {
    name: 'bentoml-model-packager',
    context: {
      action: 'containerize',
      modelConfig: {
        name: 'fraud_classifier',
        framework: 'sklearn',
        modelPath: 'models/fraud_model.pkl'
      },
      buildConfig: {
        bentoName: 'fraud-service',
        version: '1.0.0',
        pythonRequirements: 'requirements.txt'
      },
      containerConfig: {
        imageName: 'fraud-service',
        registry: 'gcr.io/my-project'
      }
    }
  }
}