Runs NPU inference/training tests on a remote SSH server by auto-detecting vllm-ascend Docker images, available NPU devices, and managing container setup.
Ships in remote-npu-test. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
$0 (ssh-host): SSH connection string, e.g., [email protected] or just hostname (required)$1 (image): Docker image name. If not provided, auto-detect the highest version vllm-ascend image on the remote machine$2 (devices): NPU devices to use, e.g., 0,1,2,3. If not provided, detect available devices$3 (test-command): The command to run inside the container. If not provided, enter interactive modessh -o ConnectTimeout=10 -o StrictHostKeyChecking=no $0 "echo 'SSH connection successful'"
If user specified an image ($1 is provided):
ssh $0 "docker images --format '{{.Repository}}:{{.Tag}}' | grep -w '$1'"
If no image specified ($1 is empty):
ssh $0 "docker images --format '{{.Repository}}:{{.Tag}}' | grep 'vllm-ascend' | sort -V -t: -k2 | tail -1"
If user specified devices ($2 is provided):
If no devices specified ($2 is empty):
ssh $0 "npu-smi info -t board 2>/dev/null || npu-smi info 2>/dev/null"
0 and inform the user.Create the Docker container with the required device mappings and volume mounts:
ssh $0 "docker run -d \\
-it \\ #必须
--name $NAME \\
--shm-size=1g \\
--net=host \\
--privileged \\
--device /dev/davinci_manager \\
--device /dev/hisi_hdc \\
--device /dev/devmm_svm \\
$(for d in $(echo $DEVICES | tr ',' ' '); do echo "--device /dev/davinci\$d \\\\"; done) \\
-v /usr/local/Ascend/driver:/usr/local/Ascend/driver \\
-v /usr/local/dcmi:/usr/local/dcmi \\
-v /usr/local/sbin:/usr/local/sbin \\
-v /usr/local/bin/npu-smi:/usr/local/bin/npu-smi \\
-v /etc/ascend_install.info:/etc/ascend_install.info \\
-v /usr/share/zoneinfo/Asia/Shanghai:/etc/localtime \\
-v /home/:/home \\
-v /data:/data \\
-e ASCEND_RT_VISIBLE_DEVICES=$DEVICES \\
-it $IMAGE bash -c '$TEST_CMD'"
Where:
$DEVICES = comma-separated NPU device IDs (e.g., 0,1,2,3)$IMAGE = the resolved Docker image name$TEST_CMD = the user's test command (if provided)$NAME = the docker container name must end with _claudeImportant device mapping rules:
-it/dev/davinci_manager, /dev/hisi_hdc, /dev/devmm_svm/usr/local/Ascend/driver, /usr/local/dcmi, /usr/local/sbin, /usr/local/bin/npu-smi, /etc/ascend_install.info/dev/davinciN where N is the device IDASCEND_RT_VISIBLE_DEVICES environment variable to control which NPUs are visibleIf no test command provided:
-it flag and bash as the command.If the test command fails due to missing dependencies:
Capture the error output and identify missing packages.
Install all missing dependencies inside the container:
docker exec vllm-ascend-env pip install <missing-package-1> <missing-package-2> ... -i $PIP_MIRRORS
Prioritize using the following pip mirror for downloads: https://mirrors.huaweicloud.com/repository/pypi/simple https://pypi.tuna.tsinghua.edu.cn/simple https://mirrors.aliyun.com/pypi/simple/ only cannot find the package on all three above mirrors then can use the default mirrors.
After all dependencies are installed, generate requirements_ai.txt with the complete list of newly installed packages:
docker exec vllm-ascend-env pip freeze > requirements_ai.txt
Copy the requirements file back to the host:
ssh $0 "docker cp vllm-ascend-env:/requirements_ai.txt /tmp/requirements_ai.txt"
scp $0:/tmp/requirements_ai.txt ./requirements_ai.txt
Inform the user about the generated requirements_ai.txt file.
If any errors block the script, you should record and fix that. But keep in mind, there is no need to fix all the problems.
Create or append to report.txt with the following information:
Actively think about solutions:
Report findings to the user with actionable recommendations.
After the test completes (success or failure), generate a comprehensive summary report and save it to report.txt:
Collect all execution information:
Record test results:
Document issues and fixes:
Write the report in the following format:
ssh $0 "cat > /home/l00910600/report.txt << 'EOF'
================================================================================
NPU Test Execution Report
================================================================================
【基本信息】
执行时间: $START_TIME ~ $END_TIME
总耗时: $DURATION
服务器: $SSH_HOST
Docker 镜像: $IMAGE
NPU 设备: $DEVICES (设备名称: $DEVICE_NAME)
容器名称: $CONTAINER_NAME
【测试脚本】
脚本路径: $TEST_SCRIPT
测试命令: $TEST_CMD
【推理结果】
$(for each processed file):
文件: $FILENAME
$OUTPUT(the full output of the target script)
【依赖安装】
$(list all installed packages)
【代码修改】
$(list all code changes made):
1. $FILE_PATH:$LINE - $DESCRIPTION
2. ...
【警告信息】
$(list any warnings):
- $WARNING_1
- $WARNING_2
【输出文件】
结果保存路径: $OUTPUT_PATH
requirements 文件: $REQUIREMENTS_PATH
================================================================================
报告生成时间: $REPORT_TIME
================================================================================
EOF"
Also save the report locally (optional):
scp $0:/home/l00910600/report.txt ./report_$(date +%Y%m%d_%H%M%S).txt
Display summary to user:
SSH Connection Test
│
▼
┌────┴────┐
│ Connected?│
└────┬────┘
Yes│ No → Report & ask user
▼
Detect/Validate Image
│
▼
Detect NPU Devices
│
▼
Create Docker Container
│
▼
Run Test Command
│
▼
┌────┴────┐
│ Success? │
└────┬────┘
Yes│ No → Check error type
│ │
│ ┌────┴────┐
│ │Dep issue?│
│ └────┬────┘
│ Yes│ No → Record in report.txt
│ ▼
│ Install deps
│ Generate requirements_ai.txt
▼
┌─────────────┐
│ Step 7: │
│ Generate │
│ Summary │
│ Report │
└──────┬──────┘
│
▼
┌─────────────┐
│ Write to │
│ report.txt │
│ on server │
└──────┬──────┘
│
▼
Display Results
to User
-o ConnectTimeout=10 and -o StrictHostKeyChecking=no for SSH commandsset -e in shell scripts to fail fast on errorstr ',' ' ' to convert comma-separated device list to space-separated for iterationpip install over pip3 install inside Docker containers (usually the default)--rm flag handles this)scp to transfer files between local and remote machinesreport.txt rather than overwriting to preserve error history/npu-test [email protected]
This will SSH to the server, find the highest version vllm-ascend image, detect available NPUs, and enter interactive mode.
/npu-test [email protected] vllm-ascend:v0.7.3 0,1,2,3 "python /data/test_model.py"
This will use the specified image, devices 0-3, and run the test script.
/npu-test [email protected] "" all "python benchmark.py --model /data/models/llama"
This will auto-detect the image, use all available NPUs, and run the benchmark command.
What SKILL.md sets; muted values are Claude Code's defaults
User mentions "NPU test", "NPU inference", "Ascend test", "vllm-ascend", "NPU training", or asks to run model tests on a remote server with NPU devices.
Three short reads, in order
/remote-npu-test:remote-npu-test <ssh-host> [image] [devices] [test-command]from remote-npu-test
npx claudepluginhub ascend-ai-coding/awesome-ascend-skills --plugin remote-npu-testOther plugins' skills for the same job