Genai Hub Prompt Evaluation 标志

Genai Hub Prompt Evaluation

组织
SAP
genai-hub-prompt-evaluation

Run GenAI evaluations on SAP AI Core: benchmark LLMs and prompts against a test dataset using system-defined and custom (LLM-as-judge) metrics, then retrieve aggregate results. Supports all three evaluation types — prompt registry, orchestration registry, and grounding (RAG) orchestration registry. WHEN: user wants to evaluate or benchmark an LLM / prompt / orchestration config, run a GenAI evaluation, create or list evaluation metrics, define a custom LLM-as-a-judge metric, create a prompt template (prompt registry) or an orchestration-registry config (with or without grounding) for evaluation, create an evaluation configuration or execution, or fetch evaluation results / scores for an execution. DO NOT USE FOR: agent evaluation via the offline aeval service — use `aeval-offline-evaluation`; building a production orchestration/RAG pipeline for inference — use `genai-hub-orchestration`; generic executions, deployments, or artifacts unrelated to evaluation — use `aicore-lifecycle-management`; credentials, resource groups, or object stores — use `aicore-admin-resources`.

Add to TypingMind

概览

发布者SAP
代码仓库ai-skills-library
技能名称genai-hub-prompt-evaluation
星标数
123
复刻数
28
附带文件
20
许可协议Apache-2.0
链接
  • Markdown 格式的指令

    模型按需加载 SKILL.md 文件,因此只有在请求确实与该技能匹配时才会消耗 Token。

  • 兼容任何大语言模型

    AI 技能采用纯 Markdown,而非特定提供商的代码,因此可搭配 GPT、Claude、Gemini、Grok 或本地模型使用。

  • 20 个附带文件

    模型执行任务时可读取的脚本、模板和参考资料。这些文件为只读文件,绝不会被执行。

  • 开源

    由 SAP 发布于 GitHub。请在安装前查看技能的源文件。

安装

在 TypingMind 中安装 Genai Hub Prompt Evaluation AI 技能,即可搭配任意大语言模型使用;也可以将其放入其他支持读取 SKILL.md 的智能体中。

1

安装到 TypingMind

TypingMind 可直接从 GitHub 文件夹安装技能:读取 SKILL.md,打包资源文件,并将结果保存在本地。

  1. 打开应用,前往“插件 → 技能”。
  2. 选择“从 GitHub 安装”。
  3. 粘贴下方的技能文件夹 URL 并确认。
    https://github.com/SAP/ai-skills-library/tree/main/plugins/aicore-skills/skills/genai-hub-prompt-evaluation
  4. 请在每个需要使用该技能的聊天中启用它。
依次选择“插件 → 技能 → 添加技能 → 从 GitHub URL 导入”,然后粘贴文件夹 URL 并点击“继续”。
2

安装到其他智能体

任何支持 Agent Skills 格式的智能体都可以使用此技能,只需将文件夹复制到该智能体的技能目录中。

Claude Code — .claude/skills
git clone --depth 1 https://github.com/SAP/ai-skills-library.git /tmp/ai-skills-library
mkdir -p .claude/skills
cp -r /tmp/ai-skills-library/plugins/aicore-skills/skills/genai-hub-prompt-evaluation .claude/skills/genai-hub-prompt-evaluation
复制后,请重启 Claude Code,以加载新技能。

在 TypingMind 中使用此技能

在任意 TypingMind 聊天中启用 Genai Hub Prompt Evaluation,后续即可交由模型处理。技能的名称和描述会放在系统提示词中,一旦请求匹配,模型就会自动加载完整指令,无需您手动调用,且在实际使用前不会消耗 Token。

一旦请求与技能匹配,模型就会自动加载 Genai Hub Prompt Evaluation。

兼容任何 AI 模型

