/ Модель

Характеристики

Контекст
262 144 токена
Размер весов
4,4 ГБ
Лицензия
Apache 2.0
Архитектура
qwen3_5 · dense
Базовая модель
typhoon-ocr2-2b
Библиотека
mlx
Опубликована
9 ноя 2026

typhoon-ocr2-2b-MLX-bf16

Изображение и текст → текст14 профессий

Мультимодальная модель Typhoon AI в формате MLX для распознавания и структурированного разбора тайских и английских документов по изображениям страниц.

132скачиваний за 30 дней0лайковвеса обновлены26 ноя 2026

Бенчмарки

Как модель справилась с задачами пользователей ailist и что о ней публикуют открытые лидерборды

Публичные оценки

Из открытых лидербордов. Сравнивайте результаты одного теста при одинаковых условиях — отсутствие оценки не значит, что модель хуже.

В подключённых источниках результатов для этой модели пока нет.

Что умеет модель

Описание составлено по карточке модели и метаданным Hugging Face

Typhoon OCR V2 2B MLX bf16 — версия модели Typhoon AI для разбора документов, преобразованная в формат MLX с помощью mlx-vlm. Это плотная мультимодальная модель семейства Qwen3.5 с архитектурой Qwen3_5ForConditionalGeneration. Веса представлены в bfloat16 без квантизации и занимают 4,45 ГБ; лицензия репозитория — Apache-2.0, при этом использование также регулируется условиями OpenTyphoon.

Модель принимает изображение страницы и текстовый запрос. Она распознаёт тайские и английские документы, возвращает элементы макета в порядке чтения с категориями, координатами и текстом, а также может выдавать таблицы в HTML, формулы в LaTeX, прочий текст в Markdown, отвечать на вопросы по документу и извлекать сведения в JSON. Подходит для оцифровки страниц, анализа таблиц и формул, классификации документов и извлечения данных.

В тесте на 320 тайских и английских страницах версия bf16 набрала 78,9 балла MDPBench и 80 баллов MDPBench Thai; авторы рекомендуют 8-битную версию как более компактную с сопоставимым результатом. Для мелкого текста рекомендуется увеличивать длинную сторону изображения как минимум до 1600 пикселей. На плотных многостолбцовых страницах модель может зацикливаться на повторениях; также она может генерировать текст, отсутствующий в изображении, и не предназначена для открытого чата или автоматических решений о людях. Результаты MLX проверялись на Linux с CUDA, а не на Apple Silicon.

Сценарии применения

  • извлечение текста и элементов макета из сканов страниц
  • преобразование страниц документа в Markdown
  • извлечение таблиц из изображений в HTML
  • распознавание формул на страницах с выводом в LaTeX
  • извлечение ключевых сведений из документов в JSON
  • ответы на вопросы по содержимому документа
  • классификация документов по изображению страницы

Ограничения

На плотных многостолбцовых страницах возможны циклы повторений, а модель может выдавать текст, которого нет на изображении; результаты следует проверять человеком, особенно перед решениями о людях. Для чтения мелкого текста требуется увеличить изображение; качество на Apple Silicon отдельно не проверено.

Для каких профессий подходит14

Разделы каталога профессий, в задачах которых используется эта модель

Все профессии

Также подходит для

Карточка модели

README от автора на Hugging Face, как он его опубликовал

Открыть на Hugging Face

Typhoon OCR V2 2B MLX bf16

Typhoon OCR V2 2B converted to MLX with mlx-vlm, bfloat16, no quantization.

Typhoon OCR V2 2B is a document parser for Thai and English. Given an image of a page, it returns the page's layout elements in reading order, each with a category, a bounding box and its text. Tables come out as HTML, formulas as LaTeX and other text as Markdown. It also answers questions about a document and extracts key information as JSON. The main model card has the training details, full benchmark results, examples and limitations, and the technical report describes the method and the evaluation.

Use of this model is subject to the OpenTyphoon Terms and Conditions.

