Preface¶
DeepSeek Harness (DSH) adheres to the “everything is a plugin” design philosophy, aiming to solve concrete engineering problems through extensible capabilities. In the realm of model deployment, a core pain point is: models perform well in a development environment, but do they meet actual performance requirements on target hardware? dsh-model-deploy is designed to answer this question through benchmarking. Maintained by ethanrise, the plugin focuses on performance evaluation of ONNX models on local and remote real hardware.
Features¶
The plugin offers a complete pipeline from static inspection to real-world performance testing:
- ONNX Static Inspection: Analyzes model inputs and outputs, shapes, Opset version, parameter count, operator list, model size, and dynamic input detection.
- Deployment Environment Probing: Detects OS, CPU, memory, NVIDIA GPUs, and execution providers supported by ONNX Runtime.
- Local Benchmarking: Runs benchmarks locally using ONNX Runtime, including warm-up, average latency, P50/P95/P99 latency, and FPS.
- Agent-less SSH Benchmarking: Copies a lightweight runner and the model to a temporary directory on a remote target (e.g., a Linux workstation or Jetson device) to execute tests, collects JSON results, and performs automatic cleanup.
- Deployment Gate Validation: Validates whether test results pass configured thresholds (e.g., minimum FPS, maximum P95 latency, maximum model size).
- DSH/MCP Tools: Provides integrated tools for model inspection, environment probing, local benchmarking, and remote SSH preflight checks.
Installation¶
Install the plugin within DeepSeek Harness:
- Open Plugins -> Add plugin.
- Enter the plugin address:
https://github.com/ethanrise/dsh-model-deploy
- Restart DSH to complete registration.
Dependencies¶
The plugin relies on the Python runtime. Install required Python packages:
pip install numpy onnx onnxruntime psutil
- CPU Inference: Uses standard
onnxruntime. - GPU Execution: Requires compatible
onnxruntime-gpuand the corresponding CUDA/cuDNN libraries. If GPU libraries fail to load, the plugin reports an error instead of falling back to CPU. - Remote Targets: SSH-connected machines must have
python3,numpy, andonnxruntimeinstalled.
Usage¶
The plugin provides both a command-line interface (CLI) and DSH integrated tools.
1. Inspect a Model¶
View static model information:
dsh-model-deploy inspect model.onnx
2. Probe the Environment¶
View runtime environment details of the current machine:
dsh-model-deploy env
3. Local Benchmarking¶
Run benchmarks locally with a specified number of runs:
dsh-model-deploy bench model.onnx --runs 100
4. Set Deployment Constraints¶
Define gate thresholds during benchmarking; e.g., require FPS ≥ 30, P95 latency ≤ 35 ms, and model size ≤ 200 MB:
dsh-model-deploy bench model.onnx --min-fps 30 --max-p95-ms 35 --max-model-mb 200
5. Remote Benchmarking¶
Run tests on a remote target using an SSH alias:
dsh-model-deploy remote-bench orin-dev model.onnx --runs 100
DSH Tools¶
MCP tools registered by the plugin include:
* model_inspect
* deployment_environment
* benchmark_local
* ssh_preflight
* benchmark_remote_ssh
Parameter Notes¶
benchmark_localandbenchmark_remote_sshsupport theinputShapesparameter (e.g.,{"images": [1, 3, 640, 640]}) anddefaultDynamicDimfor models with dynamic inputs.- Gate parameters include
minFps,maxP95Ms,maxModelMb, andrequireProvider. - The result report indicates the execution provider actually used by ONNX Runtime. If a fallback occurs (e.g., CUDA is available but fails to load), it marks
provider_fallbackand records the reason. - SSH credentials are handled via standard SSH configuration or ssh-agent and are not passed as parameters.
Notes¶
- Environment Detection, Not Modification: The plugin is intended to detect the existing environment and does not modify system configurations on remote targets.
- V0.1 Limitations: The current version (V0.1) does not support TensorRT, Docker, OpenVINO, TFLite, RKNN, or NCNN backends. Future versions plan to add TensorRT support.
- Python Interpreter Selection: The plugin searches for a usable Python environment in order: the interpreter specified by the
DSH_MODEL_DEPLOY_PYTHONenvironment variable, thenpython3orpython, and finally conda/miniforge environments in the user directory.
Resources¶
- Plugin Directory: dsh-model-deploy - SkillHub
- GitHub Repository: ethanrise/dsh-model-deploy