本文档使用 AI 翻译
- 创建空分支
未初始化
git init
git branch -m docs已存在项目
git switch --orphan docs- 首次提交
git add README.md
git commit -am init
git push origin docs- 拉取上游源码
mkdir -p docsite
pushd docsite
git init
git remote add upstream https://github.com/vllm-project/vllm.git
git reset --hard
git fetch upstream main
git merge upstream/main
git rev-parse --short HEAD > ../commit.txt
popd- 复制源文档
rm -rf docs
cp -r docsite/docs .
# cp -r docsite/content .
# mv content docs- 全量翻译
aitr- 本地测试与构建
git clone https://github.com/vllm-project/vllm.git docsite
cp -r docs_zh/* ./docsite/docs
# cp -r docs_zh/* ./docsite/content
cd docsite- 启动或构建
uv venv
uv pip install -r requirements/docs.txt
uv run mkdocs serve- 安装 CLI 工具 (增量更新直接使用 AI CLI 工具直接对比)
curl -L https://fx4.cn/aitr | bash- 设置环境变量
config.toml
...
[[providers]]
enabled = true
name = "grok"
api_key = "xxx"
base_url = "https://api.x.ai/v1"
model = "grok-3"
concurrency = 1 # 线程数
rate_delay = 3.0 # 每个请求后等待 1.0 秒(可根据限流调整)- AI 翻译
aitr