mcpField
G
genai-hub-foundation-models

genai-hub-foundation-models

github.com/sap云与 DevOps10199 次安装6 天前更新
代码仓库

关于 genai-hub-foundation-models

用于列出 SAP AI Core 实例中可用基础模型的 Skill,提供提供方和模型标识符、版本及能力信息,并可将所选模型交由生命周期管理流程部署。

主要功能

  1. 01列出可用基础模型
  2. 02按可执行项 ID 筛选模型
  3. 03查看版本和能力信息
  4. 04查找运行中的模型部署
  5. 05向部署工作流提供模型标识符

适用场景

  1. 01检查实例中可用的模型
  2. 02比较模型版本及支持的能力
  3. 03查找所选模型的运行中部署
  4. 04为创建部署准备模型信息

安装

复制下面的命令,在终端中运行。

$npx skills add https://github.com/sap/ai-skills-library --skill genai-hub-foundation-models

安装后在 Claude Code 中输入/genai-hub-foundation-models确认已加载。

附带文件references/MODELS.mdscripts/list_foundation_models.py

详细介绍

规则

  1. 如果模型名称未知或未确认,请获取实时模型列表;如果用户已指定具体模型,则跳过。
  2. 此技能中的 executable-id 和 model-name 值是 aicore-lifecycle-management 创建部署所需的输入。
  3. 如果尚未配置凭据,请先调用 aicore-admin-resources。
  4. 执行任何 curl 示例之前,请先获取 Bearer 令牌:
    export TOKEN=$(uv run skills/aicore-admin-resources/scripts/get_token.py)
    
    绝不要添加 2>&1 或通过管道传递命令——这会将原始 JWT 输出到对话中。

列出可用模型

# Show all options and examples:
uv run scripts/list_foundation_models.py --help

# One provider only (e.g. Azure OpenAI):
uv run scripts/list_foundation_models.py --executable-id azure-openai

# Detailed view (versions, capabilities, context length, streaming support):
uv run scripts/list_foundation_models.py --response-format detailed

# Machine-readable JSON for scripting:
uv run scripts/list_foundation_models.py --json | jq '.[].model'
uv run scripts/list_foundation_models.py --response-format detailed --json | jq '.[] | select(.model == "gpt-4o") | .versions'

# Models supported by the Orchestration service only:
uv run scripts/list_foundation_models.py --scenario-id orchestration

提供商 → 可执行 ID 映射

提供商--executable-id
Azure OpenAIazure-openai
Anthropicaws-bedrock
Googlegcp-vertexai
Amazon Bedrockaws-bedrock
Mistral AIaicore-mistralai
Cohereaicore-cohere
Perplexityperplexity-ai
NVIDIAaicore-nvidia
开源aicore-opensource
SAPaicore-sap

你的实例支持的模型可能与此表不同——请使用脚本获取实时列表。


创建部署

获取 executable-id 和 model-name 后,请检查是否已存在该模型的 RUNNING 部署:

uv run skills/aicore-lifecycle-management/scripts/get_deployments.py \
  --scenario foundation-models --status RUNNING --json

如果找到,请使用 AskUserQuestion 询问用户是要复用该部署还是创建新部署。然后使用这两个值调用 aicore-lifecycle-management。

modelName 值必须与目录输出完全一致——不匹配会在部署时(而非配置创建时)导致“Invalid Configuration”错误。


何时加载参考文件

触发条件加载
Curl 推理示例、特定提供商的端点路径,或即将调用已部署的模型references/MODELS.md

查找 Curl 调用所需的部署 URL

  1. 获取 executable-id——在上方的“提供商 → 可执行 ID”表中查找。

  2. 查找正在运行的部署:

    uv run skills/aicore-lifecycle-management/scripts/get_deployments.py \
      --scenario foundation-models --executable-id <executable-id> --status RUNNING --json
    # use .deployment_url and .resource_group from the matching entry
    
  3. 有关导出设置和各提供商的 curl 示例,请参阅 references/MODELS.md。


移交

  • 凭据/身份验证错误? → 调用 aicore-admin-resources
  • 准备好使用找到的模型创建部署? → 调用 aicore-lifecycle-management

评论

支持 Markdown