SABER inspect_ai 评估执行
inspect-eval-execution
在本地运行 SABER inspect_ai 评估的指南。当需要针对任意 SABER 领域运行、重新运行或配置 inspect 评估时使用。
- License 许可
- MIT
- 最近更新
- 2026-11-06
- Stars
- ★ 22
- Forks
- 3
01 前言 Front Matter
- name
- inspect-eval-execution
- description
- Guide for running SABER inspect_ai evaluations locally. Use this when asked to run, re-run, or configure an inspect eval for any SABER domain.
03 SKILL.md 正文
To run SABER inspect_ai evaluations locally, follow this process:
1. Understand the Domain Structure
Each domain lives in domains/<domain>/ and follows this layout:
domains/<domain>/
<domain>.py # @task entry point — calls create_task()
eval.yaml # Domain metadata, Docker image definitions
tasks/
global.yaml # Default prompts, tools, max_steps, aggregation
<task_group>/
<task>.yaml # Individual task definitions
compose/
sandbox.compose.yml # Docker Compose for sandbox containers
scoring/ # Domain-specific scoring strategies
tools/ # Domain-specific MCP tools
prompts/ # Jinja2 prompt templates (instructions/, assistants/, etc.)
docker/ # Dockerfiles for sandbox images
The <domain>.py file is minimal — it just calls saber.task.create_task(**kwargs) which wires up config loading, prompt rendering, scoring, tools, and the agent.
2. Build Docker Images First
Before running evals, ensure Docker images are built:
# Build all images for a domain
uv run saber build <domain>
# Or auto-build during eval (slower, builds missing images)
uv run inspect eval domains/<domain> --model <model> --display plain -T build=true
# Force rebuild all images
uv run inspect eval domains/<domain> --model <model> --display plain -T rebuild_all=true
# Rebuild specific images by prefix
uv run inspect eval domains/<domain> --model <model> --display plain -T rebuild=sandbox
3. Run an Evaluation
Always use --display plain to disable the Rich interactive progress display.
This outputs clean, parseable text instead of ANSI escape sequences and cursor
manipulation that pollute AI agent context windows.
# Basic evaluation (all tasks)
uv run inspect eval domains/<domain> --model <model> --display plain
# Common model formats (we own these endpoints):
# openai/azure/gpt-4.1 (Azure OpenAI)
# openai/azure/gpt-5.2 (Azure OpenAI)
# Run a single sample for quick iteration
uv run inspect eval domains/<domain> --model <model> --display plain --limit 1
# --limit <> is the BEST way to keep your evals small and contained for testing
# Filter to specific tasks
uv run inspect eval domains/<domain> --model <model> --display plain -T task_filter="sanity_*"
uv run inspect eval domains/<domain> --model <model> --display plain -T task_filter="incident_response_01"
# Multiple task patterns (comma-separated)
uv run inspect eval domains/<domain> --model <model> --display plain -T task_filter="sanity_*,advanced_*"
3.1 Permanent Environments
It is generally recommended if you expect to do multiround eval analysis to use "-T keep_permanent=true" in your uv run inspect command. This keeps long to spin up resources like databases around for ease of use on following evals.
If you do this, use
uv run saber teardown -y
To teardown any assets when you are finished
4. Key -T Parameters
| Parameter | Purpose | Example |
|---|---|---|
task_filter |
Glob pattern to select tasks | -T task_filter="sanity_*" |
build=true |
Build missing Docker images | -T build=true |
rebuild_all=true |
Rebuild ALL Docker images | -T rebuild_all=true |
rebuild=<prefix> |
Rebuild images matching prefix | -T rebuild=sandbox |
agent=<name> |
Agent implementation | -T agent=react |
run_preflight=true |
Health check before eval | -T run_preflight=true |
keep_permanent=true |
Keep permanent services alive | -T keep_permanent=true |
5. Control Concurrency and Limits
# Limit number of concurrent samples
uv run inspect eval domains/<domain> --model <model> --display plain --max-samples 4
# Limit concurrent model API connections
uv run inspect eval domains/<domain> --model <model> --display plain --max-connections 20
# Combine limits for stability
uv run inspect eval domains/<domain> --model <model> --display plain --limit 1 --max-samples 1
5b. Reasoning models — set --reasoning-effort explicitly (IMPORTANT)
Reasoning models (gpt-5.x, o1/o3, Claude Opus) do NO reasoning by default in these
runs: reasoning_effort is unset, the model emits 0 reasoning tokens, and scores land
noticeably lower. Always pass it explicitly — especially for cross-run / cross-model
comparisons:
uv run inspect eval domains/<domain> --model <model> --reasoning-effort high --display plain
Verified impact (excytin, gpt-5.4, latest_test_set, 599 samples): reasoning=high
scored 0.886 vs 0.813 with reasoning unset — a +0.073 aggregate swing, entirely
from reasoning, with the largest lift on intermediate checkpoints (the multi-step
investigation). The effort used is recorded in the eval-log header
(model_generate_config.reasoning_effort); stats.model_usage.*.reasoning_tokens == 0
means no reasoning happened. --max-tokens must be large enough to cover reasoning +
answer or completions get truncated.
6. Enable Verbose Logging
# Show info-level logs during eval
INSPECT_LOG_LEVEL=info uv run inspect eval domains/<domain> --model <model> --display plain
# Show debug-level logs (very verbose)
INSPECT_LOG_LEVEL=debug uv run inspect eval domains/<domain> --model <model> --display plain
# Write Python logger output to file
INSPECT_PY_LOGGER_FILE=/tmp/eval_debug.log uv run inspect eval domains/<domain> --model <model> --display plain
7. Iterative Development Workflow
When developing or debugging a domain:
- Start with
--limit 1to run a single sample quickly - Use
task_filterto isolate the specific task you're working on - Pipe output to capture both stdout and stderr:
2>&1 | tee /tmp/eval_output.log - Check the eval log — the path is printed at the end:
Log: logs/<timestamp>_<domain>_<id>.eval - Iterate on scoring/tools — changes to domain code in
domains/<domain>/take effect immediately (no reinstall needed) - Changes to
saberorinspect_ai— if installed as editable, take effect immediately; if installed from git, you must edit the files in.venv/lib/python3.11/site-packages/directly and clear__pycache__dirs
8. Understand the Score Output
The eval summary shows scores organized by task and scorer:
saber_overall task_name_1 task_name_2
mean 0.500 accuracy 1.000 accuracy 0.000
stderr 0.000 stderr 0.000 stderr 0.000
saber_overallis the aggregate across all tasks- Each task shows its
accuracy(the final aggregated score) nanmeans the scorer did not produce a result (e.g., the agent didn't reach that evaluation point)- Multiple scorers per task (e.g.,
submission,crash_analysis,root_cause) are aggregated per the task'sscoring_aggregationconfig
9. Common Issues
- "No tasks found": Check
task_filtermatches task YAML filenames (without.yamlextension) - Docker build failures: Run
uv run saber build <domain>separately to see full build output - Model API errors: Verify environment variables (
AZURE_OPENAI_API_KEY,OPENAI_API_KEY, etc.) - Stale saber version:
uv.lockpins an exact saber commit. If the ACES/SABER library repo has been updated but evals show missing features or unexpected errors, update the lock:
Then commit the updateduv lock --upgrade-package saber && uv sync --all-extrasuv.lock. Useuv pip show saberto verify the installed commit.
04 同仓库更多 Skills
Eval 日志解析与分析
inspect-eval-log-analysis
解析和分析 inspect_ai .eval 日志文件的指南。当需要解读评估结果、提取工具调用、查找分数或根据 .eval 日志调查智能体行为时使用。
inspect_ai 评估调试
inspect-eval-debugging
用于调试 inspect_ai 评估失败、评分问题及模型行为的指南。当评估结果不符合预期、评分有误、评分失败或模型输出出现异常时使用。
SABER 评估运行监控
eval-monitoring
用于监控正在运行的 SABER 评估、检查进度以及管理评估批次的指南。当用户要求监控评估、查看进度、生成状态报告或管理并发评估运行时使用。同时涵盖 Docker 健康状态与资源管理。
SABER 评估结果分析
eval-analysis
用于分析 SABER 评估结果的综合指南——包括模型对比、智能体架构对比、特定领域分析以及跨领域汇总分析。当用户要求分析评估结果、对比模型、生成可视化图表、解读分数、探究成本效益权衡,或将分析扩展到新领域时使用。