AI 技能是纯 Markdown 指令,而非特定提供商的代码,因此 Genai Hub Prompt Evaluation 不局限于最初适配的模型。只需在 TypingMind 中安装一次,即可搭配 GPT-5、Claude、Gemini、Grok、DeepSeek、Mistral、Llama 或您自行运行的本地模型使用,全程使用您自己的 API 密钥。

  • 仅在需要时加载

    系统提示词中仅包含技能名称和描述。首次遇到匹配的请求时才会加载完整指令,因此技能未使用时,这些指令不会消耗 Token。

  • 在聊天中切换模型

    技能是指令而非代码,因此切换模型不会导致技能失效,新模型会读取同一个 SKILL.md。

技能指令

这是模型会加载的 SKILL.md 内容。请在安装前阅读,因为技能就是模型将遵循的指令。

Step 0 — ask for credentials first (required)

Before running any other step, confirm the AI Core credentials are set. Invoke aicore-admin-resources and run check_setup.py.

  • If it succeeds, continue to the workflow.
  • If it fails (missing variables, invalid_client, or bad credentials), STOP and ask the user to export the variables listed in Environment variables below. Do not continue, and do not look for credentials or workflow steps anywhere else (notebooks, other repos, workspace files) — this skill's scripts/ are the only supported path.

Rules

  1. Run all scripts from this skill's root directory with uv run scripts/<name>.py.
  2. Shared lifecycle/admin steps are handled by other skills — invoke them rather than reimplementing: object stores and resource groups → aicore-admin-resources; artifact registration, executions, execution status → aicore-lifecycle-management.
  3. Never print or log credential values — scripts read them from the environment via the SDK.
  4. The evaluation scenario ID is genai-evaluations. Always use the executable ID genai-evaluations-simplified — hardcode it, do not use any version/user-suffixed variant. A tenant may list many such custom-built images; ignore them. Only fall back to discovery (aicore-lifecycle-management get_executables.py --scenario-id genai-evaluations) if genai-evaluations-simplified is not present on the tenant at all.
  5. Before creating a custom metric or prompt-registry config, list existing ones and reuse by name/scenario/version to avoid duplicates. create_evaluation_metric.py already does create-or-get.
  6. Only fetch results (get_evaluation_results.py) once the execution status is COMPLETED (UNKNOWN → PENDING → RUNNING → COMPLETED). Check status by invoking aicore-lifecycle-management (get_executions.py --execution-id <id>).
  7. If a dataset has no reference/ground-truth column, do not select metrics that require a reference.

Environment variables

All scripts in this skill read credentials from the environment — never from CLI arguments.

AI Core credentials (required for all scripts)

VariableDescriptionNotes
AICORE_AUTH_URLOAuth token endpointMust end in /oauth/token
AICORE_CLIENT_IDOAuth client IDFrom BTP AI Core service key
AICORE_CLIENT_SECRETOAuth client secretFrom BTP AI Core service key
AICORE_BASE_URLAI Core API base URL/v2 is appended automatically if not present
AICORE_RESOURCE_GROUPResource group to operate inDefault: default

Source: BTP cockpit → your subaccount → Instances & Subscriptions → AI Core instance → Service Keys.

Set them once via aicore configure (saves to ~/.aicore/config.json) or export each variable:

bash
export AICORE_AUTH_URL=https://<subdomain>.authentication.<region>.hana.ondemand.com/oauth/token
export AICORE_CLIENT_ID=<client-id>
export AICORE_CLIENT_SECRET=<client-secret>
export AICORE_BASE_URL=https://api.ai.<region>.aws.ml.hana.ondemand.com
export AICORE_RESOURCE_GROUP=default

Shell syntax: AICORE_RESOURCE_GROUP='default' — no space before =.

Object-store credentials (required only for download_evaluation_results.py)

The per-row SQLite DB is downloaded directly from S3 — AI Core credentials are not used here. Set the standard AWS SDK environment variables; the script uses boto3's credential chain directly:

