关于 aicore-lifecycle-management
用于查看 SAP AI Core 场景并管理配置和部署的 Skill,支持创建、监控、更新及删除部署;修改状态的操作要求明确确认。
主要功能
- 01列出并查看场景和可执行项
- 02查看和管理配置
- 03创建并监控部署
- 04停止、更新和删除部署
- 05状态变更操作须明确确认
适用场景
- 01部署前检查可执行项参数
- 02创建 LLM 或编排部署
- 03检查部署状态并更新其配置
- 04经确认后停止或移除部署
安装
复制下面的命令,在终端中运行。
$
npx skills add https:/ / github.com/ sap/ ai-skills-library --skill aicore-lifecycle-management安装后在 Claude Code 中输入/aicore-lifecycle-management确认已加载。
包含的文件
除 SKILL.md 外,安装时一起下载的参考资料和脚本。
scripts/create_configuration.pycreate_deployment.pydedup_deployments.pydelete_deployment.pyget_configurations.pyget_deployment_logs.pyget_deployments.pyget_executables.pyget_scenarios.pypatch_deployment.pystop_deployment.py详细介绍
规则
- 所有脚本都必须从技能根目录运行,并使用
uv run scripts/<name>.py。 - 切勿打印或记录凭证值——SDK 会从环境中读取这些值。
- 删除或修改状态的脚本需要使用
--confirm。务必显式传入;切勿绕过此要求。 - 用户未指定资源组时,省略
--resource-group,以便 SDK 使用其配置的默认值。 - 对于大模型部署:场景 ID、可执行文件 ID 和模型参数名称来自
genai-hub-foundation-models——如果这些值未知,请先调用它。 - 部署配置命名约定:大模型部署使用
{executable_id}--{model_name}(例如azure-openai--gpt-4o-mini)。创建配置前,使用get_configurations.py --scenario-id <id>检查是否已存在同名配置,并重复使用该配置以避免重复创建。
列出 / 检查场景
# List all scenarios
uv run scripts/get_scenarios.py
# Inspect a specific scenario and its versions
uv run scripts/get_scenarios.py --scenario-id <id>
uv run scripts/get_scenarios.py --scenario-id <id> --response-format detailed
# JSON output for piping
uv run scripts/get_scenarios.py --json
列出可执行文件
# List executables for a scenario
uv run scripts/get_executables.py --scenario-id <id>
# Inspect a specific executable (includes parameters and input artifacts)
uv run scripts/get_executables.py --scenario-id <id> --executable-id <id>
uv run scripts/get_executables.py --scenario-id <id> --executable-id <id> --response-format detailed
# JSON output
uv run scripts/get_executables.py --scenario-id <id> --json
只有检查单个可执行文件(--executable-id)时才会返回参数。列表视图仅返回 ID、名称和描述。
配置
# List configurations
uv run scripts/get_configurations.py
uv run scripts/get_configurations.py --scenario-id <id>
uv run scripts/get_configurations.py --response-format detailed
uv run scripts/get_configurations.py --json
# Inspect a specific configuration
uv run scripts/get_configurations.py --configuration-id <id>
# Create a configuration (binds parameters to an executable)
uv run scripts/create_configuration.py \
--name my-config \
--scenario-id <id> \
--executable-id <id> \
--param modelName=gpt-4o \
--param temperature=0.7
如果部署失败,或在几分钟后仍处于 PENDING 状态,请根据可执行文件声明的参数检查参数名称和值:
uv run scripts/get_executables.py --scenario-id <id> --executable-id <id> --response-format detailed
部署
部署用于提供推理端点。标准流程是:创建(或重复使用)配置,然后根据该配置创建部署。
配置命名约定
创建配置前,务必检查是否已存在匹配的配置,以避免重复创建:
# Check existing configurations before creating
uv run scripts/get_configurations.py --scenario-id <scenario-id> --json | jq '.[] | select(.name == "<expected-name>")'
命名约定:
- 大模型:
{executable_id}--{model_name}— 例如azure-openai--gpt-4o-mini - 编排:
orchestration - 自定义:选择一个描述性名称
大模型部署(来自 genai-hub-foundation-models 的交接信息)
# 1. Create configuration (skip if one with this name already exists):
uv run scripts/create_configuration.py \
--name azure-openai--gpt-4o-mini \
--scenario-id foundation-models \
--executable-id azure-openai \
--param modelName=gpt-4o-mini \
--param modelVersion=latest
# 2. Deploy:
uv run scripts/create_deployment.py --configuration-id <config-id> --wait
编排部署
# 1. Create configuration (skip if "orchestration" config already exists):
uv run scripts/create_configuration.py \
--name orchestration \
--scenario-id orchestration \
--executable-id orchestration
# 2. Deploy:
uv run scripts/create_deployment.py --configuration-id <config-id> --wait --timeout 600
列出和检查部署
# List all deployments
uv run scripts/get_deployments.py
# Filter by status or scenario or executable
uv run scripts/get_deployments.py --status RUNNING
uv run scripts/get_deployments.py --scenario orchestration
uv run scripts/get_deployments.py --executable-id azure-openai --status RUNNING
uv run scripts/get_deployments.py --executable-id azure-openai --status RUNNING --json
# Inspect one deployment
uv run scripts/get_deployments.py --deployment-id <id>
uv run scripts/get_deployments.py --deployment-id <id> --response-format detailed
uv run scripts/get_deployments.py --deployment-id <id> --json
停止、修补、删除、查看日志
# Stop a deployment
uv run scripts/stop_deployment.py --deployment-id <id> --confirm
uv run scripts/stop_deployment.py --deployment-id <id> --confirm --wait
# Patch (swap configuration on a running deployment)
uv run scripts/patch_deployment.py --deployment-id <id> --configuration-id <new-config-id>
# Delete (must be STOPPED or DEAD first)
uv run scripts/delete_deployment.py --deployment-id <id> --confirm
# Stop and delete in one step:
uv run scripts/delete_deployment.py --deployment-id <id> --confirm --auto-stop
# Deployment logs
uv run scripts/get_deployment_logs.py --deployment-id <id>
uv run scripts/get_deployment_logs.py --deployment-id <id> --tail 50
uv run scripts/get_deployment_logs.py --deployment-id <id> --order asc
uv run scripts/get_deployment_logs.py --deployment-id <id> --json
# Remove duplicate LLM deployments (only affects LLM deployments with a model name)
uv run scripts/dedup_deployments.py --dry-run
uv run scripts/dedup_deployments.py
交接
- 需要 Bearer 令牌或凭证设置? → 调用
aicore-admin-resources - 需要可执行文件 ID、模型名称或模型能力? → 调用
genai-hub-foundation-models - 想列出可用模型或提供商? → 调用
genai-hub-foundation-models
评论
支持 Markdown