Image-Text-to-Text
Transformers
Safetensors
English
Chinese
ocr
vision-language
deepseek
quantization
8-bit precision
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")# Load model directly from transformers import AutoModel model = AutoModel.from_pretrained("SamMikaelson/deepseek-ocr-int8-uniform", dtype="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- 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
- 4
Inference Providers NEW
This model isn't deployed by any Inference Provider. π Ask for provider support