VariableDescription
AWS_ACCESS_KEY_IDS3 access key ID
AWS_SECRET_ACCESS_KEYS3 secret access key

The bucket name is passed as --bucket <name> on the command line (not read from env). Source: the same AWS credentials used when creating the object store secret in aicore-admin-resources.


End-to-end workflow

The full runbook (with every command and how the pieces connect) is in references/WORKFLOW.md. The high-level flow, and which skill owns each step:

#StepOwner
1Register S3 object store secret (input source)aicore-admin-resources create_object_store.py
2Upload the dataset to the bucketuser — sample datasets in data/
3Register the dataset folder as an artifact (with the prompt-evaluation label)this skill register_eval_artifact.py
4Ensure an orchestration deployment is running (for the deployment URL)aicore-lifecycle-management + genai-hub-orchestration
5Select system metrics / create custom metricsthis skill list_evaluation_metrics.py, create_evaluation_metric.py
6Create the thing to evaluate (see Evaluation types below)this skill create_prompt_template.py or create_orchestration_registry_config.py
7Create the evaluation configurationthis skill create_evaluation_configuration.py
8Start the executionaicore-lifecycle-management create_execution.py
9Poll status until COMPLETEDaicore-lifecycle-management get_executions.py
10Retrieve aggregate resultsthis skill get_evaluation_results.py
11(Optional) Download the raw SQLite DB for per-row analysisthis skill download_evaluation_results.py

Evaluation types

Choose one — it determines what you create in step 6 and which binding you pass to create_evaluation_configuration.py in step 7:

TypeWhat you evaluateCreate withConfig binding
Prompt registryA prompt template + one or more modelscreate_prompt_template.py--prompt-template-id (+ --models)
Orchestration registryAn orchestration config (prompt_templating)create_orchestration_registry_config.py--orchestration-registry-ids
Grounding orchestration registryAn orchestration config with a grounding (RAG) modulecreate_orchestration_registry_config.py (grounding template)--orchestration-registry-ids

All three share steps 1–5 and 7–11; only step 6 and the config binding differ. The grounding type additionally needs grounding prerequisites (grounding-enabled resource group, grounding secret, document-grounding pipeline) — see references/GROUNDING_SETUP.md.


Evaluation metrics

bash
# Discover system metric names (use these verbatim in --metrics later)
uv run scripts/list_evaluation_metrics.py --kind system
uv run scripts/list_evaluation_metrics.py --kind system --name "Pointwise"

# List your custom metrics and their IDs
uv run scripts/list_evaluation_metrics.py --kind custom --json | jq '.[] | {id, name}'

# Create (or reuse) custom LLM-as-a-judge metrics from a definition file (idempotent).
# See templates/custom-metric.json. Prints the resulting metric ID(s).
uv run scripts/create_evaluation_metric.py --file templates/custom-metric.json

Common system metrics: Pointwise Conciseness, Pointwise Answer Relevance, Pointwise Instruction Following, Pointwise Correctness, Pointwise RAG Context Relevance, Pointwise RAG Groundedness, Pointwise RAG Context Precision, Pointwise RAG Completeness. Confirm the exact names for the tenant with list_evaluation_metrics.py --kind system.


Step 6 — create the thing to evaluate

Type 1 — Prompt registry

Create (or reuse) a prompt template in the Prompt Registry, then benchmark it across models.

bash
uv run scripts/list_prompt_templates.py --scenario genai-evaluations          # reuse?
uv run scripts/create_prompt_template.py --file templates/prompt-template.json \
  --name prompt-registry-eval-demo --version 1.0.0

Returns a prompt template ID → pass as --prompt-template-id, together with --models (e.g. "gpt-4o:2024-05-13") in step 7.

Type 2 — Orchestration registry

Create (or reuse) an orchestration config (prompt_templating, no grounding).

