Logo Genai Hub Prompt Evaluation

Genai Hub Prompt Evaluation

Tổ chức
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`.

Tổng quan

Nhà phát hànhSAP
Kho mãai-skills-library
Tên kỹ nănggenai-hub-prompt-evaluation
Sao
123
Bản fork
28
Tệp đi kèm
20
Giấy phépApache-2.0
Liên kết
  • Hướng dẫn bằng Markdown

    Tệp SKILL.md được mô hình tải khi cần, nên chỉ tốn token khi có yêu cầu thực sự phù hợp.

  • Dùng được với mọi LLM

    Kỹ năng AI dùng hướng dẫn viết bằng Markdown thay vì mã dành riêng cho một nhà cung cấp, nên dùng được với GPT, Claude, Gemini, Grok hoặc mô hình cục bộ.

  • 20 tệp đi kèm

    Các tập lệnh, mẫu và tài liệu tham khảo mà mô hình có thể đọc khi làm việc. Các tệp chỉ cho phép đọc và không bao giờ được thực thi.

  • Mã nguồn mở

    Được SAP công bố trên GitHub. Hãy đọc các tệp nguồn trước khi cài đặt.

Cài đặt

Cài đặt kỹ năng AI Genai Hub Prompt Evaluation trong TypingMind để dùng với bất kỳ LLM nào, hoặc thêm vào một tác nhân AI khác có thể đọc SKILL.md.

1

Cài đặt trong TypingMind

TypingMind cài đặt kỹ năng trực tiếp từ thư mục GitHub — đọc SKILL.md, đóng gói các tệp tài nguyên và lưu kết quả trên máy.

  1. Mở ứng dụng và vào Plugin → Kỹ năng.
  2. Chọn "Cài đặt từ GitHub".
  3. Dán URL của thư mục kỹ năng được hiển thị bên dưới rồi xác nhận.
    https://github.com/SAP/ai-skills-library/tree/main/plugins/aicore-skills/skills/genai-hub-prompt-evaluation
  4. Bật kỹ năng trong từng cuộc trò chuyện mà bạn muốn sử dụng kỹ năng đó.
Plugin → Kỹ năng → Thêm kỹ năng → Từ URL GitHub, sau đó dán URL thư mục và nhấn Tiếp tục.
2

Cài đặt trong tác nhân AI khác

Bất kỳ tác nhân AI nào đọc được định dạng Agent Skills đều có thể dùng kỹ năng này — hãy sao chép thư mục vào thư mục kỹ năng của tác nhân AI đó.

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
Khởi động lại Claude Code sau khi sao chép để ứng dụng nhận kỹ năng mới.

Sử dụng trong TypingMind

Bật Genai Hub Prompt Evaluation trong bất kỳ cuộc trò chuyện nào trên TypingMind, mô hình sẽ tự xử lý phần còn lại. Tên và mô tả của kỹ năng nằm trong prompt hệ thống. Ngay khi có yêu cầu phù hợp, mô hình tự tải toàn bộ hướng dẫn — bạn không cần gọi thủ công và kỹ năng không tốn token cho đến khi thực sự được dùng.

Mô hình tự nạp Genai Hub Prompt Evaluation ngay khi có yêu cầu phù hợp.

Dùng được với mọi mô hình AI

Kỹ năng AI là các hướng dẫn Markdown thuần túy, không phải mã dành riêng cho một nhà cung cấp, nên bạn có thể dùng Genai Hub Prompt Evaluation với cả những mô hình khác ngoài mô hình ban đầu. Chỉ cần cài đặt một lần trong TypingMind rồi dùng với GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama hoặc mô hình cục bộ do bạn tự chạy — tất cả đều dùng khóa API của riêng bạn.

  • Chỉ tải khi cần

    Prompt hệ thống chỉ chứa tên và mô tả. Hướng dẫn được tải khi có yêu cầu phù hợp đầu tiên, nên khi kỹ năng chưa được dùng, bạn không tốn token cho phần hướng dẫn.

  • Đổi mô hình ngay trong cuộc trò chuyện

    Vì kỹ năng là hướng dẫn chứ không phải mã, việc đổi mô hình không làm kỹ năng ngừng hoạt động — mô hình tiếp theo vẫn đọc cùng tệp SKILL.md.

Hướng dẫn của kỹ năng

Đây là nội dung SKILL.md mà mô hình tải. Hãy đọc trước khi cài đặt — kỹ năng là những hướng dẫn mà mô hình của bạn sẽ làm theo.

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

Tệp đi kèm

Khi kỹ năng đã được tải, mô hình có thể đọc các tệp này nếu cần. Các tệp này chỉ dùng để đọc và không bao giờ được thực thi.

Câu hỏi thường gặp

Kỹ năng AI Genai Hub Prompt Evaluation làm được gì?

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...

Vì sao nên dùng Genai Hub Prompt Evaluation trên TypingMind?

Vì bạn chỉ cần cài một lần rồi dùng với bất kỳ mô hình nào. Genai Hub Prompt Evaluation là nội dung Markdown chứ không phải mã dành riêng cho từng nhà cung cấp, nên cùng một kỹ năng có thể chạy trên GPT-5, Claude, Gemini, Grok hoặc mô hình trên thiết bị — và bạn có thể đổi mô hình ngay trong cuộc trò chuyện mà kỹ năng vẫn hoạt động. TypingMind dùng khóa API riêng của bạn, nên bạn thanh toán trực tiếp cho nhà cung cấp thay vì trả phí thuê bao theo suất người dùng, đồng thời kỹ năng và các cuộc trò chuyện vẫn nằm trong bộ lưu trữ của bạn.

Làm thế nào để cài Genai Hub Prompt Evaluation trong TypingMind?

Mở Plugin → Kỹ năng → Cài đặt từ GitHub trong TypingMind rồi dán https://github.com/SAP/ai-skills-library/tree/main/plugins/aicore-skills/skills/genai-hub-prompt-evaluation. TypingMind đọc tệp SKILL.md, đóng gói các tệp đi kèm rồi cài đặt cả gói dưới dạng một kỹ năng mà bạn có thể bật cho từng cuộc trò chuyện.

Những mô hình AI nào có thể dùng Genai Hub Prompt Evaluation?

Bất kỳ mô hình nào bạn kết nối trong TypingMind. Kỹ năng AI là các hướng dẫn bằng Markdown chứ không phải mã dành riêng cho từng nhà cung cấp, nên GPT, Claude, Gemini, Grok và các mô hình chạy trên thiết bị đều có thể tải kỹ năng này khi có yêu cầu phù hợp.

Có thể dùng Genai Hub Prompt Evaluation với bao nhiêu mô hình AI?

Bao nhiêu cũng được. Miễn là mô hình hỗ trợ kỹ năng, bạn có thể dùng Genai Hub Prompt Evaluation với mô hình đó — GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama và nhiều mô hình khác — tất cả đều trên TypingMind với khóa API riêng của bạn.

Kỹ năng AI Genai Hub Prompt Evaluation có miễn phí không?

Có. Kỹ năng này được SAP phát hành trên GitHub theo giấy phép Apache-2.0. Bạn chỉ trả tiền cho nhà cung cấp AI của mình theo số token đã dùng.

Kỹ năng AI là gì?

Kỹ năng AI là một gói hướng dẫn có thể tái sử dụng, chỉ cho mô hình AI cách thực hiện một tác vụ cụ thể. Kỹ năng tuân theo định dạng mở Agent Skills: một tệp SKILL.md chứa tên và mô tả, cùng các tập lệnh, mẫu hoặc tệp tham khảo mà mô hình có thể cần. Mô hình chỉ đọc hướng dẫn khi yêu cầu của bạn phù hợp với kỹ năng, nên kỹ năng đã cài đặt không phát sinh chi phí cho đến khi được sử dụng.

Kỹ năng AI khác gì với plugin hoặc máy chủ MCP?

Plugin hoặc máy chủ MCP cung cấp các công cụ mới mà mô hình có thể gọi. Khi mô hình gọi một công cụ, mã của công cụ đó chạy ở đâu đó và trả về kết quả. Còn kỹ năng AI cung cấp kiến thức và quy trình: cách tiếp cận tác vụ, các bước cần thực hiện và những tiêu chí mà kết quả cần đáp ứng. Kỹ năng chỉ là nội dung Markdown, nên không cần máy chủ, khóa API hay môi trường thực thi và hoạt động với mọi mô hình.

Xem tất cả

Tạo ngay không gian làm việc AI riêng

Đăng ký bản tin của chúng tôi để nhận thông báo về tính năng mới và các đợt tặng quà sắp tới 👇