Skip to content
text
# Related Code
- `dai_bench/cli/main.py`
- `dai_bench/cli/run.py`
- `dai_bench/cli/setup.py`
- `pyproject.toml`
- `examples/local/README.md`

快速上手

前置条件

  • Python 3.10 ~ 3.13
  • 可用的 vLLM 运行环境(GPU 资源 + 模型)
  • 可选: Kubernetes 集群(使用 server mode + K8s launcher 时)

3 分钟跑通

  1. 安装(推荐 uv
bash
uv pip install -e .
# 或
python -m pip install -e .
  1. 创建项目
bash
dai-bench setup --name demo
cd outputs/demo
  1. 运行实验
bash
dai-bench run --experiment 01

运行逻辑会优先从当前目录向上寻找 setup/config.yaml,因此建议在项目目录内执行。

Server Mode(本地)

如果需要自动启动服务,请参考 examples/local

bash
cp examples/local/* outputs/demo/experiments/01/treatment/
cd outputs/demo
chmod +x experiments/01/treatment/run.sh experiments/01/treatment/stop.sh

dai-bench run --experiment 01 --server

期望输出

  • 终端输出包含 “Starting benchmark” 与结果摘要
  • 结果目录位于 outputs/<project>/results/<experiment>/<model_or_treatment>/
  • 每个 stage 会生成 JSON 与 benchmark_report_*.yaml

第一个小时该看哪里

  • 入口: dai_bench/cli/main.py
  • 配置: dai_bench/core/config.py
  • 执行: dai_bench/core/runner.py
  • Runner: dai_bench/runners/vllm_bench.py
  • 示例: examples/(local / k8s / k8s-serve)