Image-Text-to-Text
Transformers
Safetensors
English
Chinese
deepseek_vl_v2
text-generation
ocr
vision-language
deepseek
quantization
custom_code
8-bit precision
custom
Instructions to use SamMikaelson/deepseek-ocr-int8-uniform with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use SamMikaelson/deepseek-ocr-int8-uniform with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("image-text-to-text", model="SamMikaelson/deepseek-ocr-int8-uniform", trust_remote_code=True)# Load model directly from transformers import AutoModelForCausalLM model = AutoModelForCausalLM.from_pretrained("SamMikaelson/deepseek-ocr-int8-uniform", trust_remote_code=True, dtype="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps
- vLLM
How to use SamMikaelson/deepseek-ocr-int8-uniform with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "SamMikaelson/deepseek-ocr-int8-uniform" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "SamMikaelson/deepseek-ocr-int8-uniform", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/SamMikaelson/deepseek-ocr-int8-uniform
- SGLang
How to use SamMikaelson/deepseek-ocr-int8-uniform with SGLang:
Install from pip and serve model
# Install SGLang from pip: pip install sglang # Start the SGLang server: python3 -m sglang.launch_server \ --model-path "SamMikaelson/deepseek-ocr-int8-uniform" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "SamMikaelson/deepseek-ocr-int8-uniform", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker images
docker run --gpus all \ --shm-size 32g \ -p 30000:30000 \ -v ~/.cache/huggingface:/root/.cache/huggingface \ --env "HF_TOKEN=<secret>" \ --ipc=host \ lmsysorg/sglang:latest \ python3 -m sglang.launch_server \ --model-path "SamMikaelson/deepseek-ocr-int8-uniform" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "SamMikaelson/deepseek-ocr-int8-uniform", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use SamMikaelson/deepseek-ocr-int8-uniform with Docker Model Runner:
docker model run hf.co/SamMikaelson/deepseek-ocr-int8-uniform
DeepSeek-OCR INT8 Quantized (Safetensors)
Uniformly quantized version of DeepSeek-OCR using safetensors format + JSON metadata.
📊 Model Stats
- Original Size: 6363.12 MB
- Compressed Size: 3351.56 MB
- Saved Size: 3352.37 MB
- Compression Ratio: 1.90x
- Format: Safetensors + JSON metadata
🚀 Quick Start
from model_loader import load_quantized_model
model = load_quantized_model(
"SamMikaelson/deepseek-ocr-int8-uniform",
device="cuda"
)
# Model is ready to use!
# Memory footprint: ~3352 MB
🔧 Manual Loading
import torch
from safetensors.torch import load_file
import json
# Load weights
state_dict = load_file("model.safetensors")
# Load metadata
with open("quantization_config.json") as f:
metadata = json.load(f)
# Reconstruct model (see model_loader.py for details)
📦 File Structure
model.safetensors # 3352 MB - All weights (compressed)
quantization_config.json # Layer metadata (bits, shapes)
config.json # Model config
quantization.py # QuantizedLinear layer
model_loader.py # Loading utilities
✨ Why Safetensors?
- ✅ Secure: No arbitrary code execution (vs pickle)
- ✅ Fast: Zero-copy loading
- ✅ Standard: HuggingFace official format
- ✅ Portable: Works across frameworks
📊 Quantization Details
- Method: Uniform INT8
- Vision layers: 96 @ 8-bit
- Language layers: 2197 @ 8-bit
- Dequantization: On-the-fly during forward pass
🔍 Inspect Metadata
import json
with open("quantization_config.json") as f:
config = json.load(f)
print(f"Quantized layers: {len(config['quantized_layers'])}")
print(f"Compression: {config['stats']['compression_ratio']}x")
📝 License
MIT (inherited from DeepSeek-OCR)
- Downloads last month
- -
Inference Providers NEW
This model isn't deployed by any Inference Provider. 🙋 Ask for provider support