instance_exec
Runs shell commands over SSH as root inside a GPU instance, returning exit codes and output; supports background execution for long training jobs with log and status tracking.
Instructions
在实例内执行 shell 命令(SSH,root)。部署/操作/训练的核心工具。
前台:返回 exit_code/stdout/stderr;timeout_sec 上限 600s。
background=true:setsid 脱离会话后台运行(训练等长任务),立即返回 pid/log_file/exit_file;用 instance_job(action=status/logs/stop) 跟进。
workdir:先 cd 到该目录(持久数据在 /workspace)。 示例:rocm-smi;pip install -r requirements.txt; background 训练:python train.py --epochs 10。
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"command": "<command>"
},
"name": "instance_exec"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| command | Yes | ||
| workdir | No | ||
| log_file | No | ||
| background | No | ||
| timeout_sec | No |