Instructions to use SandLogicTechnologies/DeepSeek-OCR-2-GGUF with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- llama-cpp-python
How to use SandLogicTechnologies/DeepSeek-OCR-2-GGUF with llama-cpp-python:
# !pip install llama-cpp-python from llama_cpp import Llama llm = Llama.from_pretrained( repo_id="SandLogicTechnologies/DeepSeek-OCR-2-GGUF", filename="DeepSeek-OCR-2-IQ3_M.gguf", )
llm.create_chat_completion( messages = "\"cats.jpg\"" )
- Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- llama.cpp
How to use SandLogicTechnologies/DeepSeek-OCR-2-GGUF with llama.cpp:
Install (macOS, Linux)
curl -LsSf https://llama.app/install.sh | sh # Start a local OpenAI-compatible server with a web UI: llama serve -hf SandLogicTechnologies/DeepSeek-OCR-2-GGUF:IQ3_M # Run inference directly in the terminal: llama cli -hf SandLogicTechnologies/DeepSeek-OCR-2-GGUF:IQ3_M
Install from WinGet (Windows)
winget install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama serve -hf SandLogicTechnologies/DeepSeek-OCR-2-GGUF:IQ3_M # Run inference directly in the terminal: llama cli -hf SandLogicTechnologies/DeepSeek-OCR-2-GGUF:IQ3_M
Use pre-built binary
# Download pre-built binary from: # https://github.com/ggerganov/llama.cpp/releases # Start a local OpenAI-compatible server with a web UI: ./llama-server -hf SandLogicTechnologies/DeepSeek-OCR-2-GGUF:IQ3_M # Run inference directly in the terminal: ./llama-cli -hf SandLogicTechnologies/DeepSeek-OCR-2-GGUF:IQ3_M
Build from source code
git clone https://github.com/ggerganov/llama.cpp.git cd llama.cpp cmake -B build cmake --build build -j --target llama-server llama-cli # Start a local OpenAI-compatible server with a web UI: ./build/bin/llama-server -hf SandLogicTechnologies/DeepSeek-OCR-2-GGUF:IQ3_M # Run inference directly in the terminal: ./build/bin/llama-cli -hf SandLogicTechnologies/DeepSeek-OCR-2-GGUF:IQ3_M
Use Docker
docker model run hf.co/SandLogicTechnologies/DeepSeek-OCR-2-GGUF:IQ3_M
- LM Studio
- Jan
- Ollama
How to use SandLogicTechnologies/DeepSeek-OCR-2-GGUF with Ollama:
ollama run hf.co/SandLogicTechnologies/DeepSeek-OCR-2-GGUF:IQ3_M
- Unsloth Studio
How to use SandLogicTechnologies/DeepSeek-OCR-2-GGUF with Unsloth Studio:
Install Unsloth Studio (macOS, Linux, WSL)
curl -fsSL https://unsloth.ai/install.sh | sh # Run unsloth studio unsloth studio -H 0.0.0.0 -p 8888 # Then open http://localhost:8888 in your browser # Search for SandLogicTechnologies/DeepSeek-OCR-2-GGUF to start chatting
Install Unsloth Studio (Windows)
irm https://unsloth.ai/install.ps1 | iex # Run unsloth studio unsloth studio -H 0.0.0.0 -p 8888 # Then open http://localhost:8888 in your browser # Search for SandLogicTechnologies/DeepSeek-OCR-2-GGUF to start chatting
Using HuggingFace Spaces for Unsloth
# No setup required # Open https://huggingface.co/spaces/unsloth/studio in your browser # Search for SandLogicTechnologies/DeepSeek-OCR-2-GGUF to start chatting
- Atomic Chat new
- Docker Model Runner
How to use SandLogicTechnologies/DeepSeek-OCR-2-GGUF with Docker Model Runner:
docker model run hf.co/SandLogicTechnologies/DeepSeek-OCR-2-GGUF:IQ3_M
- Lemonade
How to use SandLogicTechnologies/DeepSeek-OCR-2-GGUF with Lemonade:
Pull the model
# Download Lemonade from https://lemonade-server.ai/ lemonade pull SandLogicTechnologies/DeepSeek-OCR-2-GGUF:IQ3_M
Run and chat with the model
lemonade run user.DeepSeek-OCR-2-GGUF-IQ3_M
List all available models
lemonade list
DeepSeek-OCR-2
DeepSeek-OCR-2 is a vision-language OCR model developed by DeepSeek, designed for high-quality document parsing, optical character recognition, and structured information extraction from complex visual documents. This repository contains GGUF quantized variants of the model optimized for efficient local inference using llama.cpp.
The model is built to accurately recognize and interpret textual information from a wide variety of document types, including scanned pages, invoices, receipts, forms, tables, books, reports, and handwritten or digitally generated content. Beyond text recognition, it emphasizes document parsing and contextual understanding to enable reliable extraction of structured information from visually complex documents.
The quantized formats significantly reduce memory requirements while maintaining strong OCR accuracy and document comprehension, making the model suitable for both local deployment and enterprise-scale document-processing pipelines.
Model Overview
- Model Name: DeepSeek-OCR-2
- Base Model: deepseek-ai/DeepSeek-OCR-2
- Architecture: Vision-Language OCR Model
- Parameter Count: Approximately 3 Billion Parameters
- Modalities: Text, Image
- Primary Languages: Multilingual
- Developer: DeepSeek AI
- License: MIT
Quantization Formats
This repository provides various GGUF quantized versions of the DeepSeek-OCR-2 model optimized for efficient local inference using llama.cpp.
IQ3_M
- Size reduction of approx 75.32% (1.35 GB) compared to 16-bit (5.47 GB)
- Aggressive 3-bit quantization optimized for memory-efficient OCR and document parsing workloads
- Suitable for lightweight document digitization systems and edge deployments
- Enables efficient extraction of textual information from diverse document formats on consumer hardware
- Recognition quality for dense layouts, handwritten text, and visually complex documents may reduce compared to higher-precision variants
IQ4_NL
- Size reduction of approx 70.93% (1.59 GB) compared to 16-bit (5.47 GB)
- Advanced 4-bit non-linear quantization designed to better preserve OCR fidelity and document parsing quality
- Better suited for structured document analysis, information extraction, and layout-aware processing workflows
- Designed to reduce quantization loss while maintaining consistent document interpretation
- May require slightly increased computational overhead during inference
IQ4_XS
- Size reduction of approx 72.03% (1.53 GB) compared to 16-bit (5.47 GB)
- Balanced 4-bit quantization optimized for efficient OCR inference and dependable document-processing performance
- Provides a practical balance between memory efficiency, extraction accuracy, and runtime speed
- Suitable for invoices, reports, forms, books, receipts, and enterprise document-processing pipelines
- Maintains reliable performance across a broad range of OCR and document-understanding tasks
Training Background (Original Model)
DeepSeek-OCR-2 is trained with a strong emphasis on document parsing, optical character recognition, and multimodal document understanding across diverse visual document collections.
Pretraining
- Large-scale multimodal pretraining using document-centric image and text datasets
- Focus on visual-text alignment, document representation learning, and OCR capability
- Optimized for downstream document understanding and structured extraction tasks
OCR Optimization
- Further optimized for document parsing and structured information extraction
- Enhanced for robust text recognition across diverse layouts and document formats
- Improved performance on tables, forms, receipts, reports, and visually complex documents
Key Capabilities
Optical Character Recognition (OCR) : Accurately extracts textual content from scanned documents, images, and visual media.
Document Parsing : Understands document layout and semantic organization for structured processing.
Layout Understanding : Identifies relationships between document elements including paragraphs, tables, and forms.
Structured Information Extraction : Extracts key-value information and structured content from complex documents.
Complex Document Analysis : Handles visually rich documents containing mixed layouts, tables, and embedded content.
Efficient Local Deployment : Quantized variants enable practical OCR inference on consumer hardware.
Usage Example
Using llama.cpp
./llama-mtmd-cli \
-m SandlogicTechnologies/DeepSeek-OCR-2_IQ4_NL.gguf \
--mmproj SandlogicTechnologies/deepseek-ocr-2.mmproj-f16.gguf \
--image invoice.png \
-p "Extract all document fields and return them as structured JSON."
Recommended Usecases
Document Digitization : Convert scanned documents into searchable digital content.
Enterprise OCR : Automate extraction of structured information from business documents.
Invoice & Receipt Processing : Capture financial information from invoices and receipts.
Document Parsing Pipelines : Build automated workflows for layout-aware document understanding.
Knowledge Extraction : Prepare structured document data for indexing, search, and downstream AI systems.
Research & Evaluation : Benchmark OCR and document-understanding performance across diverse datasets.
Acknowledgments
These quantized models are based on the original work by the DeepSeek AI development team.
Special thanks to:
- The DeepSeek AI team for developing and releasing the DeepSeek-OCR-2 model.
- Georgi Gerganov and the
llama.cppopen-source community for enabling efficient quantization and inference via the GGUF format.
Contact
For questions, feedback, or support, please reach out at support@sandlogic.com or visit https://www.sandlogic.com/
- Downloads last month
- 614
3-bit
4-bit
Model tree for SandLogicTechnologies/DeepSeek-OCR-2-GGUF
Base model
deepseek-ai/DeepSeek-OCR-2