跳转到主要内容
GAIA(General AI Assistants)是一个真实世界任务 benchmark,覆盖多步推理、网页研究、文件检查与算术能力。任务分成三个难度等级,并通过与参考答案做 exact-match 来评分。 QitOS 提供 GaiaAdapter 将 GAIA 数据行转换为标准 Task。官方执行入口是 qit bench run,而 examples/benchmarks/gaia_eval.py 现在只是同一套官方结果契约上的薄包装。

准备工作

1

安装 benchmark 依赖

pip install "qitos[benchmarks]"
2

认证 HuggingFace

GAIA 是 gated dataset。先在 huggingface.co/datasets/gaia-benchmark/GAIA 申请访问,再设置:
export HF_TOKEN="hf_..."
3

设置模型 API key

export OPENAI_API_KEY="sk-..."
export OPENAI_BASE_URL="https://api.siliconflow.cn/v1/"

加载任务

from qitos.benchmark import GaiaAdapter

adapter = GaiaAdapter()
records = adapter.load_huggingface_records(split="validation")
tasks = adapter.to_tasks(records, split="validation", limit=10)
也可以使用一行式 loader:
from qitos.benchmark.gaia.adapter import load_gaia_tasks

tasks = load_gaia_tasks(split="validation", limit=20)
如果你已经下载了本地快照,也可以从磁盘加载,避免重复请求 HuggingFace。

运行评测

优先使用官方 CLI:
qit bench run \
  --benchmark gaia \
  --split validation \
  --limit 50 \
  --root data/gaia \
  --output results/gaia_validation.jsonl \
  --model-name "Qwen/Qwen3-8B"
然后继续做聚合与检查:
qit bench eval --input results/gaia_validation.jsonl --json
qita board --logdir runs
如果你想看 benchmark 专用的参考 wrapper,再使用 examples/benchmarks/gaia_eval.py 运行单个任务:
python examples/benchmarks/gaia_eval.py \
  --gaia-split validation \
  --gaia-index 0 \
  --max-steps 16 \
  --model-name "Qwen/Qwen3-8B" \
  --api-key "$OPENAI_API_KEY"
运行完整 benchmark:
python examples/benchmarks/gaia_eval.py \
  --run-all \
  --gaia-split validation \
  --limit 50 \
  --concurrency 4 \
  --output-jsonl results/gaia_validation.jsonl \
  --trace-logdir runs \
  --model-name "Qwen/Qwen3-8B" \
  --api-key "$OPENAI_API_KEY"

agent 结构

评测脚本会构造一个 ReAct 风格的 web research agent,通常组合:
  • browser tools
  • file reading
  • command execution
  • ReActTextParser
由于 adapter 产出的还是标准 Task,你也可以替换成自己的 AgentModule

结果如何检查

GAIA 结果文件通常包含:
  • task_id
  • question
  • reference_answer
  • prediction
  • stop_reason
  • steps
  • latency_seconds
  • trace_run_dir
然后直接用 qita 检查:
qita board --logdir runs
qita replay --run runs/<run_id>