ds4 icon indicating copy to clipboard operation
ds4 copied to clipboard

Feature request: support DeepSeek-V4-Flash-Vision-Exp

Open Stubborn10086 opened this issue 3 months ago • 2 comments

DeepSeek has released the weights and reference implementation for deepseek-ai/DeepSeek-V4-Flash-Vision-Exp, the first experimental multimodal model in the DeepSeek-V4 family:

https://huggingface.co/deepseek-ai/DeepSeek-V4-Flash-Vision-Exp

Would you consider adding local inference support for this model to ds4?

The model is based on DeepSeek-V4-Flash, but adds a vision encoder, an aligner, and multimodal prompt encoding. The upstream repository provides:

  • MIT-licensed model weights
  • a minimal PyTorch inference implementation
  • vision encoder and aligner implementations
  • prompt encoding examples for OpenAI-style image/text content blocks

Since ds4 already supports DeepSeek-V4-Flash and has a vision path for GLM-5.3-Flash-Vision, this seems potentially aligned with the project's scope, although I understand that the DeepSeek vision architecture may require a separate implementation.

Possible areas of work may include:

  • model conversion / a supported GGUF layout
  • vision encoder and aligner support
  • multimodal prompt encoding
  • CLI and server image input support

Is supporting this experimental model something you would be interested in? If so, it would also be helpful to know which technical information, conversion artifacts, or testing would be most useful from contributors.

Thanks for your work on ds4.

Stubborn10086 avatar Sep 01 '26 04:09 Stubborn10086

Just adding source-verified detail that may help. The weights/GGUFs are already published, so the gap is entirely in the ds4 runtime.

GGUFs already exist in antirez/deepseek-v4-gguf (updated 31.08.2026): DeepSeek-V4-Flash-Vision-Exp-MXFP4Experts-… (145.27 GiB), DeepSeek-V4-Flash-Vision-Exp-Layers37-42Q4KExperts-… (90.88 GiB), DeepSeek-V4-Flash-Vision-Encoder.gguf (0.87 GiB).

What main (ab06d19) does not support:

  1. --vision is GLM-5.3-hardwired — ds4.c rejects non-GLM main models (ds4_die("--vision requires a GLM-5.3 model")).
  2. vision_weights_bind() requires arch glm5-next-vision + exactly 347 tensors (model.visual.* schema); the DeepSeek encoder is arch deepseek4-vision, 316 tensors / 32 blocks → rejected outright.
  3. Preprocessing (ds4_image_preprocess_glm53) and kernels (ds4_glm53_vision_gpu.cuh, metal/glm53_vision.metal) are GLM-specific.

The Vision-Exp main GGUF stays arch deepseek4 but carries deepseek4.checkpoint_variant = vision-exp + deepseek4.vision.sidecar_required = true (both currently ignored by the loader).

So this is a second, independent vision-encoder architecture (encoder + aligner + Metal kernels + preprocessing + sidecar wiring), not a config tweak. Happy to help test on M4 Max 128 GiB with the MXFP4 GGUF once a branch/PR lands. Thanks for ds4.

cropduster avatar Sep 01 '26 08:09 cropduster

Update: DeepSeek V4 Flash vision support has landed in main (fc8bf3c), superseding my earlier comment. Text works on M4 Max/Metal, but image inference currently fails — tracked in #928.

cropduster avatar Sep 01 '26 12:09 cropduster