In the development scenarios of DeepSeek Harness (DSH), letting an AI Agent directly show local images, videos, or audio to users is a common requirement. Older solutions usually relied on a sidebar or a new tab, and making streaming output appear in real time was difficult. The dsh-media-inline-preview plugin solves this pain point by rendering media directly in the chat message stream using fence syntax.
What Is This¶
This is a DSH plugin maintained by seeingrain. It provides three fences (mip-img, mip-video, mip-audio) and covers 36 local media formats. The plugin merges and replaces the previously separate image preview and video/audio fence plugins, achieving true inline rendering so media can be viewed or played without navigating to another page.
Core Features¶
- 36 Format Support: Covers 10 image formats, 7 native video formats, 9 native audio formats, and transcoding formats.
- Three Fences: Uses the
mip-img,mip-video, andmip-audiofences to distinguish media types. - Image Cards and Lightbox: Images are rendered as thumbnail cards, support click-to-fullscreen viewing, zooming, and dragging.
- Native Players: Video/audio are rendered directly as native controls, support mounting during streaming output, and require no sidebar.
- Streaming and Large Files: Supports HTTP Range streaming, keeps memory usage constant for large files, with a 2 GiB limit.
- Transcoding Fallback: Containers that browsers cannot play (such as mkv and avi) automatically trigger ffmpeg transcoding.
- Performance and Caching: Supports ETag/304 conditional requests, lazy loading, and content-addressed caching of transcoding results for 7 days.
- Fences as Markdown: Conversation history natively preserves fences, so media is never lost after a page refresh.
Installation and Enabling¶
Install the plugin and restart the service for it to take effect.
dsh plugin --profile web add github:seeingrain/dsh-media-inline-preview
After installation, the host needs to be restarted, and the client page can be refreshed to load it.
Typical Usage¶
1. Zero-Configuration Automatic Rendering¶
After installation, no configuration is required, and media files appearing in a session are automatically rendered. When generating a reply, the Agent first calls the mip_img / mip_media tools to validate the path and returns a fence; the card or player automatically appears in the message.
2. Manually Written Fences¶
You can also manually write fence syntax:
{"path":"/绝对路径/图片.png","label":"可选标题"}
{"path":"/绝对路径/视频.mp4"}
{"path":"/绝对路径/音乐.mp3"}
3. Notes¶
- Namespace Change: Fence tags are namespaced as
mip-*(starting from v1.4.0). Old bare tags (such asimg,video, andaudio) have been deprecated, are no longer recognized, and remain as plain code blocks. - Title Display: The
labelfield is only used for manually written fence validation; the UI title always displays only the file name. - Multi-Image Grid: Supports the
{"images":[{"path":"..."},{"path":"..."}]}format.
Applicable Scenarios and Limitations¶
- Security Restriction: The host must be loopback or listed in
webRuntime.trustedHosts; cross-site fetching is blocked. - Route Limits: The image route limit is 128 MiB, and the media route limit is 2 GiB.
- Transcoding Cache: Transcoding results are cached by content address for 7 days.
Ecosystem Context¶
The philosophy of DSH is “everything is a plugin.” This plugin is a community plugin and has no official relationship with DeepSeek / Huanfang.
Plugin catalog: https://www.skillhub.cn/plugins/seeingrain/dsh-media-inline-preview
Source code: https://github.com/seeingrain/dsh-media-inline-preview