AI Agent Hub
Back to plugins
🤖

dsh-image-base64

Model Inference Updated 2026.09.12

Run the following command in DeepSeek Harness:

dsh plugin install pureexe/dsh-image-base64

Paste the following prompt into your AI chat to install this plugin:

Run dsh plugin install pureexe/dsh-image-base64 in DeepSeek Harness to install this plugin; the source is available at https://github.com/pureexe/dsh-image-base64

About this plugin

When routing vision-model requests through an OpenAI-compatible gateway that enforces a strict MIME whitelist—LM Studio being the most common offender—screenshots or PNGs with an alpha channel get re-encoded to WebP upstream, and the gateway rejects the payload with a 400 before it ever reaches the model.

This plugin wraps the attachment store's readImageRequest() call (the exact point where dsh-llm-pi-ai fetches bytes and MIME type for the wire) and transcodes the result to PNG via sharp only when the media type falls outside an accepted list (image/png, image/jpeg, image/gif by default). Already-accepted formats pass through untouched, so the transcode cost is paid exclusively by images that would otherwise be rejected.

It is designed for anyone whose vision pipeline goes through a gateway with a rigid MIME whitelist, particularly LM Studio users who paste screenshots or attach transparent PNGs. If your gateway does accept WebP, you can narrow the acceptedMediaTypes list via a patch layer to skip the redundant PNG re-encode.

Use Cases

  • Screenshots rejected with 400 when calling vision models through an LM Studio gateway
  • Transparent PNG pastes blocked because upstream encodes them as WebP
  • Automatically adapting DSH attachment layer to strict MIME whitelists on OpenAI-compatible gateways

Best For

  • DSH users routing vision models through LM Studio
  • Developers sending multimodal requests via OpenAI-compatible gateways
  • Ops teams hitting MIME whitelist rejections and needing a quick fix