跳到主要内容

Miner CLI 配置

本文档描述 miner-cli 的 YAML 配置格式。配置会被解析为 DeploymentConfig 后再渲染 Docker Compose。

核心字段​

字段必填默认值说明
name是无部署名和 Compose service 名
engine是无vllm 或 sglang
model是无Hugging Face model id 或 engine 模型路径
image否engine 默认运行时 Docker 镜像
host否0.0.0.0容器内运行时绑定地址
port否8000运行时 API 端口
tensor_parallel否1Tensor parallel 度数
gpu_ids否allDocker GPU 选择器
trust_remote_code否true添加运行时 trust flag
dtype否bfloat16运行时 dtype
max_model_len否无最大上下文长度
api_key否无可选运行时 API key
hf_token_env否HF_TOKEN写入部署 .env 的宿主机环境变量名
hf_cache否/data/huggingface模型缓存路径
shm_size否16g容器共享内存大小
extra_args否[]额外 engine CLI 参数
env否{}额外运行时容器环境变量
extra_services否{}追加到 Compose services 下的服务

示例配置​

name: qwen72b
engine: vllm
model: Qwen/Qwen2.5-72B-Instruct
image: vllm/vllm-openai:latest
host: 0.0.0.0
port: 8000
tensor_parallel: 8
gpu_ids: all
trust_remote_code: true
dtype: bfloat16
max_model_len: 32768
hf_token_env: HF_TOKEN
hf_cache: /data/huggingface
shm_size: 16g
extra_args:
- --max-num-seqs
- "16"
env: {}

DCGM Exporter Sidecar​

dcgm_exporter:
enabled: true
gpus: all

默认指标地址:http://dcgm-exporter:9400/metrics

Miner Agent Sidecar​

通过 miner_client 启用 miner-agent sidecar:

miner_client:
enabled: true
image: bttinfergrid/miner-client:latest
listen_host: 127.0.0.1
listen_port: 8080
public_ip: miner.example.com
gpus: all
volumes:
- /data/minerhome:/root/.miner
environment:
LOG_LEVEL: info
MAIN_API_BASE_URL: https://main-api.example.com
MINER_TOKEN: replace-me
MINER_TARGET_MODEL: Qwen/Qwen2.5-72B-Instruct
MINER_HOME: /root/.miner
MINER_RUNTIME_TYPE: vllm
提示

启用后,miner-cli 会注入默认环境变量,包括 MODELDOCK_DEPLOYMENT_NAME、MINER_RUNTIME_TYPE、MINER_HTTP_HOST、MINER_HTTP_PORT、MINER_PUBLIC_IP、MINER_VLLM_BASE_URL,以及启用 DCGM 时的 MINER_DCGM_METRICS_URL。

必填字段

miner_client.enabled=true 时必须设置 miner_client.image 和 miner_client.public_ip。

兼容性​

custom_service 仍作为 miner_client 的历史别名被接受。同一配置中不要同时设置两者。

相关文档​