Introduction

When a DeepSeek Harness (DSH) agent needs to generate images in a conversation, developers typically already have some OpenAI-compatible image generation endpoints, but the model names, request paths, and available model lists of different services are inconsistent. dsh-draw-router is a DSH plugin aimed at consolidating such drawing capabilities into agent tools: registering draw_image and draw_list_sources, automatically discovering available image models, and allowing the agent to call them directly in the conversation.

What is this

dsh-draw-router is the DeepSeek Harness unified drawing router: automatically identifying image models from any OpenAI-compatible endpoint. Maintained by xiaozhe7772222, licensed under MIT. It encapsulates image generation into tools callable by DSH agents, while also providing a REST API to manage draw sources and initiate drawing requests.

Environment Info

  • Package version: 0.1.1
  • Node: >= 18
  • DeepSeek Harness: 0.1.0--rc.6

The three items above come from the README badge and version information in package.json.

Core Features

Below are the verified functional points.

Agent Tools

The plugin registers two agent tools:

  • draw_image: generate images in the conversation
  • draw_list_sources: view available drawing sources

A DSH agent can natively call draw_image during a conversation. For example, when a user asks “Help me draw a flowchart showing the API call process,” the agent can call something like:

draw_image(source='sensenova', prompt='...')

Automatic Model Discovery

The plugin calls:

GET /v1/models

and automatically detects image models based on name pattern matching, without relying on a fixed model list. The plugin supports manually adding models, which is suitable for services that do not expose image models through /v1/models.

Multi-Provider

The plugin supports the following OpenAI-compatible endpoints or providers: SenseNova, StepFun, Agnes, Qwen/Tongyi Wanxiang, Jimeng/Seedream, Hunyuan, GPT Image, Flux, Stable Diffusion, Imagen, etc.

When configuring baseURL, provide the API root, and the plugin automatically appends:

/images/generations
/models

REST API

The plugin provides a REST API that can be used to add, delete, or probe draw sources. The drawing interface is:

POST /dsh-draw-router/draw

An example of the source verification interface:

curl http://127.0.0.1:3080/dsh-draw-router/sources

API responses do not expose the full API key.

Configuration Persistence

Configuration is persisted to:

draw-config.json

This allows you to continue using the configured draw sources after a restart.

Installation and Enablement

First add the plugin, then restart DSH, and finally verify the HTTP service.

Add Plugin

If the plugin has been published to the npm registry, you can run:

dsh plugin add dsh-draw-router --profile web

Restart DSH

npx @deepseek-ai/dsh web

Verify HTTP Service

curl http://127.0.0.1:3080/dsh-draw-router/sources

If the plugin has started, you can view the sources list.

Typical Usage

Conversation Invocation

Below is a conversation example:

User: 帮我画一张流程图,展示API调用过程
Agent: 调用 draw_image(source='sensenova', prompt='...')

This example demonstrates that the agent completes drawing by calling the specified source via draw_image.

Static Configuration

Static configuration is done via cordis.patch.yml by configuring sources. For example, configuring baseUrl and apiKey for stepfun, sensenova, and agnes:

sources:
  stepfun:
    baseUrl: <stepfun-base-url>
    apiKey: <stepfun-api-key>
  sensenova:
    baseUrl: <sensenova-base-url>
    apiKey: <sensenova-api-key>
  agnes:
    baseUrl: <agnes-base-url>
    apiKey: <agnes-api-key>

Placeholders are used here to avoid writing real keys in the documentation. In the configuration, baseURL should just provide the API root.

Runtime Management

You can also manage draw sources via the REST API and initiate drawing using POST /dsh-draw-router/draw.

Applicable Scenarios and Notes

Suitable for users who already have OpenAI-compatible image generation endpoints and want DSH agents to draw directly in conversations. It is suitable for consolidating multiple image APIs into a single DSH workflow, reducing coupling on the agent side regarding model names and request details.

Please note the following points:

  • The plugin runs with the permissions of the current DSH process. It is recommended to check the source code, dependencies, and license before installing.
  • The configuration saves baseUrl and apiKey; draw-config.json and related configuration files should be treated as sensitive information.
  • API responses do not expose the full API key, which does not imply that the key is completely invisible locally.
  • The DSH plugin ecosystem emphasizes “everything is a plugin”; the community directory is for finding plugins, not an official app store.

Getting Information

  • Community Directory: https://www.skillhub.cn/plugins/xiaozhe7772222/dsh-draw-router
  • GitHub: https://github.com/xiaozhe7772222/dsh-draw-router