用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
直接命令不会经过审查 Prompt;运行前请先检查来源。
npx skills add https://github.com/arm2arm/AstroAgentAssistant --skill agentbench-benchmarking命令会保持在同一行。复制前请横向滚动并检查完整内容。
想先保存到本地?可下载 SkillsMP 当前能够提供的文件。
S3/MinIO operations: connectivity, transfers, read benchmarks, and matplotlib visualization templates.
Complete guide to the REANA reproducible analytics platform: Dockerized client setup, multi-backend profiles, workflow authoring patterns, S3 dataset workflows, and best practices. Covers dev/prod backends, serial workflows, REANA_WORKSPACE usage, and self-learning from finished workflows.
Complete guide to working with Arepo simulation HDF5 files: structure inspection, unit conversion, radial profiles, slice projections, and dimensionality reduction (UMAP/t-SNE) for clustering analysis.
正在显示 SKILL.md
| name | agentbench-benchmarking |
| description | Complete guide to running AgentBench FC benchmarks with LLM agents |
| version | 1.0.0 |
| created | 2026-07-14T00:00:00.000Z |
Complete guide to running AgentBench FC (Function Calling) benchmarks with LLM agents.
AgentBench FC evaluates LLM agents across multiple environments (dbbench, os_interaction, knowledgegraph, webshop, alfworld) using function calling.
Repository: https://github.com/THUDM/AgentBench
git clone https://github.com/THUDM/AgentBench.git
cd AgentBench
python3 -m venv .venv
source .venv/bin/activate
pip install -r requirements.txt
Required images for each task:
# dbbench
docker pull mysql:8
# os_interaction
docker build -t local-os/default -f ./data/os_interaction/res/dockerfiles/default data/os_interaction/res/dockerfiles
docker build -t local-os/packages -f ./data/os_interaction/res/dockerfiles/packages data/os_interaction/res/dockerfiles
docker build -t local-os/ubuntu -f ./data/os_interaction/res/dockerfiles/ubuntu data/os_interaction/res/dockerfiles
docker compose -f extra/docker-compose.yml up -d
This starts:
Warning: webshop requires ~16GB RAM. ALFWorld has known memory leaks.
| Endpoint | Method | Purpose |
|---|---|---|
/api/list_workers | GET | List available task workers |
/api/get_indices?name=TASK | GET | Get available sample indices |
/api/start_sample | POST | Start a sample (returns initial prompt, NOT session_id) |
/api/interact | POST | Submit agent response |
/api/cancel | POST | Cancel session |
start_sample returns the initial prompt directly:
{
"messages": [...],
"tools": [...]
}
NOT a session_id. Session management is handled internally by the worker. Use the index as session_id for interact calls.
Use the runner script pattern:
import requests
# Get initial prompt
resp = requests.post(
"http://localhost:5020/api/start_sample",
json={"name": "dbbench-std", "index": 0}
)
data = resp.json() # Contains messages, tools
# Call your LLM
result = call_llm(data["messages"], data["tools"])
# Submit response
interact_resp = requests.post(
"http://localhost:5020/api/interact",
json={
"session_id": 0, # Use index as session_id
"agent_response": {"content": result, "status": "CONTINUE"}
}
)
See references/agentbench_runner.py for a complete implementation.
The built-in assigner uses complex YAML configs:
python -m src.assigner --config configs/assignments/my_config.yaml
Config format (see references/assignment_config.yaml):
definition: task assembly + agent configassignments: task -> sample count mappingconcurrency: parallel worker countoutput: results directory| Task | Samples | Description |
|---|---|---|
dbbench-std | 300 | SQL query generation |
os-std | 144 | Linux shell operations |
knowledgegraph-std | - | KG reasoning (requires Freebase) |
webshop-std | - | E-commerce navigation (~16GB RAM) |
alfworld-std | - | Embodied tasks (memory leak) |
For remote/vLLM endpoints (e.g., http://141.33.165.84:8000/v1/chat/completions):
API_URL = "http://YOUR_HOST:8000/v1/chat/completions"
MODEL_NAME = "aip-best" # or your model name
API_KEY = "EMPTY" # or your key
def call_api(messages, tools=None):
payload = {
"model": MODEL_NAME,
"messages": messages,
"stream": False,
"temperature": 0.1,
}
if tools:
payload["tools"] = tools
headers = {
"Authorization": f"Bearer {API_KEY}",
"Content-Type": "application/json",
}
resp = requests.post(API_URL, json=payload, headers=headers, timeout=180)
return resp.json()
⚠️ API Response Quirk: Some vLLM endpoints return reasoning field instead of content:
content = response_msg.get("content") or response_msg.get("reasoning", "")
⚠️ Tool Args Format: tool_calls[0].function.arguments may be a JSON string, not a dict:
func_args = tc.get("function", {}).get("arguments", {})
if isinstance(func_args, str):
func_args = json.loads(func_args)
query = func_args.get("query", "") if isinstance(func_args, dict) else ""
def call_ollama(messages, tools=None):
payload = {
"model": "qwen3.6:latest",
"messages": messages,
"stream": False,
}
if tools:
payload["tools"] = tools
resp = requests.post("http://localhost:11434/api/chat", json=payload)
return resp.json()
AgentBench expects tool calls in the response. Ollama Qwen models support this natively:
{
"message": {
"content": "Explanation...",
"tool_calls": [
{
"function": {
"name": "execute_sql",
"arguments": {"query": "SELECT ..."}
}
}
]
}
}
API version mismatch: The controller API changed from documented format. start_sample returns prompt directly, not session_id. Use the sample index as session_id for interact calls.
Config import paths: Assignment configs use relative imports. Use absolute paths (/tmp/AgentBench/configs/...) to avoid resolution errors.
SQL execution: In dbbench, SQL is executed internally by the worker when detected in code blocks. Don't call /execute_sql separately.
Memory leaks: ALFWorld worker leaks memory/disk. Restart after ~50 samples.
Webshop RAM: Requires ~16GB. Skip if limited resources.
Freebase data: knowledgegraph task needs Freebase database at ./virtuoso_db/virtuoso.db. Download from https://github.com/dki-lab/Freebase-Setup.
External API quirks: vLLM endpoints may return reasoning instead of content. Tool args may be JSON strings, not dicts. Handle both cases.
OS Interaction task Docker SDK bug: The os-std worker fails with AttributeError: 'int' object has no attribute 'connect' at aiodocker/stream.py:52. This is a Docker SDK compatibility issue, not missing data or configuration. All data (144 samples across 7 datasets) and Docker images are present. Fix: Downgrade Docker SDK inside the worker container: docker exec <container> pip install 'docker==6.1.3' 'aiodocker==0.21.0', or use a direct runner that bypasses the container execution layer (see scripts/os_direct_runner.py).
Multi-round loop performance: Full multi-round evaluation with 180s timeouts is extremely slow (~2-3 min/sample). For SQL generation quality tests, use single-round mode (~1s/sample). Full 300-sample benchmark with multi-round: ~18 min. Single-round 100-sample: ~1.5 min.
Tool usage rate: Models like aip-best (Qwen3.6) may prefer natural language responses over tool calls (~31% tool usage observed). Tune system prompt to encourage tool usage for full benchmark evaluation.
Results are saved as JSON:
{
"model": "qwen3.6:latest",
"task": "dbbench-std",
"elapsed_seconds": 435,
"results": [
{
"index": 0,
"status": "COMPLETED",
"final_answer": ["Women +60kg Bronze"],
"rounds": 2,
"history_length": 5
}
]
}
references/agentbench_runner.py: Complete runner implementationreferences/assignment_config.yaml: Working config templatereferences/api_quirks.md: API behavior notesreferences/agentbench-api-runner.md: External API integration guide with benchmarksreferences/plot-generation-pattern.md: Visualization patterns for resultsreferences/gwgd_benchmark_findings.md: gwgd endpoint (glm-4.7) benchmark analysisreferences/helmholtz_benchmark_analysis.md: Helmholtz Blablador endpoint analysis (rate limits, output format issues)references/dbbench_full_benchmark_results.md: Complete DBBench benchmark results and interpretationreferences/os_interaction_benchmark_results.md: OS Interaction benchmark results and infrastructure fixesreferences/kg_benchmark_results.md: Knowledge Graph benchmark results and tool-calling analysisreferences/dbbench-session-report.md: Complete DBBench session analysisreferences/dbbench-verification-pattern.md: Concurrency issue fix (0% → 98% with single-threaded)references/agentbench_full_suite_guide.md: Full 10-task benchmark suite implementationreferences/dbbench_300_run_2026-07-21.md: Verified 300-sample full run (92.7% SQL, 0 errors, 4.89s avg, 24.5 min)references/llama32_benchmark_results.md: llama3.2:3b benchmark results (100% success, 5x faster than aip-best)references/llama32_full_benchmark_results.md: Complete 6-task suite results (246 samples, 100% success, 1.92s avg)references/model_comparison_summary.md: Comprehensive model comparison table (llama3.2:3b vs qwen3.6:latest vs deepseek-r1:70b vs aip-best API)references/teuken-7b-benchmark-results.md: Teuken-7B full benchmark (206 samples, 87.4% success, 4.81s/sample) - structured tasks excel (99% SQL), reasoning weak (57%)scripts/run_all_benchmarks_llama32.py: Full suite runner for llama3.2:3b (recommended)scripts/os_direct_runner.py: Direct runner bypassing Docker SDK bugLong benchmark execution (execute_code timeout): The execute_code tool has a 300s hard timeout — any benchmark expected to take >5min will be killed. Fix: Use terminal(background=True) with output piped through tee to a log file, then poll progress with wc -l and tail. Example: python3 /tmp/bench.py 2>&1 | tee /tmp/bench_output.log. Check progress: wc -l /tmp/bench_output.log && tail -5 /tmp/bench_output.log. Verified with the 300-sample DBBench run (24.5 min).
aip-best 300-sample DBBench verified result (2026-07-21): Full 300-sample run completed. 278/300 SQL (92.7%), 0 errors, 4.89s avg, 1.0s min, 32.1s max, 1467.4s total (24.5 min). 22 samples did not generate SQL. Data in references/dbbench_300_run_2026-07-21.md.
"File not found" in config: Use absolute paths for imports.
Docker build fails (visdom): ALFWorld has dependency issues. Skip alfworld-std if not needed.
Stopping long-running benchmarks: When benchmarks take too long and the user says "stop all":
pkill -f 'dbbench' or kill <pid>agentbench-fc-* worker containers run as root inside Docker. Host-level kill does NOT stop them. You MUST explicitly stop each container:
docker stop agentbench-fc-dbbench-std-1 agentbench-fc-dbbench-std-2 ... agentbench-fc-dbbench-std-10
docker stop agentbench-fc-os_interaction-std-1 ... agentbench-fc-os_interaction-std-10
docker stop agentbench-fc-knowledgegraph-std-1 ... agentbench-fc-knowledgegraph-std-10
# Kill all benchmark scripts
pkill -f 'dbbench' 2>/dev/null
pkill -f 'benchmark' 2>/dev/null
# Stop ALL agentbench Docker containers
docker stop $(docker ps --format '{{.Names}}' | grep 'agentbench-fc') 2>/dev/null
# Verify clean
docker ps --format '{{.Names}}' | grep 'agentbench' | wc -l
Quick worker restart via docker start (2026-07-21): When images are already built, docker compose up can timeout rebuilding heavy images (webshop is 11GB). If containers previously exited but images exist:
docker ps -a --filter 'name=agentbench-fc-dbbench' for exited containersdocker start agentbench-fc-dbbench-std-{1..10} — starts all 10 workers in <1scurl -s http://localhost:5020/api/list_workers — workers register within 5sdocker compose up when images are missing or need rebuildingdocker start vs docker compose up — the former is instant for pre-built images, the latter may hang on large rebuildsSingle-turn DBBench benchmark pattern (2026-07-21): For SQL generation quality tests, single-turn mode is much faster than multi-round:
start_sample"Not Found" on interact: Check that the task worker is running and the session exists.
404 on /v1/chat/completions: Check endpoint URL. Some vLLM instances use different paths.
Empty messages array (os-std): OS Interaction task has known issues. Use dbbench-std instead.
User output preferences: User prefers concise, direct responses without verbose explanations. When presenting benchmark results:
Plot generation for results: When asked to visualize benchmark results, generate matplotlib plots with:
MEDIA: attachments for photosFull benchmark suite pattern: To run all 10 AgentBench tasks, use a master script that:
references/agentbench_full_suite_guide.md for implementation patternInfrastructure failure patterns: Low success rates (10-11%) in full suite are typically due to infrastructure issues, not model capability:
aiodocker timeout handling): Blocks OS Interaction task. Fix: Downgrade Docker SDK inside worker container (docker exec <container> pip install 'docker==6.1.3' 'aiodocker==0.21.0') or use direct runner that bypasses container execution.start_sample failed): 89% of DBBench failures. Fix: Ensure task worker is registered with controller (start the worker container), or use direct API runner.Benchmark result visualization: When asked to plot benchmark results:
MEDIA: attachmentsDBBench worker not registered: If start_sample returns "task dbbench-std does not exist", the dbbench worker container is not running. Fix: Start the worker: docker compose -f extra/docker-compose.yml up -d dbbench-std. Verify with curl http://localhost:5020/api/list_workers.
DBBench worker capacity exhaustion: If start_sample returns "no workers available for task dbbench-std", the single worker (32-slot capacity) is overwhelmed. Fix: Scale to 10 worker instances: docker compose -f extra/docker-compose.yml up -d dbbench-std after editing docker-compose.yml to set replicas: 10. This gives 320 total capacity and runs 10x faster without capacity timeouts.
Full DBBench benchmark with fixed infrastructure: When running full 300-sample DBBench benchmark with 10x worker capacity (10 replicas, 320 total slots), expect:
references/dbbench_full_benchmark_results.md for complete analysis and result interpretation.OS Interaction benchmark with fixed infrastructure: When running full 64-sample OS Interaction benchmark with 10x worker capacity (10 replicas, 320 total slots) and Docker SDK fixed:
for i in {1..10}; do docker exec agentbench-fc-os_interaction-std-$i pip install 'docker==6.1.3' 'aiodocker==0.21.0'; done, then restart all workersaip-best for structured query tasks; for OS tasks, consider prompt engineering to enforce code block formattingreferences/os_interaction_benchmark_results.md for complete analysis.API comparison benchmark pattern: When comparing multiple LLM endpoints:
aip-best (141.33.165.84) vs hermes-agent (141.33.55.137):
references/api_comparison_benchmark.md for implementation pattern.Knowledge Graph benchmark pattern: When running KG benchmark (150 samples, SPARQL/tool-calling task):
get_relations, get_neighbors functions correctly)freebase-std container) and 10 worker replicas for capacitytool_calls array, not raw SPARQL queriesreferences/kg_benchmark_results.md for complete analysis.Complete AgentBench benchmark summary: After testing DBBench, OS, and KG tasks with aip-best (Qwen3.6-35B-A3B):
aip-best for production Hermes Agent deployments. Focus on prompt engineering for free-form tasks if needed.Local Ollama benchmark results (llama3.2:3b): When testing local Ollama models for AgentBench:\n - llama3.2:3b (3B params, 2GB): PERFECT RESULTS - 100% success across ALL tasks\n - DBBench (100 samples): 100% SQL, 3.82s/sample\n - KG (50 samples): 100% success, 2.63s/sample\n - OS (26 samples): 100% command extraction, 0.32s/sample\n - Overall: 176/176 (100%) at 2.26s avg (5x faster than aip-best)\n - Verdict: ✅ BEST OPTION - fastest, most reliable, free, no rate limits\n - qwen3.6:latest (36B, 23GB): FAILS - Only 3% SQL extraction, 28s/sample, 63% errors\n - Output format mismatch: Does NOT generate code blocks despite same model name as aip-best\n - VRAM constraints: 5 concurrent workers cause 63% errors\n - Verdict: ❌ Local quantized version incompatible with DBBench\n - Key lesson: Local llama3.2:3b outperforms both external API (aip-best) and larger local models (qwen3.6:latest)\n - Smaller model (3B) is properly instruction-tuned for code blocks\n - Larger local model (36B) has different output format due to quantization\n - 100% success rate with 5x speedup makes llama3.2:3b the production choice\n - Recommendation: Use llama3.2:3b locally for ALL AgentBench tasks. Avoid qwen3.6:latest (local) due to output format incompatibility.\n - Benchmark scripts: See references/llama32_benchmark_results.md for complete analysis and runner scripts.\n\n25. Full AgentBench suite with llama3.2:3b: Running complete benchmark suite (6 tasks, 246 samples) with llama3.2:3b:
/tmp/agentbench_llama32_full/ (all 6 JSON result files)scripts/run_all_agentbench_llama32.py - Full 6-task suite implementationModel comparison summary (updated 2026-07-21):
| Model | Size | DBBench | KG | OS | LTP | ALFWORLD | AVALON | Overall | Speed | Verdict |
|---|---|---|---|---|---|---|---|---|---|---|
| llama3.2:3b | 1.9GB | 100% | 100% | 100% | 100% | 100% | 100% | 100% | 1.92s | ✅ BEST (local) |
qwen3.6:latest (local) | 22.3GB | 3% | - | - | - | - | - | 3% | 28s | ❌ Fails (no code blocks) |
deepseek-r1:70b | 39.6GB | - | - | - | - | - | - | N/A | 27s+ | ❌ Too slow, needs 50.5GB RAM |
glm-4.7-flash:bf16 | 55.8GB | - | - | - | - | - | - | N/A | Timeout | ❌ Unresponsive |
| aip-best (API) | - | 100% | ? | ? | - | - | - | 100% | 2.9s | ✅ RESTORED |
| Key lesson: Smaller, properly instruction-tuned models (llama3.2:3b) are fastest locally. aip-best API is now working (was broken 2026-07-16, restored 2026-07-21). Always verify API status on first use rather than assuming prior broken state. |
DeepSeek-R1-70B memory constraint: When testing deepseek-r1:70b (39.6GB model):
API endpoint availability check: When aip-best API endpoint (http://141.33.165.84:8000/v1) returns HTTP 404:
curl -s -o /dev/null -w "%{http_code}" "http://HOST:PORT/v1/chat/completions" -X POST -H "Content-Type: application/json" -d '{"model":"test","messages":[{"role":"user","content":"x"}]}'aip-best API RESTORED (2026-07-21): aip-best API is now functional:
http://141.33.165.84:8000/v1/chat/completionsaip-best (Qwen3.6-35B-A3B)content in standard OpenAI format (no null content issue)User output preference: User prefers concise, direct responses without verbose explanations. When presenting benchmark results or technical findings:
DBBench verification pattern: When re-running DBBench benchmark to verify results:
curl or single-sample Python script firstmessage.content directly (not choices[0].message.content like OpenAI API)llama.cpp server pattern: When running llama.cpp for local LLM serving:
https://github.com/ggerganov/llama.cpp, build with CMake (mkdir build && cd build && cmake .. -DGGML_CUDA=ON && make -j$(nproc) llama-server llama-cli)hf download or curl with Hugging Face token. Manual license acceptance required for gated models (visit HF page, click "Agree and access repository" before downloading)/tmp/llama.cpp/build/bin/llama-server -m ~/models/MODEL.gguf -c 4096 --port 8080 --host 0.0.0.0 -ngl 99http://localhost:8080/v1/chat/completionscurl http://localhost:8080/health → {"status":"ok"}process(action='kill', session_id=...) before starting new one on same portllama3.2:3b (1.9GB): 99.5% overall, 2.98s/sample, 100% reasoning → BESTTeuken-7B (14GB): 87.4% overall, 4.81s/sample, 56.7% reasoning → Good SQL (99%), weak reasoningreferences/teuken-7b-benchmark-results.md for full Teuken-7B benchmark analysis (206 samples, 87.4% success)scripts/dbbench_direct_runner.py: Direct runner pattern for bypassing controller API issuesscripts/run_all_benchmarks_llama32.py: Full suite runner for llama3.2:3b (recommended)scripts/run_all_agentbench_llama32.py: Complete 6-task suite runner (dbbench, KG, OS, LTP, ALFWORLD, AVALON)/api/interact/tmp/run_agentbench_dbbench_50_v2.pyOLMO-3.1 LLM quirks (2026-07-21):
thinking field, not content: OLMO-3.1 stores its actual response in message.thinking while message.content is empty. Always use multi-field fallback: msg.get("content") or msg.get("reasoning") or msg.get("thinking") or ""400 error with "does not support tools". Must strip tool_definitions from messages and omit tools from payload before calling.nvidia-smi | grep -A2 "ollama" before benchmarking large models. If ollama shows 0 GPU memory, model is on CPU and even slower.tools from payload, still use is_sql() for SQL detection (works fine).references/olmo31_benchmark_findings.md for full analysis.Long benchmark execution workaround (2026-07-21): The execute_code tool has a 300s hard timeout — any benchmark expected to take >5min will be killed. Fix: Use terminal(background=True) with output piped through tee to a log file, then poll progress:
python3 /tmp/bench.py 2>&1 | tee /tmp/bench_output.log
Check progress: wc -l /tmp/bench_output.log && tail -5 /tmp/bench_output.log.
Verified with the 300-sample DBBench run (24.5 min).
Ollama VRAM contention between models (2026-07-21): When benchmarking models on the same GPU, large models (e.g., OLMO-3.1 at 23.9GB) can stay loaded in VRAM and block smaller models being benchmarked (e.g., rnj-1 at 5.1GB), causing ~110s cold loads per request. Fix: Unload interfering large models before benchmarking smaller ones:
curl -s -X DELETE http://localhost:11434/api/delete -d '{"name":"unwanted-model:latest"}'
Pre-flight check: Always verify which models are loaded and VRAM usage:
nvidia-smi | grep -A10 "Processes:" | grep ollama
curl -s http://localhost:11434/api/tags | python3 -c "import sys,json; [print(f' {m[\"name\"]}: {m[\"size\"]/1e9:.1f}GB') for m in json.load(sys.stdin)['models'] if 'cloud' not in m['name']]"
VRAM budgeting: This GPU has 95GB total, but Xorg (~87MB) + desktop (~350MB) + Ollama consume ~27GB just for the large cached models. 8 models loaded can use ~330GB+ in swap. Unload anything not being actively benchmarked.