DeepSeek Harness: Multimodal Support
Last updated: 2026-08-31
Text is just one way for an Agent to understand the world — images, audio, and video are the language of the real world. DSH's multimodal support lets the Agent not just "read code" but also "see interfaces," "hear feedback," and "watch videos," greatly expanding the Agent's perception boundaries.
📋 Prerequisites: Completed 06-tools.md, familiar with the tool system basics
1. What You'll Learn
- DSH multimodal architecture overview
- Image input processing methods
- Audio/video input support status
- Multimodal tool integration
- File attachment and parsing mechanisms
2. Multimodal Architecture Overview
(1) Multimodal Data Flow
graph TB
subgraph Input Sources
IMG[Image<br/>PNG/JPG/WebP]
AUD[Audio<br/>MP3/WAV]
VID[Video<br/>MP4/WebM]
DOC[Documents<br/>PDF/CSV]
end
subgraph DSH Processing
PARSE[Attachment Parser]
ENCODE[Multimodal Encoding]
LLM[LLM Multimodal Reasoning]
end
subgraph Output
TEXT[Text Reply]
TOOL[Tool Calls]
end
IMG --> PARSE
AUD --> PARSE
VID --> PARSE
DOC --> PARSE
PARSE --> ENCODE
ENCODE --> LLM
LLM --> TEXT
LLM --> TOOL
(2) Multimodal Support Matrix
| Input Type | Format Support | Stability | Max Size | Notes |
|---|---|---|---|---|
| Image | PNG, JPG, WebP, GIF | ✅ Stable | 20MB/image | Most mature multimodal capability |
| Audio | MP3, WAV, OGG | ⚠️ Experimental | 50MB | Requires audio-capable model |
| Video | MP4, WebM | ⚠️ Experimental | 100MB | Frame-by-frame extraction analysis |
| Document | PDF, CSV, XLSX | ✅ Stable | 50MB | Text extraction + structuring |
(3) Model Requirements
Multimodal features depend on the LLM's multimodal capabilities:
| Model | Image | Audio | Video | Document |
|---|---|---|---|---|
| deepseek-chat | ✅ | ❌ | ❌ | ✅ |
| gpt-4o | ✅ | ✅ | ✅ | ✅ |
| gpt-4-vision | ✅ | ❌ | ❌ | ✅ |
| claude-3.5-sonnet | ✅ | ❌ | ❌ | ✅ |
3. Image Input Processing
(1) Adding Images in Web UI
In the Web UI chat area, you can add images by dragging or pasting:
┌─ Chat Area ──────────────────────────────┐
│ │
│ 👤 Alice: │
│ 📎 [screenshot.png] [ui-mockup.jpg] │
│ Which of these two UI designs is better? │
│ │
│ [Send] │
└───────────────────────────────────────────┘
Supported operations:
- Drag and drop images into the chat area
- Paste images from clipboard (Ctrl+V)
- Click the attachment button to select files
- Maximum 5 images per message
(2) Adding Images in CLI Mode
▶ Example 1: Attaching Images in CLI Mode
# Start CLI with attached image
dsh cli --attach ./screenshot.png
# Use /attach command during conversation
> /attach ./ui-mockup.jpg
> What's wrong with this UI?
# Attach multiple images
> /attach ./before.png ./after.png
> What's the difference between these two versions?
(3) Attaching Images via SDK
▶ Example 2: Sending Images with Python SDK
from dsh import DSHClient
client = DSHClient(base_url="http://127.0.0.1:3080")
session = client.create_session(workspace="/home/alice/project")
# Attach a single image
response = session.send(
"What's wrong with this UI screenshot?",
images=["./screenshot.png"]
)
print(response.content)
# Attach multiple images for comparison
response = session.send(
"Compare these two designs, which is better?",
images=["./design-a.png", "./design-b.png"]
)
(4) Image Analysis in Practice
▶ Example 3: UI Bug Analysis
👤 Alice: [attaches error-page-screenshot.png]
What's wrong with this error page? Help me fix it
🤖 Agent:
🔍 Analyzing image...
I see the following issues:
1. Error message text overflows the container boundary
2. The "Retry" button is truncated, only showing half
3. Background color is inconsistent with the design spec (should be #f5f5f5, not white)
📝 Using tool: file_edit (edit)
→ Path: src/pages/ErrorPage.tsx
→ Fix 1: Add text-overflow: ellipsis
→ Fix 2: Adjust button margin
→ Fix 3: Change background color
⚠️ Approval Required: Edit file src/pages/ErrorPage.tsx
(5) Image Processing Limitations
| Limitation | Description |
|---|---|
| Max per image | 20MB |
| Max per message | 5 images |
| Resolution | Recommended not exceeding 4096×4096 |
| Animated GIF | Only the first frame is used |
| Format conversion | Automatically converted to model-supported format |
4. Audio/Video Input
(1) Audio Input (Experimental)
Audio input requires a model that supports audio understanding (e.g., GPT-4o):
▶ Example 4: Sending Audio via SDK
# Send an audio file
response = session.send(
"Transcribe this audio and summarize the key points",
audio=["./meeting-recording.mp3"]
)
print(response.content)
# Audio transcription results and summary...
(2) Video Input (Experimental)
Video processing uses a frame extraction strategy:
graph LR
VID[Video File] --> EXTRACT[Frame Extraction<br/>1 frame/second] --> SELECT[Key Frame Selection<br/>Scene Change Detection] --> ENCODE[Multi-frame Encoding] --> LLM[LLM Analysis]
▶ Example 5: Sending Video via SDK
# Send a video file
response = session.send(
"Analyze this demo video, list the features shown",
video=["./demo.mp4"]
)
print(response.content)
# 1. User login feature (0:00-0:15)
# 2. Dashboard display (0:15-0:45)
# ...
(3) Current Limitations
Audio and video features are still in the experimental stage:
| Limitation | Audio | Video |
|---|---|---|
| Max duration | 10 minutes | 5 minutes |
| Max file size | 50MB | 100MB |
| Model requirement | GPT-4o etc. | GPT-4o etc. |
| Frame extraction | — | 1 frame/second, max 300 frames |
| Stability | ⚠️ May timeout | ⚠️ May timeout |
5. Document Attachments and Parsing
(1) Supported Document Formats
| Format | Parsing Method | Output |
|---|---|---|
| Text extraction + OCR | Structured text | |
| CSV | Parse rows and columns | Table data |
| XLSX | Parse worksheets | Table data |
| DOCX | Text extraction | Structured text |
| Markdown | Direct reading | Raw text |
▶ Example 6: Attaching a PDF File
# Analyze a PDF document
response = session.send(
"Summarize the core points of this technical document",
files=["./api-specification.pdf"]
)
print(response.content)
(2) CSV Data Analysis
▶ Example 7: Analyzing CSV Data
# Analyze CSV data
response = session.send(
"Analyze this sales data, find trends and outliers",
files=["./sales-2026.csv"]
)
print(response.content)
# Data analysis results...
The Agent can also further process with tools:
🤖 Agent:
📊 Analyzing CSV data...
→ Rows: 12,450
→ Columns: 8
→ Date range: 2026-01 to 2026-08
Key findings:
1. Monthly average growth 12%, but March dropped 8% (suspected seasonality)
2. Top 3 products account for 65% of total revenue
3. Customer retention rate dropped from 72% to 68%
🔧 Using tool: shell
→ Command: python3 -c "import pandas; ..."
→ Generating visualization...
6. Multimodal Tool Integration
(1) Multimodal and Tool Coordination
The Agent can combine multimodal input with tool calls:
graph TB
INPUT[Multimodal Input] --> AGENT[Agent Analysis]
AGENT -->|Image → Code| FE[file_edit]
AGENT -->|Video → Script| SH[shell]
AGENT -->|Document → Database| DB[database.query]
▶ Example 8: Image + Tool Coordination
👤 Bob: [attaches api-response-screenshot.png]
This API response format is wrong, help me check the code
🤖 Agent:
🔍 Analyzing screenshot...
→ Expected format: { data: [...], meta: {...} }
→ Actual format: { results: [...] }
🔍 Using tool: search
→ Pattern: "results"
→ Type: content
→ Found in: src/api/handlers.ts:45
📝 Using tool: file_edit (read)
→ Reading src/api/handlers.ts
📝 Using tool: file_edit (edit)
→ Fixing response format at line 45-52
→ Changing "results" to "data", adding "meta" field
(2) Batch Image Processing
▶ Example 9: Batch Images + File Editing
import glob
screenshots = glob.glob("./screenshots/*.png")
response = session.send(
"Review all screenshots, find pages with UI issues, and fix them one by one",
images=screenshots[:5] # Max 5 images
)
(3) Multimodal Chain Reasoning
👤 Alice: [attaches architecture-diagram.png]
Generate a Docker Compose configuration based on this architecture diagram
🤖 Agent:
🔍 Analyzing architecture diagram...
→ Identified 4 services: API, Worker, Database, Cache
→ Connections: API → Database, API → Cache, Worker → Database
📝 Using tool: file_edit (create)
→ Creating docker-compose.yml
→ 4 services with proper networking
✅ Docker Compose configuration generated, including:
- api-service (Express.js, port 3000)
- worker-service (Node.js, background jobs)
- postgres (PostgreSQL 16, volume mounted)
- redis (Redis 7, cache layer)
7. Configuration and Optimization
(1) Multimodal Configuration
# dsh.config.yaml
multimodal:
# Image settings
images:
max_size_mb: 20
max_per_message: 5
resize_large: true # Auto-resize oversized images
max_resolution: [4096, 4096]
# Audio settings
audio:
max_duration_minutes: 10
max_size_mb: 50
transcription_model: "whisper-1"
# Video settings
video:
max_duration_minutes: 5
max_size_mb: 100
frame_rate: 1 # Frames per second to extract
max_frames: 300
# Document settings
documents:
max_size_mb: 50
pdf_ocr_enabled: true
csv_max_rows: 100000
(2) Performance Optimization
Multimodal input increases token consumption and response time:
| Optimization Strategy | Description | Effect |
|---|---|---|
| Image compression | Compress to appropriate resolution before uploading | 50-80% image token reduction |
| Key frame selection | Only send key frames for video | 90% video frame reduction |
| Text extraction | Prefer text extraction over OCR for PDFs | Faster and more accurate |
| Batch sending | Send large numbers of images in batches | Avoids timeout |
❓ FAQ
📖 Summary
- DSH multimodal supports images (stable), audio/video (experimental), documents (stable)
- Image input: Web UI drag/paste, CLI
/attach, SDKimagesparameter - Audio/video requires multimodal-capable LLM models
- Document parsing supports PDF, CSV, XLSX, etc.
- Multimodal + tool coordination: image→code fix, document→data analysis
- Configuration file can adjust size limits, frame rate, OCR toggle, etc.
- Multimodal increases token consumption; pay attention to optimization strategies
📝 Exercises
1. ⭐ Basic: Upload a UI screenshot in the Web UI and have the Agent describe the content of the screenshot. Record the Agent's analysis results and tools used.
2. ⭐⭐ Intermediate: Upload a CSV data file and have the Agent analyze the data and suggest visualizations. Use the SDK to write a script for this operation.
3. ⭐⭐⭐ Challenge: Design a multimodal workflow — upload a UI design image, have the Agent generate corresponding frontend code based on the design, then take a screenshot to compare the generated result with the original design. Record the complete tool call chain.