DeepSeek-OCR 2 is a multimodal document recognition model released by DeepSeek AI, serving as an upgrade to DeepSeek-OCR. By introducing the DeepEncoder V2 architecture, it achieves a paradigm shift in visual encoding from "fixed scanning" to "semantic reasoning." The model replaces the original CLIP encoder with a lightweight language model (Qwen2-0.5B) and incorporates a causal flow query mechanism, while retaining the DeepSeek-3B-MoE decoder. The model requires only 256 to 1120 visual tokens to cover complex document pages. On the OmniDocBench v1.5 benchmark, it achieves an overall score of 91.09%, a 3.73% improvement over its predecessor, with reading order recognition edit distance reduced from 0.085 to 0.057.
deepseek/deepseek-ocr-2 is available via Novita's serverless API, where you pay per token. There are several ways to call the API, including OpenAI-compatible endpoints with exceptional reasoning performance.
Execute consultas imediatamente, pague apenas pelo uso
Obtenha sua chave de API
Cadastre-se e crie uma chave para executar o código abaixo. A API é compatível com OpenAI.
The API is OpenAI-compatible: point any OpenAI SDK at the base URL and pass this model ID.
1from openai import OpenAI
2
3client = OpenAI(
4 api_key="<Your API Key>",
5 base_url="https://api.novita.ai/openai"
6)
7
8response = client.chat.completions.create(
9 model="deepseek/deepseek-ocr-2",
10 messages=[
11 {"role": "system", "content": "You are a helpful assistant."},
12 {"role": "user", "content": "Hello, how are you?"}
13 ],
14 max_tokens=8192,
15 temperature=0.7
16)
17
18print(response.choices[0].message.content)