Accuracy

WeightsSizeMDPBench ↑MDPBench Thai ↑
Original weights (bf16, vLLM)–79.881.3
this repo (bfloat16, no quantization)4.45 GB78.980
typhoon-ai/typhoon-ocr2-2b-MLX-8bit (8-bit affine, group size 64)2.68 GB79.380.6
typhoon-ai/typhoon-ocr2-2b-MLX-4bit (4-bit affine, group size 64)1.74 GB73.370.5

MDPBench has 320 Thai and English pages, both digital and photographed. We ran each MLX version through mlx_vlm.server (mlx 0.32.4 (mlx-cuda-13), mlx-vlm 0.7.12) with the prompt below, greedy decoding, thinking off and images of up to 16.7 MP, the same settings as the vLLM numbers in the first row. We do not have Apple hardware for this, so these scores come from the Linux CUDA build of MLX on an NVIDIA H100. The weights are the same on a Mac, but we have not checked its outputs. We recommend the 8-bit version: it scored as well as bf16 (79.3 against 78.9) at about half the size. Avoid the 4-bit version for Thai documents: its Thai score drops by about 10 points (70.5 against 80.6 for 8-bit). Differences of a few tenths of a point between versions are within run-to-run variation.

Usage with mlx-vlm

pip install -U mlx-vlm

The repo's processor config limits images to 4 MP. Pass --max-pixels 16777216 (16.7 MP), as in our evaluation; small text is read more accurately at that size.

Server

mlx_vlm.server --model typhoon-ai/typhoon-ocr2-2b-MLX-bf16 --port 8080 \
  --min-pixels 2048 --max-pixels 16777216 --max-tokens 16384

mlx-vlm leaves thinking off unless you start the server with --enable-thinking; keep it off for this model. Call the OpenAI-compatible endpoint with PROMPT and the helpers from the next section:

from openai import OpenAI

client = OpenAI(base_url="http://localhost:8080/v1", api_key="EMPTY")

image_url = to_data_url(load_image("page.jpg"))

resp = client.chat.completions.create(
    model="typhoon-ai/typhoon-ocr2-2b-MLX-bf16",
    messages=[{"role": "user", "content": [
        {"type": "image_url", "image_url": {"url": image_url}},
        {"type": "text", "text": PROMPT},
    ]}],
    temperature=0.0,
    max_tokens=16384,
)
elements = parse_elements(resp.choices[0].message.content)
print(to_markdown(elements))

Python

from mlx_vlm import load, generate
from mlx_vlm.prompt_utils import apply_chat_template

model, processor = load("typhoon-ai/typhoon-ocr2-2b-MLX-bf16")
prompt = apply_chat_template(processor, model.config, PROMPT, num_images=1)
result = generate(model, processor, prompt, image=[load_image("page.jpg")], max_tokens=16384, temperature=0.0,
                  min_pixels=2048, max_pixels=16777216)
print(to_markdown(parse_elements(result.text)))

Prompt and output

The model was trained on a fixed set of prompts. For full-page parsing, use this prompt exactly as written:

PROMPT = """- Extract layout information from the provided PDF image.
- For each layout element, output its bbox, category, and the text content within the bbox.
- Bbox format: [x1, y1, x2, y2].
- Allowed layout categories: ['header', 'title', 'text', 'figure', 'table', 'formula', 'figure_caption', 'table_caption', 'formula_caption', 'figure_footnote', 'table_footnote', 'page_footnote', 'footer'].
- Text extraction and formatting:
  1) For 'figure', the text field must be an empty string.
  2) For 'formula', format text as LaTeX.
  3) For 'table', format text as HTML.
  4) For all other categories (e.g., text, title), format text as Markdown.
- The output text must be exactly the original text from the image, with no translation or rewriting.
- Sort all layout elements in human reading order.
- Final output must be a single JSON object."""

