You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+26-6Lines changed: 26 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -10,15 +10,17 @@ Rust implementation of the DeepSeek-OCR inference stack with a fast CLI and an O
10
10
11
11
| Model | Memory footprint*| Best on | When to pick it |
12
12
| --- | --- | --- | --- |
13
-
|**DeepSeek‑OCR**|**≈6.3 GB** FP16 weights, **≈13 GB** RAM/VRAM with cache & activations (512-token budget) | Apple Silicon + Metal (FP16), high-VRAM NVIDIA GPUs, 32 GB+ RAM desktops | Highest accuracy, SAM+CLIP global/local context, MoE DeepSeek‑V2 decoder (3 B params, ~570 M active per token). Use when latency is secondary to quality. |
14
-
|**PaddleOCR‑VL**|**≈4.7 GB** FP16 weights, **≈9 GB** RAM/VRAM with cache & activations | 16 GB laptops, CPU-only boxes, mid-range GPUs | Dense 0.9 B Ernie decoder with SigLIP vision tower. Faster startup, lower memory, great for batch jobs or lightweight deployments. |
13
+
|**DeepSeek‑OCR**|**≈6.3GB** FP16 weights, **≈13GB** RAM/VRAM with cache & activations (512-token budget) | Apple Silicon + Metal (FP16), high-VRAM NVIDIA GPUs, 32GB+ RAM desktops | Highest accuracy, SAM+CLIP global/local context, MoE DeepSeek‑V2 decoder (3B params, ~570M active per token). Use when latency is secondary to quality. |
14
+
|**PaddleOCR‑VL**|**≈4.7GB** FP16 weights, **≈9GB** RAM/VRAM with cache & activations | 16GB laptops, CPU-only boxes, mid-range GPUs | Dense 0.9B Ernie decoder with SigLIP vision tower. Faster startup, lower memory, great for batch jobs or lightweight deployments. |
15
+
|**DotsOCR**|**≈9GB** FP16 weights, but expect **30–50GB** RAM/VRAM for high-res docs due to huge vision tokens | Apple Silicon + Metal BF16, ≥24GB CUDA cards, or 64GB RAM CPU workstations | Unified VLM (DotsVision + Qwen2) that nails layout, reading order, grounding, and multilingual math if you can tolerate the latency and memory bill. |
15
16
16
17
\*Measured from the default FP16 safetensors. Runtime footprint varies with sequence length.
17
18
18
19
Guidance:
19
20
20
-
-**Need maximum fidelity, multi-region reasoning, or already have 16–24 GB VRAM?** Use **DeepSeek‑OCR**. The hybrid SAM+CLIP tower plus DeepSeek‑V2 MoE decoder handles complex layouts best, but expect higher memory/latency.
21
-
-**Deploying to CPU-only nodes, 16 GB laptops, or latency-sensitive services?** Choose **PaddleOCR‑VL**. Its dense Ernie decoder (18 layers, hidden 1024) activates fewer parameters per token and keeps memory under 10 GB while staying close in quality on most docs.
21
+
-**Need maximum fidelity, multi-region reasoning, or already have 16–24GB VRAM?** Use **DeepSeek‑OCR**. The hybrid SAM+CLIP tower plus DeepSeek‑V2 MoE decoder handles complex layouts best, but expect higher memory/latency.
22
+
-**Deploying to CPU-only nodes, 16GB laptops, or latency-sensitive services?** Choose **PaddleOCR‑VL**. Its dense Ernie decoder (18 layers, hidden 1024) activates fewer parameters per token and keeps memory under 10GB while staying close in quality on most docs.
23
+
-**Chasing reading-order accuracy, layout grounding, or multi-page multilingual PDFs on roomy hardware?** Pick **DotsOCR** with BF16 on Metal/CUDA. Prefill runs around 40–50 tok/s on M-series GPUs but can fall to ~12 tok/s on CPU because of the heavy vision tower.
22
24
23
25
## Why Rust? 💡
24
26
@@ -52,6 +54,23 @@ The original DeepSeek-OCR ships as a Python + Transformers stack—powerful, but
52
54
-**Intel MKL (preview)** – faster BLAS on x86 via `--features mkl` (install Intel oneMKL beforehand).
53
55
-**OpenAI client compatibility** – drop-in replacement for popular SDKs; the server automatically collapses chat history to the latest user turn for OCR-friendly prompts.
54
56
57
+
## Model Matrix 📦
58
+
59
+
The workspace exposes three base model IDs plus DSQ-quantized variants for DeepSeek‑OCR and PaddleOCR‑VL:
60
+
61
+
| Model ID | Base Model | Precision | Suggested Use Case |
62
+
| --- | --- | --- | --- |
63
+
|`deepseek-ocr`|`deepseek-ocr`| FP16 (select via `--dtype`) | Full-fidelity DeepSeek‑OCR stack with SAM+CLIP + MoE decoder; use when you prioritise quality on capable Metal/CUDA/CPU hosts. |
64
+
|`deepseek-ocr-q4k`|`deepseek-ocr`|`Q4_K`| Tight VRAM, local deployments, and batch jobs that still want DeepSeek’s SAM+CLIP pipeline. |
65
+
|`deepseek-ocr-q6k`|`deepseek-ocr`|`Q6_K`| Day‑to‑day balance of quality and size on mid‑range GPUs. |
66
+
|`deepseek-ocr-q8k`|`deepseek-ocr`|`Q8_0`| Stay close to full‑precision quality with manageable memory savings. |
67
+
|`paddleocr-vl`|`paddleocr-vl`| FP16 (select via `--dtype`) | Default choice for lighter hardware; 0.9B Ernie + SigLIP tower with strong doc/table OCR and low latency. |
68
+
|`paddleocr-vl-q4k`|`paddleocr-vl`|`Q4_K`| Heavily compressed doc/table deployments with aggressive memory budgets. |
69
+
|`paddleocr-vl-q6k`|`paddleocr-vl`|`Q6_K`| Common engineering setups; blends accuracy and footprint. |
70
+
|`paddleocr-vl-q8k`|`paddleocr-vl`|`Q8_0`| Accuracy‑leaning deployments that still want a smaller footprint than FP16. |
71
+
|`dots-ocr`|`dots-ocr`| FP16 / BF16 (via `--dtype`) | DotsVision + Qwen2 VLM for high‑precision layout, reading order, grounding, and multilingual docs; expect high memory (30–50GB on large pages). |
72
+
73
+
55
74
## Quick Start 🏁
56
75
57
76
### Prerequisites
@@ -176,18 +195,19 @@ Key flags:
176
195
177
196
### Switching Models
178
197
179
-
The autogenerated `config.toml` now contains two model entries:
198
+
The autogenerated `config.toml` now lists three entries:
180
199
181
200
-`deepseek-ocr` (default) – the original DeepSeek vision-language stack.
182
201
-`paddleocr-vl` – the PaddleOCR-VL 0.9B SigLIP + Ernie release.
202
+
-`dots-ocr` – the Candle port of dots.ocr with DotsVision + Qwen2 (use BF16 on Metal/CUDA if possible; see the release matrix for memory notes).
The CLI (and server) will download the matching config/tokenizer/weights from the appropriate repository (`deepseek-ai/DeepSeek-OCR` or `PaddlePaddle/PaddleOCR-VL`) into your cache on first use. You can still override paths with `--model-config`, `--tokenizer`, or `--weights` if you maintain local fine-tunes.
210
+
The CLI (and server) will download the matching config/tokenizer/weights from the appropriate repository (`deepseek-ai/DeepSeek-OCR`, `PaddlePaddle/PaddleOCR-VL`, or `dots-ocr`) into your cache on first use. You can still override paths with `--model-config`, `--tokenizer`, or `--weights` if you maintain local fine-tunes.
0 commit comments