Introduction

When calling a local LM Studio Vision model with DeepSeek Harness (DSH), you may frequently encounter the error 400: 'url' field must be a base64 encoded image. This is usually because the local model has specific requirements for image formats (such as preferring JPEG), while the format sent by default by DSH (such as WebP) is not supported. This plugin automatically intercepts and converts the image format before the request is sent to the Provider, ensuring that the model can receive the image properly.

Plugin Overview

The plugin is maintained by M0R1C and aims to fix image format compatibility issues for local Vision models. It works through DSH’s llm/stream hook and performs format conversion and preprocessing on image attachments in messages before requests leave DSH.

Core Features

  1. Real-time format conversion: Supports converting images to JPEG, PNG, or WebP before sending, resolving format incompatibility issues with local models.
  2. UI management interface: Provides a graphical interface, allowing specific models’ conversion features to be quickly enabled or disabled via checkboxes.
  3. Flexible filtering: Supports filtering Providers and models using wildcard patterns (such as lmstudio/*) for fine-grained control.
  4. Parameter configuration: Allows configuring image quality, compression level, and maximum size to prevent oversized images from causing processing failures.
  5. Plugin compatibility: Compatible with plugins such as dsh-plugin-wallpaper-engine, preventing duplicate processing of the same request through the WeakSet mechanism.

Installation

Install using the official CLI:

dsh plugin --profile web add github:MORIC/dsh-vision-fix-lmstudio

Usage

  1. Open DeepSeek Harness Desktop.
  2. Go to Settings → Image Format.
  3. Check the models in the list that require image format conversion.
  4. Use the Enable / Disable buttons to batch-control models in the same group.
  5. Enter a wildcard pattern (such as lmstudio/*) in the search box or Additional Templates to filter or exclude models.

Configuration

Currently, advanced settings require directly editing the cordis.patch.yml file. The following is a configuration example:

- insert:
    - id: image-format-converter
      name: 'dsh-image-format-converter'
      config:
        targetFormat: jpeg       # jpeg | png | webp
        jpegQuality: 90          # 1..100
        pngCompression: 6        # 0..9
        webpQuality: 85          # 1..100
        convertOversized: true   # 是否转换过大图片
        maxDimension: 2048       # 最大边长,像素

After modifying the configuration, DSH must be restarted.

Environment Requirements

  • DeepSeek Harness: 0.1.2-rc.1 or later
  • Node.js: >= 20

Summary

After installation and configuration, DSH automatically handles image format conversion without manual intervention. This plugin is suitable for scenarios where local Vision models need to be called and format compatibility issues exist. For more details, see the GitHub repository.