Before sending a page, enlarge it so that its long side is at least 1,600 pixels, keeping the aspect ratio. This is required: the model reads small images poorly, Thai text most of all. load_image below does it:

import base64, io
from PIL import Image

def upscale_min_long(image: Image.Image, min_long: int = 1600) -> Image.Image:
    """Enlarge the image so that its long side is at least `min_long` pixels, keeping the
    aspect ratio. Images that are already large enough are returned unchanged."""
    scale = min_long / max(image.size)
    if scale <= 1:
        return image
    return image.resize((round(image.width * scale), round(image.height * scale)), Image.LANCZOS)

def load_image(path: str) -> Image.Image:
    return upscale_min_long(Image.open(path).convert("RGB"))

def to_data_url(image: Image.Image) -> str:
    buf = io.BytesIO()
    image.save(buf, format="PNG")
    return "data:image/png;base64," + base64.b64encode(buf.getvalue()).decode()

The model returns a JSON list of elements inside a json code block. Bounding boxes use a 0–1000 grid relative to the page width and height, so they map back onto the original image. These helpers parse the output and turn it into Markdown:

import json, re

def parse_elements(raw: str) -> list[dict]:
    """Parse the model output: a JSON list of elements inside a ```json fence."""
    m = re.search(r"```json\n(.*?)(?:\n```|$)", raw, re.DOTALL)
    text = (m.group(1) if m else raw).strip()
    try:
        return json.loads(text)
    except json.JSONDecodeError:
        # Output stopped at the token limit: drop the last, incomplete element.
        cut = text.rfind('{"bbox":')
        return json.loads(text[:cut].rstrip().rstrip(",") + "]")

def to_markdown(elements: list[dict], keep_header_footer: bool = False) -> str:
    skip = set() if keep_header_footer else {"header", "footer", "page_footnote"}
    return "\n\n".join(e["text"] for e in elements if e.get("text") and e["category"] not in skip)

For questions about a document, send the question as the text prompt instead. For key-information extraction and the other tasks, see the main model card.

Limitations

  • Quantization costs some accuracy; compare the scores above before picking a smaller version.
  • Scores were measured with MLX on Linux (CUDA), not on Apple silicon.
  • The model can fall into repetition loops on dense multi-column pages. parse_elements above keeps the complete elements when that happens.
  • All limitations of the original model apply.

Intended Uses

Intended for:

  • Reading Thai and English documents: turning page images into layout elements (category, box and text) or Markdown.
  • Extracting key information as JSON, answering questions about a document, and classifying documents.
  • Reading tables, formulas and charts on their own.

This is a converted version of Typhoon OCR V2 2B; its intended uses are the same.

Not intended for:

  • Open-ended chat or content generation. The model has no safety filtering and can output text that is not in the image.
  • Fully automatic decisions about people, such as credit, hiring, legal or identity checks. Have a person review the output first.
  • Documents you do not have the right to process. If a document contains personal data, you are responsible for handling it lawfully.

By using this model, you agree to the OpenTyphoon Terms and Conditions and acknowledge the Privacy Notice.

Citation

If you use Typhoon OCR V2, please cite the technical report:

@misc{nonesung2026typhoonocr2thai,
      title={Typhoon OCR 2: From Thai Document Transcription to Multilingual, Multi-Task OCR},
      author={Surapon Nonesung and Natapong Nitarach and Sittipong Sripaisarnmongkol and Kunat Pipatanakul and Warit Sirichotedumrong},
      year={2026},
      eprint={2611.27494},
      archivePrefix={arXiv},
      primaryClass={cs.CL},
      url={https://arxiv.org/abs/2611.27494},
}

Support

Как запустить

На своей GPU в ailist. Цена — по текущим предложениям провайдеров

GPU в ailist

Универсальный рантайм · mlx

Нельзя запустить

MLX-модели работают только на Apple Silicon, на GPU NVIDIA они не запускаются.

Класс архитектуры
Qwen3_5ForConditionalGeneration
Ревизия весов
db66a82

0 моделей