bash
uv run scripts/list_orchestration_registry_configs.py --scenario genai-evaluations   # reuse?
uv run scripts/create_orchestration_registry_config.py \
  --file templates/orchestration-registry-config.json \
  --name genai-eval-prompt-config --version 0.0.1

Returns a config ID → pass as --orchestration-registry-ids in step 7.

Type 3 — Grounding orchestration registry (RAG)

First complete the grounding prerequisites in references/GROUNDING_SETUP.md, then create the config from the grounding template (adds a grounding module):

bash
uv run scripts/create_orchestration_registry_config.py \
  --file templates/orchestration-registry-grounding-config.json \
  --name genai-eval-grounding-config --version 0.0.1

Returns a config ID → pass as --orchestration-registry-ids in step 7. Select RAG metrics (Pointwise RAG Groundedness, Pointwise RAG Context Relevance, …) for this type.


Step 7 — evaluation configuration + execution

Use the executable ID genai-evaluations-simplified directly (per Rule 4 — do not use a version/user-suffixed variant). Then create the configuration with this skill's script:

bash
# 2a. Create the evaluation configuration — ORCHESTRATION / GROUNDING types
uv run scripts/create_evaluation_configuration.py \
  --executable-id genai-evaluations-simplified \
  --dataset-artifact-id <artifact-id> \
  --test-dataset-path testdata/full_dataset.csv \
  --test-dataset-type csv \
  --metrics "Pointwise Correctness,Pointwise Answer Relevance" \
  --orchestration-registry-ids <registry-config-id> \
  --orchestration-deployment-url <orchestration-deployment-url> \
  --repetitions 1

# 2b. Create the evaluation configuration — PROMPT REGISTRY type
uv run scripts/create_evaluation_configuration.py \
  --executable-id genai-evaluations-simplified \
  --dataset-artifact-id <artifact-id> \
  --test-dataset-path testdata/full_dataset.csv \
  --metrics "Pointwise Correctness" \
  --prompt-template-id <prompt-template-id> \
  --models "gpt-4o:2024-05-13" \
  --orchestration-deployment-url <orchestration-deployment-url>

Custom metric IDs (from create_evaluation_metric.py) can be appended to --metrics. Limit rows with --test-row-count N. Map variables to dataset columns with --variable-mapping '{"all_metrics/reference":"data/ground_truth"}'.

Then hand off to aicore-lifecycle-management for the run itself:

  • Start the execution — create_execution.py --configuration-id <config-id>
  • Poll until COMPLETED — get_executions.py --execution-id <execution-id> (status goes UNKNOWN → PENDING → RUNNING → COMPLETED)

Results

bash
# Aggregate metrics per model/prompt run (only once COMPLETED)
uv run scripts/get_evaluation_results.py --execution-id <execution-id>
uv run scripts/get_evaluation_results.py --execution-id <execution-id> --json

For instance-level results (per-row scores, latency, logs), download the SQLite DB (<execution-id>/tmp/results.db) from object storage. Set AWS_ACCESS_KEY_ID and AWS_SECRET_ACCESS_KEY in the environment, then pass the bucket name via --bucket:

bash
uv run scripts/download_evaluation_results.py --execution-id <execution-id> --bucket <bucket> --show-tables

For the full download + local inspection recipe (table schema, querying per-row metrics), see references/RESULTS_ANALYSIS.md.


Handoffs

  • Credentials, resource group, or object store secret not set up? → invoke aicore-admin-resources
  • Need to start/stop/inspect executions, discover executables, or manage deployments? → invoke aicore-lifecycle-management
  • Need a running orchestration deployment or want to design the prompt/RAG pipeline? → invoke genai-hub-orchestration
  • Setting up grounding (RAG) for the grounding type? → see references/GROUNDING_SETUP.md (uses aicore-admin-resources for the resource group and secret)
  • Evaluating an agent (not a prompt/LLM) via the offline service? → invoke aeval-offline-evaluation

When to Load Reference Files

