Back to models
DeepSeek-OCR
DeepSeek-OCR is DeepSeek AI's 3B MIT-licensed vision-language OCR model engineered for optical context compression and accurate extraction of structured Markdown, tables, and text from complex scanned documents.
What you can do
- Scanned PDF to Markdown conversion
- Multi-column layout and table extraction
- High-throughput archive digitization
Input & output
- Input
- Scanned document images, PDF page renders, multi-column layouts, tables, and OCR formatting prompts
- Output
- Structured Markdown, HTML/LaTeX tables, and faithful plain-text transcriptions
Try a prompt like this
Convert this scanned two-column financial statement page into clean Markdown, preserving all table headers, footnotes, and numeric alignment without summarizing.
Things to know
Runs in ~7GB VRAM in BF16 with FlashAttention-2 under the MIT license; specialized for optical text/layout extraction rather than open-ended conversational chat or creative writing.
All listed models publish open weights for self-hosted deployment; check each repository's license before commercial use.
Call it through the API
The platform exposes an OpenAI-compatible API. Use an official SDK or any HTTP client, then set the gateway URL, API key, and model ID.
- Endpoint
POST/v1/chat/completions- Model repo ID
deepseek-ai/DeepSeek-OCR
import os
from openai import OpenAI
client = OpenAI(
base_url=os.environ["API_BASE_URL"],
api_key=os.environ["API_KEY"],
)
response = client.chat.completions.create(
model="deepseek-ai/DeepSeek-OCR",
messages=[{"role": "user", "content": "Convert this scanned two-column financial statement page into clean Markdown, preserving all table headers, footnotes, and numeric alignment without summarizing."}],
)
print(response.choices[0].message.content)Before running a sample, set the API_BASE_URL (gateway URL) and API_KEY environment variables.
Read the full API guide