aicore-lifecycle-management について
SAP AI Coreのシナリオ確認と、設定およびデプロイ管理を支援するスキルです。作成、監視、更新、削除に対応し、状態を変更する操作では明示的な確認を求めます。
主な機能
- 01シナリオと実行可能項目の一覧・確認
- 02設定の表示と管理
- 03デプロイの作成と監視
- 04デプロイの停止・更新・削除
- 05状態変更時の明示的な確認
活用シーン
- 01デプロイ前に実行可能項目のパラメーターを確認
- 02LLMまたはオーケストレーションのデプロイ作成
- 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が必要です。必ず明示的に指定し、回避しないでください。 - ユーザーがリソースグループを指定しない場合は、SDK が設定済みのデフォルトを使用するよう
--resource-groupを省略してください。 - LLM のデプロイでは、シナリオ ID、実行可能 ID、モデルのパラメーター名は
genai-hub-foundation-modelsから取得します。これらの値が不明な場合は、まずこれを呼び出してください。 - デプロイ設定の命名規則:LLM のデプロイでは
{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>")'
命名規則:
- LLM:
{executable_id}--{model_name}— 例:azure-openai--gpt-4o-mini - オーケストレーション:
orchestration - カスタム:内容がわかる名前を選択してください
LLM のデプロイ(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 対応