TriggerLoad
Running the full end-to-end evaluation, or unsure which command comes nextreferences/WORKFLOW.md
Setting up grounding (RAG) prerequisites for the grounding orchestration typereferences/GROUNDING_SETUP.md
Downloading and inspecting the raw per-row results (SQLite DB from object storage)references/RESULTS_ANALYSIS.md

附带文件

技能加载后,模型会按需读取这些文件。它们仅作为可读文件提供,绝不会被执行。

常见问题

Genai Hub Prompt Evaluation AI 技能有什么作用?

Run GenAI evaluations on SAP AI Core: benchmark LLMs and prompts against a test dataset using system-defined and custom (LLM-as-judge) metrics, then retrieve aggregate results. Supports all three evaluation types — prompt registry, orchestration registry, and grounding (RAG) orchestration registry. WHEN: user wants to evaluate or benchmark an LLM / prompt / orchestration config, run a GenAI evaluation, create or list evaluation metrics, define a custom LLM-as-a-judge metric, create a prompt template (prompt registry) or an orchestration-registry config (with or without grounding) for evalua...

为什么在 TypingMind 中使用 Genai Hub Prompt Evaluation?

因为您只需安装一次,就能搭配任何模型使用。Genai Hub Prompt Evaluation 采用纯 Markdown 格式,而非特定提供商专用的代码,因此同一技能可用于 GPT-5、Claude、Gemini、Grok 或本地模型。您甚至可以在聊天中途切换模型,而不会影响技能的正常使用。TypingMind 使用您自己的 API 密钥,因此您直接向提供商付费,而不是按席位订阅;您的技能和聊天记录也都保留在您自己的存储空间中。

如何在 TypingMind 中安装 Genai Hub Prompt Evaluation?

在 TypingMind 中打开“插件 → 技能 → 从 GitHub 安装”,然后粘贴 https://github.com/SAP/ai-skills-library/tree/main/plugins/aicore-skills/skills/genai-hub-prompt-evaluation。TypingMind 会读取其中的 SKILL.md,打包相关文件,并将其安装为技能,供您在各个聊天中按需启用。

哪些 AI 模型可以使用 Genai Hub Prompt Evaluation?

您在 TypingMind 中连接的任何模型都可以。AI 技能采用纯 Markdown 指令,而非特定提供商专用的代码,因此 GPT、Claude、Gemini、Grok 和本地模型都能在请求匹配时加载此技能。

Genai Hub Prompt Evaluation 可以搭配多少个 AI 模型使用?

数量不限。只要模型支持技能,您就可以将它与 Genai Hub Prompt Evaluation 搭配使用。GPT、Claude、Gemini、Grok、DeepSeek、Mistral、Llama 等模型都可以通过您自己的 API 密钥接入 TypingMind。

Genai Hub Prompt Evaluation AI 技能免费吗?

是的。SAP 已在 GitHub 上根据 Apache-2.0 许可证发布了该技能。您只需向自己的 AI 提供商支付所用 Token 的费用。

什么是 AI 技能?

AI 技能是一组可复用的指令,用于教会 AI 模型完成某项特定任务。它遵循开放的 Agent Skills 格式:包含名称和描述的 SKILL.md 文件,以及模型可能需要的脚本、模板或参考文件。模型仅在您的请求与技能匹配时才会读取这些指令,因此已安装的技能在使用前不会产生任何费用。

AI 技能与插件或 MCP 服务器有何不同?

插件或 MCP 服务器为模型提供可调用的新工具,也就是在某处运行并返回结果的代码。AI 技能则为模型提供知识和流程:如何处理任务、遵循哪些步骤,以及怎样的输出才算优质。技能采用纯 Markdown 格式,因此不需要服务器、API 密钥或运行时环境,并且适用于任何模型。

查看全部

立即创建您自己的 AI 工作区

订阅我们的电子简报,获取新功能和后续赠奖活动的通知 👇