Views
No views yet
| Property | Value |
|---|---|
| Base Model | typhoon-ai/typhoon-ocr1.5-2b |
| Architecture | Qwen3VLForConditionalGeneration |
| Quantization | NVFP4 (W4A4), group_size=16 |
| Quantizer | NVIDIA ModelOpt 0.45.0 |
| Target GPU | NVIDIA Blackwell (GB10 / sm_121) |
| Quantized Size | 2.23 GB |
| Context Length | 262,144 tokens |
| Hidden Size | 2048 |
| Layers | 28 |
| Attention Heads | 16 (KV: 8) |
| Vision | Qwen3VL Vision Encoder (1024 dim, 24 layers) |
lm_head, model.language_model.embed_tokens, model.visual*| File | Size |
|---|---|
model.safetensors | 2.23 GB |
config.json | Model config with quantization_config |
hf_quant_config.json | HF quantization metadata |
generation_config.json | Generation defaults |
chat_template.jinja | Chat template |
tokenizer.json | Tokenizer model |
tokenizer_config.json | Tokenizer config |
preprocessor_config.json | Vision preprocessor config |
video_preprocessor_config.json | Video preprocessor config |
Important: This model is a single-prompt model — it works with one specific extraction prompt of Typhoon OCR v1.5 only. Other prompts will not produce correct results.
1prompt = """Extract all text from the image.
2
3Instructions:
4- Only return the clean Markdown.
5- Do not include any explanation or extra text.
6- You must include all information on the page.
7
8Formatting Rules:
9- Tables: Render tables using <table>...</table> in clean HTML format.
10- Equations: Render equations using LaTeX syntax with inline ($...$) and block ($$...$$).
11- Images/Charts/Diagrams: Wrap any clearly defined visual areas (e.g. charts, diagrams, pictures) in:
12
13<figure>
14Describe the image's main elements (people, objects, text), note any contextual clues (place, event, culture), mention visible text and its meaning, provide deeper analysis when relevant (especially for financial charts, graphs, or documents), comment on style or architecture if relevant, then give a concise overall summary. Describe in Thai.
15</figure>
16
17- Page Numbers: Wrap page numbers in <page_number>...</page_number> (e.g., <page_number>14</page_number>).
18- Checkboxes: Use ☐ for unchecked and ☑ for checked boxes."""typhoon-ocr librarytyphoon-ocr library rather than raw transformers:pip install vllm typhoon-ocr1vllm serve nanash66/typhoon-ocr1.5-2b-NVFP4 \
2 --quantization modelopt \
3 --max-model-len 49152 \
4 --served-model-name typhoon-ocr-nvfp41from typhoon_ocr import ocr_document
2
3markdown = ocr_document(
4 "image.png",
5 model="typhoon-ocr-nvfp4",
6 figure_language="Thai",
7 task_type="v1.5",
8 base_url="http://localhost:8000/v1",
9 api_key="no-key",
10)
11print(markdown)Note: This model requires a Blackwell GPU (sm_121) with NVIDIA ModelOpt runtime for NVFP4 inference.
1from transformers import AutoModelForImageTextToText, AutoProcessor
2from PIL import Image
3
4model = AutoModelForImageTextToText.from_pretrained(
5 "nanash66/typhoon-ocr1.5-2b-NVFP4",
6 dtype="auto",
7 device_map="auto",
8)
9processor = AutoProcessor.from_pretrained("nanash66/typhoon-ocr1.5-2b-NVFP4")
10
11# Load image
12img = Image.open("image.png")
13
14# IMPORTANT: The model was trained at a fixed image dimension of 1800px.
15# Resize the image before inference.
16def resize_if_needed(img, max_size=1800):
17 if max(img.size) > max_size:
18 scale = max_size / max(img.size)
19 img = img.resize((int(img.width * scale), int(img.height * scale)))
20 return img
21
22img = resize_if_needed(img, 1800)
23
24messages = [
25 {
26 "role": "user",
27 "content": [
28 {"type": "image", "image": img},
29 {"type": "text", "text": prompt},
30 ],
31 }
32]
33
34# Preparation for inference
35inputs = processor.apply_chat_template(
36 messages,
37 tokenize=True,
38 add_generation_prompt=True,
39 return_dict=True,
40 return_tensors="pt",
41).to(model.device)
42
43# Inference
44generated_ids = model.generate(**inputs, max_new_tokens=10000)
45generated_ids_trimmed = [
46 out_ids[len(in_ids):]
47 for in_ids, out_ids in zip(inputs.input_ids, generated_ids)
48]
49output_text = processor.batch_decode(
50 generated_ids_trimmed,
51 skip_special_tokens=True,
52 clean_up_tokenization_spaces=False,
53)
54print(output_text[0])1@misc{nonesung2026typhoonocropenvisionlanguage,
2 title={Typhoon OCR: Open Vision-Language Model For Thai Document Extraction},
3 author={Surapon Nonesung and Natapong Nitarach and Teetouch Jaknamon and Pittawat Taveekitworachai and Kunat Pipatanakul},
4 year={2026},
5 eprint={2601.14722},
6 archivePrefix={arXiv},
7 primaryClass={cs.CL},
8 url={https://arxiv.org/abs/2601.14722},
9}
10
11@misc{typhoon2,
12 title={Typhoon 2},
13 year={2024},
14 eprint={2412.13702},
15 archivePrefix={arXiv},
16 url={https://arxiv.org/abs/2412.13702},
17}
18
19@misc{thaiocrbench,
20 title={ThaiOCRBench},
21 year={2025},
22 eprint={2511.04479},
23 archivePrefix={arXiv},
24 url={https://arxiv.org/abs/2511.04479},
25}