dsh-agnes-gen: Integrating Agnes Text-to-Image and Text-to-Video into DSH

Preface

When building agents in DeepSeek Harness (DSH), a common requirement is to have the model generate images or short videos directly, rather than just returning text descriptions. Encapsulating the Agnes API yourself involves handling details such as site-specific keys, RPM limits hitting 429 errors, concurrent session counting, and video-to-GIF conversion, which is a significant workload.

Below is an introduction to the community plugin dsh-agnes-gen (Maintainer: Ylhow06, Category: Model Inference). It registers Agnes’s image and video capabilities as DSH-visible tools agnes_image and agnes_video, and includes built-in cross-process RPM rate limiting, 429 backoff, and local ffmpeg GIF conversion. It is suitable for developers already using DSH who hold an Agnes API Key.

What is this

dsh-agnes-gen is a bundle plugin for DSH (current version 0.1.3, MIT License), not a standalone script. Once installed to a specific profile, the two tools can be invoked in every session and workspace under that profile.

The plugin depends on the host DSH’s bundled @deepseek-ai/dsh-tools and @deepseek-ai/schemastery (declared in peerDependencies), requiring no manual installation. Node engine requirement: ^22.19.0 || >=24.0.0.

SkillHub is a community plugin directory and has no official affiliation with DeepSeek or High-Flyer.

Core Features

Two Model Tools

Tool Capability Summary
agnes_image Text-to-image, Image-to-image, Multi-image composition
agnes_video Text-to-video, First/Last frame animation, Image-to-video

Requests and Local Processing

  • Cross-process RPM Rate Limiting: A local sliding window quota pool counts total usage across multi-session and multi-process concurrency, reducing the probability of triggering Agnes 429 errors.
  • 429 Backoff: Waits according to the server’s Retry-After (capped at 120 seconds) to avoid invalid retries.
  • GIF Conversion: Video-to-GIF conversion uses local ffmpeg without extra billing; if ffmpeg is not installed, it degrades to returning only mp4.
  • Site-specific Keys: Two sets of keys for the China site (cn) and International site (intl) are stored separately and are not interchangeable.
  • GUI Configuration: Configure site, API Key, RPM presets, model whitelists, ffmpeg path, etc., in the DSH Web GUI “Plugins” page. (DSH 0.1.6 uses the plugin’s built-in config card; 0.1.7 and later use the native DSH form, with identical field meanings).
  • Built-in Skills: Includes agnes-image and agnes-video skills to guide the AI in correctly invoking the tools.

DSH Version Compatibility

DSH Version Status Action Required
0.1.x starting from 0.1.6-alpha.2 (including subsequent alpha / rc / stable) Supported None
0.2.x starting from 0.2.0-rc.1 (including subsequent rc / stable) Supported (Plugin 0.1.2+ required) Upgrade plugin to 0.1.2 or higher
Older than 0.1.6-alpha.2 Not Supported Submit an issue to the repository

Upgrading DSH within the same 0.x line (e.g., 0.1.7-rc.1 → 0.1.8-alpha.1) generally does not require plugin changes. Configuration changes take effect immediately; no restart is required for supported versions.

Installation and Activation

The plugin runs in all three DSH interfaces: Web, Desktop, and TUI.

Open DSH Web GUI → Sidebar “Plugins” → Top right “Add Plugin”, enter dsh-agnes-gen in the input box, click “Install”, then click “Enable Now”.

The input box also accepts GitHub repository addresses or absolute paths to local source directories; for this plugin, the package name is sufficient.

Command Line

Select by profile:

dsh plugin --profile web add dsh-agnes-gen
dsh plugin --profile desktop add dsh-agnes-gen
dsh plugin --profile dsh-tui add dsh-agnes-gen

After installation: Start Web with dsh web, others with dsh --profile <profile>.

You can also install from GitHub source:

dsh plugin --profile web add github:Ylhow06/dsh-agnes-gen

Uninstall example:

dsh plugin --profile <profile> remove dsh-agnes-gen

Applying for API Key and Configuration

The plugin does not apply for keys on your behalf. After creating a key on the Agnes platform, select the site and fill in the corresponding key on the plugin page:

Site site Application URL
China Site (Default) cn https://platform.agnes-ai.cn/settings/apiKeys
International Site intl https://platform.agnes-ai.com/settings/apiKeys

Keys from the two sites are not interchangeable; site and Key must match, otherwise an error will report that the key for the corresponding site was not found.

DSH 0.1.6.x can write the agnes-gen: section in settings.yaml, for example:

agnes-gen:
  site: cn
  apiKeyCn: sk-...
  plan: free
  rateLimit: true
  outDir: ''

DSH 0.1.7.x and newer (including 0.2.x) configuration is located under the config: entry of the plugin in the current profile’s cordis.patch.yml, with the same field names. Common items include site, apiKeyCn / apiKeyIntl, plan (free / enterprise / token-plan), rateLimit, ffmpegPath, outDir, image/video models for each site, and whitelists. See the “Configuration” section in the repository README for full details.

Typical Usage

After configuration, the AI can automatically select tools during conversation; you can also explicitly write calls in the conversation, for example:

agnes_image(prompt="A glowing floating city above a sunrise misty canyon, cinematic realism, wide angle, high visual density")
agnes_video(prompt="Three cats forming a mini brass band marching forward in a night forest", seconds=5, gif=true)

Output Location

  • Images default: out/agnes-images under the session working directory (use outDir to change the root directory).
  • Videos default: out/agnes-videos.
  • When passing output_name, use a pure filename (no timestamp); if not passed, it is named “Timestamp + first 16 characters of prompt”. Repeated pure names in the same directory will be overwritten; it is recommended to give different output_name for multiple generations.

For agnes_video with gif=true, conversion happens locally. Parameters like gif_width and gif_fps can be adjusted; keep_mp4 controls whether to retain the mp4 after GIF conversion.

Use Cases and Notes

Suitable for: Teams or individuals already developing agents in DSH who need Agnes image/video generation and want rate limiting and local GIF processing to be ready out of the box.

Recommendations before installation: The plugin runs with the permissions of the current DSH process. Before installing, you should review the source code and MIT License of the GitHub repository to ensure compliance with your security and compliance requirements. API Keys are confidential fields; do not commit them to version control.

If you encounter peer mismatch during installation or the plugin does not appear in the interface list, it is likely that the current DSH version is not within the scope of the adaptation table in the README. You can report this in the repository issues.

Conclusion

dsh-agnes-gen exposes Agnes’s agnes_image and agnes_video as DSH tools and handles engineering details such as site-specific keys, RPM rate limiting, 429 backoff, and ffmpeg GIF conversion. For trial use or parameter tables, please refer to the SkillHub Directory Page and the GitHub README.

羽毛球分组比赛记分
小程序二维码

欢迎使用《羽毛球分组比赛记分》微信小程序

Xiaoye