Model Evaluation
AWS LabsOfficialPublished by AWS Labs
- Skill
- Workflow
- Software development
- Apache-2.0
- Low risk
- Has scripts
AutoGineer summary
Written by AutoGineer from the skill’s own files, not by the author
This skill provides a structured workflow for evaluating SageMaker models, supporting both open-source and Nova models. It guides users through selecting an evaluation strategy—either LLM-as-Judge for qualitative assessment or a Custom Scorer for programmatic validation—and generates the necessary Python code or Jupyter notebooks to execute these benchmarks within the SageMaker environment.
What it does
- Determines the appropriate evaluation type based on model architecture and user requirements.
- Validates compatibility between the chosen evaluation method and the target model.
- Generates Python scripts or Jupyter notebooks for model evaluation.
- Supports LLM-as-Judge for OSS models.
- Facilitates the creation and registration of Lambda-based custom scorers.
- Integrates with SageMaker SDK for streamlined model benchmarking.
When to use it
- When you need to benchmark the performance of a fine-tuned or base SageMaker model.
- When you want to use an LLM to grade model outputs.
- When you require custom programmatic logic to score model responses.
- When you need to compare different model versions or configurations.
Advantages
- Ensures consistent evaluation workflows through guided steps.
- Prevents incompatible configurations by validating model types early.
- Automates the generation of boilerplate code for evaluation tasks.
- Provides flexibility by supporting both automated LLM grading and custom logic.
Usage examples
- “Evaluate my model.”
- The agent will initiate the evaluation workflow, asking you to choose between LLM-as-Judge or Custom Scorer, and verify your model type.
- “How did my model perform?”
- The agent will guide you through setting up a benchmark or custom scorer to generate performance metrics.
- “Run a benchmark on my fine-tuned Llama model.”
- The agent will confirm the model type and guide you through the LLM-as-Judge or Custom Scorer setup process.
Install
Download the skill as a ZIP:
https://mp-staging.autogineer.com/agent-skills/awslabs/model-evaluation/downloadUnzip it into the cross-client skills folder of your project:
mkdir -p .agents/skills && unzip model-evaluation.zip -d .agents/skills
Documentation by AWS Labs
Model Evaluation
Generate code that evaluates a SageMaker model.
Prerequisites
The SDK environment has been verified (SDK version, region, execution role). If not done, activate the
sdk-getting-startedskill first.
Principles
One thing at a time. Each response advances exactly one decision. Never combine multiple questions in a single turn.
Confirm before proceeding. Wait for the user to agree before moving to the next step.
Don't read files until you need them. Only read reference files when you've reached the step that requires them.
Don't ask what you already know. If the answer is in conversation history, workflow_state.json, plan.md, or any file you've already read — use it. Confirm if unsure, but don't re-ask.
No narration. Share outcomes and ask questions. Keep responses short.
No repetition. If you said something before a tool call, don't repeat it after.
Scope
This skill supports the evaluation feature for SageMaker Serverless Model Customization. It can evaluate any base or fine-tuned model supported by SageMaker serverless model customization — both OSS models (Llama, Mistral, Qwen, etc.) and Nova models.
Tell the user when the skill is activated:
"I can help evaluate any base or fine-tuned model supported by SageMaker serverless model customization."
If the user requests help evaluating a model that isn't supported by SageMaker serverless model customization, explain that it is not supported by this skill.
Evaluation Types
There are two evaluation types:
LLM-as-Judge — an LLM grades your model's responses. (OSS models only — not supported for Nova.)
Custom Scorer — programmatic evaluation via Lambda function (includes built-in math and code scorers). Works with both OSS and Nova models.
Workflow
Step 1: Determine evaluation type
Do you already know which evaluation type to use?
Check conversation history, plan.md, workflow_state.json, or anything else you've already read.
If yes: confirm with the user.
"It sounds like you want to run [evaluation type]. Is that right?"
⏸ Wait for confirmation. If confirmed → go to Step 2.
If no: ask.
"What kind of evaluation would you like to run? I support:
LLM-as-Judge — an LLM grades your model's responses
Custom Scorer — programmatic scoring (math, code, or your own logic)
Pick one, or say 'help me decide' if you're not sure."
⏸ Wait for user.
If user picks one → go to Step 2.
If user indicates uncertainty, by saying something like "help me decide," "whatever you think," "I'm not sure" → read
references/evaluation-type-guide.mdand follow its instructions. It will guide the user to a choice and then return here. You MUST NEVER make a recommendation to the user on eval type without readingreferences/evaluation-type-guide.md.
Step 2: Validate and hand off to evaluation workflow
Before reading the reference file, validate that the chosen evaluation type is compatible with the user's situation. You may already know these answers from conversation context — don't ask if you don't need to.
LLM-as-Judge validation
What model type are we evaluating? LLM-as-Judge is not supported for Nova models. To determine model type (if you don't already know it):
If you have the training job name or ARN, use the AWS MCP tool
list-tagson the training job ARN and look for thesagemaker-studio:jumpstart-model-idtag. Contains "nova" → Nova. Anything else → OSS.If you have a Model Package ARN, use the AWS MCP tool
describe-model-packageand check the model description or source tags.If neither is available, ask the user.
Does the user have an evaluation dataset? LLM-as-Judge requires one.
Custom Scorer validation
Does the user have an evaluation dataset? Custom Scorer requires one. (Works with both OSS and Nova models, though for Nova only custom lambdas are supported.)
If validation fails, tell the user which requirement(s) aren't met and offer alternatives:
"[Evaluation type] won't work because [reason]."
If the failure reason was lack of an eval dataset, there's nothing we can do. Inform the user:
"Unfortunately all of the supported eval types require an eval dataset. I can't help you with model evaluation."
If the failure reason is something else, offer to help them pick a different evaluation type.
⏸ Wait for user.
If they say they do want help choosing a different eval type → read references/evaluation-type-guide.md.
If validation passes, read the corresponding reference file:
| User chose | Read |
|---|---|
| LLM-as-Judge | references/llmaaj-evaluation.md |
| Custom Scorer | references/custom-scorer-evaluation.md |
Follow the reference file's instructions from the beginning.
Files
- ATTRIBUTION.mdAdded by AutoGineer916 B
- LICENSELicence file added by AutoGineer9.9 KiB
- NOTICELicence file added by AutoGineer89 B
- SKILL.md5.2 KiB
- code_templates/custom_scorer_evaluator.pyScript2.5 KiB
- code_templates/llmaaj_evaluator.pyScript2.4 KiB
- references/code_output_guide.md3.3 KiB
- references/create-reward-function.md3.0 KiB
- references/custom-lambda-scorer.md4.4 KiB
- references/custom-scorer-evaluation.md10.2 KiB
- references/evaluation-type-guide.md8.0 KiB
- references/llmaaj-builtin-evaluation.md5.0 KiB
- references/llmaaj-custom-evaluation.md2.3 KiB
- references/llmaaj-evaluation.md13.7 KiB
- references/supported-judge-models.md2.5 KiB
- scripts/nova_reward_function_source_template.pyScript13.0 KiB
- scripts/reward_function_source_template.pyScript9.3 KiB
- scripts/validate_custom_metrics.pyScript3.6 KiB
references/custom-scorer-evaluation.md
Custom Scorer Evaluation
Guide the user through the process for evaluating a model with Custom Scorer (built-in Prime Math/Code or custom Lambda).
Workflow
Step 0: Consider prior context
Before proceeding, silently think about the context you have about the user's project, including conversation history and file reads. You should use that knowledge, and avoid asking questions you already know the answer to.
Step 1: Validate Custom Scorer compatibility
Before proceeding, confirm one thing:
Does the user have an evaluation dataset?
If the check fails (the user has no eval dataset), tell the user and offer to help them pick an alternative:
"Custom Scorer evaluation requires an evaluation dataset. Would you like help choosing a different evaluation type?"
If they want help choosing a different evaluation type → break this workflow and read references/evaluation-type-guide.md.
If the check passes, proceed.
Step 2: Understand the task
For this step, you need: to understand the task the model is trained to do. If you know this already, skip this step. If not, ask the user:
"What task is this model trained to do?"
Step 3: Get evaluation dataset
For this step, you need: the evaluation dataset S3 path. If you know this already, skip this step. If not, ask the user:
"Where's your evaluation dataset stored in S3?"
Step 4: Choose scorer type
For this step, you need to know which scorer to use.
If the model is Nova: built-in scorers (Prime Math, Prime Code) are not supported for Nova models. Inform the user and proceed with Custom Lambda:
"For Nova models, only Custom Lambda scoring is supported. Built-in scorers (Prime Math, Prime Code) won't produce results. Let's set up a Custom Lambda scorer."
Then read references/custom-lambda-scorer.md and follow its instructions. Return here and proceed to Step 5.
If the model is OSS: ask if you don't already know from context:
"Which type of scorer would you like to use?
Prime Math — built-in scorer for math problems (checks answer correctness)
Prime Code — built-in scorer for coding problems (executes code against test cases)
Custom Lambda — your own scoring logic as a Lambda function. You can use an existing registered evaluator or create a new one.
Which would you prefer?"
If built-in (Prime Math or Prime Code) → note the choice and proceed to Step 5.
If custom Lambda → read
references/custom-lambda-scorer.mdand follow its instructions to resolve the evaluator. Then return here and proceed to Step 5. You MUST follow these instructions before moving on.
Step 5: Validate dataset format
IMPORTANT: you MUST validate that dataset, to ensure that it is the correct format. Note that there are precise requirements based on model and evaluation type, so you cannot skip this step.
Reference the dataset-evaluation skill to perform this validation.
Step 6: Determine evaluation scope
For this step, you need to know which model(s) to evaluate.
If you already know from context, confirm and move on. Otherwise, ask:
"Would you like to evaluate:
Just your fine-tuned model
Just a base model
Both, with a comparison
⏸ Wait for user approval.
Step 7: Resolve Model Package ARN
This step only applies if the evaluation scope includes the fine-tuned model (option 1 or 3 from Step 6). If the user chose base model only, skip to Step 8.
For this step, you need: the Model Package ARN of the fine-tuned model.
If you already have it from prior context, confirm with the user and move on. Otherwise, ask:
"What's the Model Package ARN (or group name) of your fine-tuned model?"
If they provide a group name, resolve the ARN by calling list-model-packages via the AWS tool. Use the latest version's ModelPackageArn.
Validate the resolved ARN:
Must look like:
arn:aws:sagemaker:REGION:ACCOUNT:model-package/NAME/VERSIONIf it's a group ARN (
:model-package-group/), resolve to a package ARN by callinglist-model-packagesvia the AWS tool. Use the latest version'sModelPackageArn.If it contains
:model-package/but does NOT end with a version number (e.g.,/1), resolve it: extract the group name and uselist-model-packages.If it contains
/DataSet/,/TrainingJob/, or other non-model-package resource types, flag it: "That looks like a [Dataset/TrainingJob] ARN, not a model package ARN. Could you double-check?"Verify it exists by calling
describe-model-packagevia the AWS tool. If this fails, tell the user the ARN wasn't found and ask them to double-check.
Step 8: Resolve base model
This step only applies if the evaluation scope includes the base model (option 2 or 3 from Step 6). If the user chose fine-tuned only, skip to Step 9.
For comparison mode (option 3): the base model is resolved automatically from the fine-tuned model's lineage — no additional input needed.
For base model only (option 2): you need a JumpStart model ID (e.g., meta-textgeneration-llama-3-2-1b-instruct). Check if you already know it from context. If not, ask:
"What's the JumpStart model ID of the base model you'd like to evaluate?"
<!-- TODO: Add guidance for helping the user find their JumpStart model ID. -->
Step 9: Resolve IAM role ARN
For this step, you need: an IAM role ARN with permissions for evaluation.
If you already know the IAM role ARN from conversation context, confirm with the user and move on.
If not, but you know the training job name, look up the role from that training job, since it should be a suitable role:
Call
describe-training-jobvia the AWS tool and extractRoleArn.Confirm with the user.
If you don't have either, ask:
"What IAM role ARN should I use for the evaluation job?"
Important: If the user chose a custom Lambda scorer, the IAM role must also have lambda:InvokeFunction permission for the scorer's Lambda function. Mention this to the user:
"Note: since you're using a custom Lambda scorer, this role needs
lambda:InvokeFunctionpermission for your scorer function. Does your role have that?"
Step 10: Resolve AWS Region
For this step, you need: the AWS region for the evaluation job. If you already know it from context, confirm and move on. Otherwise, ask.
Step 11: Resolve S3 output path
For this step, you need: an S3 path for evaluation output. If you already know it from context, confirm and move on. Otherwise, ask.
Step 12: MLflow experiment name (optional)
For this step, you need to know: the MLflow experiment name.
If you already know this from context, confirm and move on. If not, the name should follow this pattern:
<project-name>-eval.
Perform this step quietly. The user does not need to know about this. This is to make sure their results are viewable alongside other experimental work they're doing.
Step 13: Final Checks
IMPORTANT: Before moving on, you MUST think through every step of this workflow. Did you complete it, or did you have a good reason for skipping? If not, please complete it now. In particular, make sure you have carefully validated the dataset and the lambda against the correct requirements.
Step 14: Confirm configuration
Summarize everything and ask for approval:
"Here's the evaluation setup:
Task: [task]
Dataset: [path]
Scorer: [Prime Math / Prime Code / Custom Lambda ARN]
Model: [Model Package ARN or JumpStart model ID]
Evaluation scope: [fine-tuned only / base only / both with comparison]
IAM role: [ARN]
Region: [region]
S3 output: [path]
MLflow experiment name: [MLflow experiment name]
Does this look right?"
⏸ Wait for user approval.
Step 15: Generate code
Read ../references/code_output_guide.md for output format rules.
If no project directory exists, activate the directory-management skill to set one up.
Read code_templates/custom_scorer_evaluator.py, substitute the collected values into the placeholders, and write the cells. The template uses # Cell N: Label markers — each marker starts a new notebook cell, with everything between one marker and the next becoming that cell's content.
Step 16: Post-generation
Notebook mode:
To run:
1. Cell 1 — configuration and SDK install
2. Cell 2 — start evaluation
3. Cell 3 — polls status automatically (~25-60 min)
4. Cell 4 — show resultsScript mode:
Evaluation can take hours depending on your dataset. Present the user with options:
"Would you like me to:
Leave it to you — run with
python scripts/[script_name]Run it and wait until it's done
Start it but don't wait — we can check status later"
Option 1: Done. Wait for user to come back.
Option 2: Execute the script as-is.
execution.wait()polls until complete. Report results.Option 3: Remove the
execution.wait()call, execute, report the evaluation ARN.
Note: evaluate() does not accept a wait parameter. It always returns immediately. Blocking is done via execution.wait(target_status="Succeeded").
Checking status:
describe-pipeline-execution --pipeline-execution-arn ARN→PipelineExecutionStatuslist-pipeline-execution-steps --pipeline-execution-arn ARN→ per-stepStepStatus,FailureReason
Showing results after completion:
Run:
EvaluationPipelineExecution.get(arn=ARN).show_results()
FAQ
Q: What metrics do I get with Custom Scorer? A: Both built-in and custom scorers automatically produce standard NLP metrics (F1, ROUGE, BLEU) alongside your custom scores.
Q: Does my IAM role need special permissions for Custom Scorer?
A: Yes — if using a custom Lambda scorer, the IAM role needs lambda:InvokeFunction permission for the scorer's Lambda function. Built-in scorers (Prime Math/Code) don't require additional permissions.
Q: Can I create a new reward function through this skill?
A: Yes — if you choose Custom Lambda and don't have an existing evaluator, the agent will walk you through creating one from a template and registering it via Evaluator.create.
Nova Model Notes
Custom Scorer evaluation works with Nova models via Custom Lambda. Built-in scorers (Prime Math, Prime Code) are not supported — the pipeline will run without error, but the scorer will not execute.
Requirements and compatibility
Works with: Claude Code, Claude apps, OpenAI Codex, GitHub Copilot, Cursor, Gemini CLI, Kiro, OpenCode, Goose, Amp, Roo Code, JetBrains Junie, Factory Droid, Devin (ex-Windsurf), Mistral Vibe, OpenHands, Letta
“Works with” means the tool reads the open Agent Skills format; a skill written for one tool may use features others lack.
Needs: Needs Python
Security
What our scanner noticed· Low risk
- Instructions that use the network
- Scripts that your agent may run
This skill includes scripts that your agent may run. Read them before you use it.
A static scan is not a guarantee. Skills are third-party content: review a skill before you let an agent use it.
Attribution and licence
- Published by
- AWS Labs
- Publisher
- AWS Labs (Official)
- Source
- awslabs/agent-plugins · plugins/sagemaker-ai/skills/model-evaluation · commit fbefb37
- Licence
- Apache License 2.0 (redistribution allowed)
- LICENSE (added by AutoGineer from LICENSE)
- NOTICE (added by AutoGineer from NOTICE)
- ATTRIBUTION.md (written by AutoGineer)
- Synced
AutoGineer is not affiliated with or endorsed by AWS Labs.
Download ZIP
The ZIP holds the skill’s files, its licence files and an ATTRIBUTION.md. Download model-evaluation.zip