Instructions to use jitvimol/typhoon-ocr2-2b-mlx-bf16 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- MLX
How to use jitvimol/typhoon-ocr2-2b-mlx-bf16 with MLX:
# Make sure mlx-vlm is installed # pip install --upgrade mlx-vlm from mlx_vlm import load, generate from mlx_vlm.prompt_utils import apply_chat_template from mlx_vlm.utils import load_config # Load the model model, processor = load("jitvimol/typhoon-ocr2-2b-mlx-bf16") config = load_config("jitvimol/typhoon-ocr2-2b-mlx-bf16") # Prepare input image = ["http://images.cocodataset.org/val2017/000000039769.jpg"] prompt = "Describe this image." # Apply chat template formatted_prompt = apply_chat_template( processor, config, prompt, num_images=1 ) # Generate output output = generate(model, processor, formatted_prompt, image) print(output) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- LM Studio
- Pi
How to use jitvimol/typhoon-ocr2-2b-mlx-bf16 with Pi:
Start the MLX server
# Install MLX LM: uv tool install mlx-lm # Start a local OpenAI-compatible server: mlx_lm.server --model "jitvimol/typhoon-ocr2-2b-mlx-bf16"
Configure the model in Pi
# Install Pi: npm install -g @earendil-works/pi-coding-agent # Add to ~/.pi/agent/models.json: { "providers": { "mlx-lm": { "baseUrl": "http://localhost:8080/v1", "api": "openai-completions", "apiKey": "none", "models": [ { "id": "jitvimol/typhoon-ocr2-2b-mlx-bf16" } ] } } }Run Pi
# Start Pi in your project directory: pi
- Hermes Agent
How to use jitvimol/typhoon-ocr2-2b-mlx-bf16 with Hermes Agent:
Start the MLX server
# Install MLX LM: uv tool install mlx-lm # Start a local OpenAI-compatible server: mlx_lm.server --model "jitvimol/typhoon-ocr2-2b-mlx-bf16"
Configure Hermes
# Install Hermes: curl -fsSL https://hermes-agent.nousresearch.com/install.sh | bash hermes setup # Point Hermes at the local server: hermes config set model.provider custom hermes config set model.base_url http://127.0.0.1:8080/v1 hermes config set model.default jitvimol/typhoon-ocr2-2b-mlx-bf16
Run Hermes
hermes
- Atomic Chat
- OpenClaw
How to use jitvimol/typhoon-ocr2-2b-mlx-bf16 with OpenClaw:
Start the MLX server
# Install MLX LM: uv tool install mlx-lm # Start a local OpenAI-compatible server: mlx_lm.server --model "jitvimol/typhoon-ocr2-2b-mlx-bf16"
Configure OpenClaw
# Install OpenClaw: npm install -g openclaw@latest # Register the local server and set it as the default model: openclaw onboard --non-interactive --mode local \ --auth-choice custom-api-key \ --custom-base-url http://127.0.0.1:8080/v1 \ --custom-model-id "jitvimol/typhoon-ocr2-2b-mlx-bf16" \ --custom-provider-id mlx-lm \ --custom-compatibility openai \ --custom-text-input \ --accept-risk \ --skip-health
Run OpenClaw
openclaw agent --local --agent main --message "Hello from Hugging Face"
Typhoon OCR V2 2B (MLX, bf16)
This repository contains an unofficial conversion of typhoon-ai/typhoon-ocr2-2b to the MLX format, for local inference on Apple silicon Macs. It can be used with any tool that supports MLX vision-language models of the Qwen3.5 architecture. It is not affiliated with, or endorsed by, the original authors.
Typhoon OCR V2 2B is a vision-language model of about 2.2 billion parameters for Thai and English document parsing, developed by Typhoon (SCB 10X). Given an image of a page, it returns the layout elements of the page in reading order, each with a category, a bounding box and its text content. Beyond parsing, the original authors describe it as suitable for document question answering, document classification, key-information extraction and reading tables, formulas and charts. It is a fine-tune of infly/Infinity-Parser2-Flash and uses the Qwen3.5 architecture (Qwen3_5ForConditionalGeneration).
About this conversion
| Source model | typhoon-ai/typhoon-ocr2-2b |
| Precision | bfloat16 (unquantized) |
| Size on disk | 4.43 GB |
| Memory in use | approximately 5.3 GB for typical page images (measured peak resident memory with mlx-vlm); larger images require more |
| Conversion tool | mlx-vlm 0.7.12 (python -m mlx_vlm convert) |
| License | Apache-2.0, inherited from the source model |
This variant keeps the original bfloat16 weights without quantization. It is the recommended choice when transcription accuracy is the priority.
The conversion was performed without any additional training or modification of the weights other than the dtype or quantization described above.
Usage
This model is in the standard MLX format and can be loaded by any MLX-compatible tool that supports Qwen3.5 vision-language models. Whichever tool is used, apply the prompt given below and set the temperature to 0.
LM Studio
In the LM Studio app, search for jitvimol/typhoon-ocr2-2b-mlx-bf16 in the model search, or paste the repository URL, and download it. Alternatively, use the command line:
lms get https://huggingface.co/jitvimol/typhoon-ocr2-2b-mlx-bf16
Then load the model, attach a page image in the chat, and use the prompt given below with the temperature set to 0. If large pages are downscaled in your setup, the layout boxes may differ from the reference results (see Limitations).
mlx-vlm (command line)
pip install -U mlx-vlm
python -m mlx_vlm.generate \
--model jitvimol/typhoon-ocr2-2b-mlx-bf16 \
--image page.jpg \
--prompt "<PROMPT below>" \
--max-tokens 4096 \
--temperature 0.0
mlx-vlm (Python)
from mlx_vlm import load, generate
from mlx_vlm.prompt_utils import apply_chat_template
from mlx_vlm.utils import load_config
model_id = "jitvimol/typhoon-ocr2-2b-mlx-bf16"
model, processor = load(model_id)
config = load_config(model_id)
prompt = "<PROMPT below>"
formatted = apply_chat_template(processor, config, prompt, num_images=1)
result = generate(model, processor, formatted, ["page.jpg"],
max_tokens=4096, temperature=0.0, verbose=False)
print(result.text)
Prompt
The model was trained on a fixed set of prompts. For full-page parsing, use the following prompt exactly as written (it is the prompt published on the original model card):
- 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.
The output is a JSON list. Each element contains bbox, category and text. Tables are returned as HTML, formulas as LaTeX and other text as Markdown. Please refer to the original model card for the full description of the output format, the benchmark results and the recommended post-processing.
Evaluation
The numbers below come from a small, informal check of this conversion. They are not a benchmark, and they do not replace the evaluation published by the original authors on the original model card.
- Two printed Thai document pages (the examples from the original repository) were processed with the prompt above, at temperature 0, with mlx-vlm.
- All outputs were valid JSON, and no output entered a repetition loop.
- The 8-bit and bfloat16 variants produced the same layout elements (29 and 58 elements on the two pages). Compared element by element, 26 of 29 and 56 of 58 texts were identical, and the remainder differed by a few characters. The two variants did not always list the elements in the same order.
- Only these two pages were examined. Handwriting, question answering and extraction tasks were not tested. Memory figures are the measured peak for these two pages and increase with larger images.
Limitations
- Transcription errors. The original model already makes small errors on Thai text, such as substituted characters, tone marks or vowels. Do not rely on its output for critical values (for example account numbers, amounts or names) without verification.
- Image resolution and layout boxes. The original card recommends allowing images of up to 16.7 megapixels (
max_pixels). Some inference tools do not expose this setting, and large pages may then be downscaled. In that case the number and size of layout elements can differ from results obtained with the original settings, even when the text is similar. - Repetition. The model can repeat text until the token limit is reached, most often on dense multi-column pages. Use temperature 0 and a bounded
max_tokens. - Scope. As stated by the original authors, key-information extraction is the weakest task of this model, and its output should be checked before it is used downstream. The model has no safety filtering and can output text that is not present in the image.
- Quantization. Quantization generally affects OCR more than conversational use. The 4-bit variant was not tested and is not published.
License and attribution
The model weights are derived from Typhoon OCR V2 2B and are distributed under the Apache License 2.0, as is the original. All credit for the model belongs to the authors at Typhoon (SCB 10X) and to the authors of the base model, Infinity-Parser2-Flash. Use of the model is also subject to the OpenTyphoon Terms and Conditions.
Citation
If you use this model, please cite the original work:
@misc{nonesung2026typhoonocropenvisionlanguage,
title = {Typhoon OCR: Open Vision-Language Model For Thai Document Extraction},
author = {Surapon Nonesung and Natapong Nitarach and Teetouch Jaknamon and Pittawat Taveekitworachai and Kunat Pipatanakul},
year = {2026},
eprint = {2601.14722},
archivePrefix = {arXiv},
primaryClass = {cs.CL},
url = {https://arxiv.org/abs/2601.14722}
}
- Downloads last month
- -
Quantized
Model tree for jitvimol/typhoon-ocr2-2b-mlx-bf16
Base model
infly/Infinity-Parser2-Flash