Image-Text-to-Text
GGUF
Korean
English
Chinese
llama.cpp
ocr
document-understanding
korean
multimodal
vision
deepseek-ocr
batiai
quantized
conversational
Instructions to use batiai/batisee with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- llama.cpp
How to use batiai/batisee with llama.cpp:
Install (macOS, Linux)
curl -LsSf https://llama.app/install.sh | sh # Start a local OpenAI-compatible server with a web UI: llama serve -hf batiai/batisee:Q4_K_M # Run inference directly in the terminal: llama cli -hf batiai/batisee:Q4_K_M
Install from WinGet (Windows)
winget install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama serve -hf batiai/batisee:Q4_K_M # Run inference directly in the terminal: llama cli -hf batiai/batisee:Q4_K_M
Use pre-built binary
# Download pre-built binary from: # https://github.com/ggerganov/llama.cpp/releases # Start a local OpenAI-compatible server with a web UI: ./llama-server -hf batiai/batisee:Q4_K_M # Run inference directly in the terminal: ./llama-cli -hf batiai/batisee:Q4_K_M
Build from source code
git clone https://github.com/ggerganov/llama.cpp.git cd llama.cpp cmake -B build cmake --build build -j --target llama-server llama-cli # Start a local OpenAI-compatible server with a web UI: ./build/bin/llama-server -hf batiai/batisee:Q4_K_M # Run inference directly in the terminal: ./build/bin/llama-cli -hf batiai/batisee:Q4_K_M
Use Docker
docker model run hf.co/batiai/batisee:Q4_K_M
- LM Studio
- Jan
- vLLM
How to use batiai/batisee with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "batiai/batisee" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "batiai/batisee", "messages": [ { "role": "user", "content": [ { "type": "text", "text": "Describe this image in one sentence." }, { "type": "image_url", "image_url": { "url": "https://cdn.britannica.com/61/93061-050-99147DCE/Statue-of-Liberty-Island-New-York-Bay.jpg" } } ] } ] }'Use Docker
docker model run hf.co/batiai/batisee:Q4_K_M
- Ollama
How to use batiai/batisee with Ollama:
ollama run hf.co/batiai/batisee:Q4_K_M
- Unsloth Studio
How to use batiai/batisee with Unsloth Studio:
Install Unsloth Studio (macOS, Linux, WSL)
curl -fsSL https://unsloth.ai/install.sh | sh # Run unsloth studio unsloth studio -H 0.0.0.0 -p 8888 # Then open http://localhost:8888 in your browser # Search for batiai/batisee to start chatting
Install Unsloth Studio (Windows)
irm https://unsloth.ai/install.ps1 | iex # Run unsloth studio unsloth studio -H 0.0.0.0 -p 8888 # Then open http://localhost:8888 in your browser # Search for batiai/batisee to start chatting
Using HuggingFace Spaces for Unsloth
# No setup required # Open https://huggingface.co/spaces/unsloth/studio in your browser # Search for batiai/batisee to start chatting
- Docker Model Runner
How to use batiai/batisee with Docker Model Runner:
docker model run hf.co/batiai/batisee:Q4_K_M
- Lemonade
How to use batiai/batisee with Lemonade:
Pull the model
# Download Lemonade from https://lemonade-server.ai/ lemonade pull batiai/batisee:Q4_K_M
Run and chat with the model
lemonade run user.batisee-Q4_K_M
List all available models
lemonade list
- Atomic Chat
| language: | |
| - ko | |
| - en | |
| - zh | |
| license: mit | |
| tags: | |
| - gguf | |
| - ocr | |
| - document-understanding | |
| - korean | |
| - multimodal | |
| - vision | |
| - deepseek-ocr | |
| - batiai | |
| - quantized | |
| base_model: baidu/Unlimited-OCR | |
| pipeline_tag: image-text-to-text | |
| library_name: llama.cpp | |
| # batisee β On-device Korean Document OCR by BatiAI | |
| <p align="center"> | |
| <a href="https://flow.bati.ai"><img src="https://img.shields.io/badge/BatiFlow-on--device%20AI-blue?style=for-the-badge&logo=apple"></a> | |
| <a href="#how-to-run-llamacpp"><img src="https://img.shields.io/badge/run-llama.cpp%20mtmd-orange?style=for-the-badge"></a> | |
| <img src="https://img.shields.io/badge/Ollama-coming%20soon-lightgrey?style=for-the-badge"> | |
| </p> | |
| > βΉοΈ **Ollama**: `batisee` uses the brand-new **DeepSeek-OCR (`deepseek2ocr`)** architecture, which the bundled Ollama engine does not load yet. Run it today with **llama.cpp** (below); Ollama support will follow once the engine merges this architecture. | |
| > **batisee** is BatiAI's on-device document-OCR model β part of the BatiAI perception family | |
| > (**batisay** = speech-to-text, **batispeak** = diarization, **batisee** = document/OCR). | |
| > | |
| > Built on [`baidu/Unlimited-OCR`](https://huggingface.co/baidu/Unlimited-OCR) (DeepSeek-OCR architecture, MIT), | |
| > **converted to GGUF directly from the original weights by BatiAI** (not a re-host of community quants), | |
| > BatiAI-signed, and **verified for Korean** so you can run it on a Mac with confidence. | |
| **batisee** λ BatiAI μΈμ§(perception) μ νκ΅°μ λ¬Έμ OCR λͺ¨λΈμ λλ€ (**batisay**=μμ±μΈμ, **batispeak**=νμλΆλ¦¬, **batisee**=λ¬Έμ/OCR). | |
| [`baidu/Unlimited-OCR`](https://huggingface.co/baidu/Unlimited-OCR)(DeepSeek-OCR μν€ν μ², MIT)λ₯Ό λ² μ΄μ€λ‘, **μλ³Έ κ°μ€μΉμμ BatiAIκ° μ§μ GGUF λ³ν**(νμ¬ μμνλ¬Ό μ¬λ°°ν¬ μλ)νκ³ , BatiAI μλͺ + **νκ΅μ΄ κ²μ¦**μ κ±°μ³ Macμμ λ°λ‘ μ°λλ‘ ν¨ν€μ§νμ΅λλ€. | |
| ## Why batisee? | |
| - **On-device** β runs locally on a Mac (no cloud, no upload). Q4_K_M is **1.9 GB**. | |
| - **Korean-verified** β measured on rendered Korean documents (see results below): clean text **CER 0%**, hard document (small font + table + blur) **100% key-content recall** with table structure preserved. | |
| - **Document-native** β outputs layout boxes (`<|det|>`) and converts tables to HTML `<table>`. | |
| - **Our own conversion** β GGUF built directly from `baidu/Unlimited-OCR` original safetensors, BatiAI-signed (`general.author = BatiAI`). | |
| - **MIT** β fully commercial-friendly. | |
| ## π batisee **v2** (recommended for printed / dense documents) β fixes dense-document looping | |
| > **Which to use:** **v2** for printed / dense / structured documents (receipts, multi-column, forms β fixes v1's looping). | |
| > **v1** (repo root) for **free handwriting** β v2 currently regresses there (see point 3 below). A corrected handwriting fine-tune is in progress. | |
| **v2** is a **BatiAI fine-tune** of batisee (LoRA on the text decoder), trained on rendered Korean | |
| documents **+ real AI-Hub Korean handwriting**. It targets a failure mode we found while stress-testing v1: | |
| on **dense receipts and multi-column pages**, the v1 Q4 GGUF can fall into a degenerate repeat loop | |
| (tens of thousands of `<|det|>image` tokens) that a stronger repeat-penalty alone does **not** fix. | |
| v2 cures this. | |
| **What improved β measured on the shipped GGUFs:** | |
| 1. **Dense-document robustness (Q4 GGUF β the headline).** Held-out dense Korean receipts + multi-column | |
| pages, **same recipe for both** (`--repeat-penalty 1.1 --repeat-last-n 512`): | |
| | metric | v1 Q4 | v2 Q4 | | |
| |---|---|---| | |
| | parse CER | **17β27** (degenerate) | **0.20** | | |
| | degenerate loops | **4 / 24** | **0 / 24** | | |
| | worst output length | **50,872 chars** | 134 chars | | |
| On the same receipt, v1 emits a 50 k-character `<|det|>image` loop; v2 returns a clean ~130-char parse. | |
| 2. **Parse quality** (transformers, apples-to-apples, both `repeat_penalty 1.05`): overall parse | |
| **CER 0.349 β 0.245** (~30 % relative), **every category down** β receipt 0.148β0.065, | |
| multi-column 0.637β0.242, form 0.231β0.136, invoice 0.310β0.242, official 0.065β0.018, report 0.047β0.030. | |
| 3. **β οΈ Handwriting β loop-safe, but a recognition regression vs v1 (be aware).** v2 no longer *loops* on | |
| handwriting (0 degenerate / 80 pages), **but it recognizes real Korean handwriting *worse* than v1.** | |
| On held-out real AI-Hub handwriting, order-agnostic word recall is **β 7 % for v2 vs β 30 % for v1** β the | |
| fine-tune over-anchored on printed-document patterns and tends to hallucinate document vocabulary on | |
| free handwriting. **For handwriting, prefer v1 (repo root).** A corrected handwriting fine-tune is in progress. | |
| **v2 files** β in the `v2/` folder; the v1 files stay at the repo root, unchanged: | |
| | File | Size | Use | | |
| |---|---:|---| | |
| | `v2/batisee-text-Q4_K_M.gguf` | 1.9 GB | **recommended** | | |
| | `v2/batisee-text-Q8_0.gguf` | 3.0 GB | highest quality | | |
| | `v2/mmproj-batisee-BF16.gguf` | 826 MB | vision encoder (identical to v1 β text-only fine-tune) | | |
| **β v2 recipe β the penalty must be stronger than v1's:** | |
| ```bash | |
| hf download batiai/batisee --include "v2/*" --local-dir ./batisee | |
| llama-mtmd-cli -m ./batisee/v2/batisee-text-Q4_K_M.gguf --mmproj ./batisee/v2/mmproj-batisee-BF16.gguf \ | |
| --image your-document.png -p "document parsing." \ | |
| --jinja --temp 0 --repeat-penalty 1.1 --repeat-last-n 512 -ngl 99 | |
| ``` | |
| llama.cpp's repeat-penalty uses a **sliding window** (default last-64 tokens), which is weaker than the | |
| whole-sequence penalty in transformers; on dense pages v1's `1.05` is not enough. **`1.1` + `--repeat-last-n 512`** | |
| removes the loops without hurting tables or legitimate repeated cells (validated: 0 loops on 80 handwriting + | |
| 36 dense synthetic pages; tables/receipts unaffected). Use this recipe for v2. | |
| **Honest limitations (read before you rely on it):** | |
| - **Accuracy gains are measured on rendered/synthetic Korean documents** (same generator family used for | |
| fine-tuning β in-domain). Real-world generalization beyond that is **not** proven by these numbers. | |
| - **Free handwriting is a regression vs v1** (word-recall β 7 % vs β 30 %) β see point 3 above. Use v1 for handwriting. | |
| - Real-world **camera photos and heavy skew remain the frontier** (shared with v1; quantified separately). | |
| - Tables are scored by **structure (TEDS)**, not CER β cell text can still slip on hard scans. | |
| - **There is no separate "field-extraction" mode.** An `"extract fields."` prompt returns the same full-page | |
| parse as `"document parsing."`, *not* structured JSON β parse the full-page output yourself for key/values. | |
| **v2** λ batisee μ **BatiAI νμΈνλ**(ν μ€νΈ λμ½λ LoRA)μ λλ€. λ λ νκ΅μ΄ λ¬Έμ **+ μ€μ AI-Hub νκ΅μ΄ μκΈμ¨**λ‘ νμ΅νκ³ , | |
| v1 μ μ½μ (λ°μ§ μμμ¦Β·λ€λ¨ νμ΄μ§μμ Q4 GGUF κ° `<|det|>image` μλ§ ν ν° λ°λ³΅ 루νμ λΉ μ§λ νμ β κ°ν penalty λ‘λ μ κ³ μ³μ§)μ | |
| **νμΈνλμΌλ‘ ν΄κ²°**νμ΅λλ€. λ°μ§ λ¬Έμ CER 17β27(ν΄ν)β**0.20**, 루ν 4/24β**0/24**, νμ€ CER 0.349β0.245(μ½ 30%β, μ μΉ΄ν κ³ λ¦¬ κ°μ ), | |
| **λ°λμ v2 λ μνΌ(`--repeat-penalty 1.1 --repeat-last-n 512`)** μ¬μ©. β οΈ **μκΈμ¨λ v1λ³΄λ€ ν΄ν**(루νλ 0/80μ΄λ μ€μ μΈμμ v2 λ¨μ΄ recall β7% < v1 β30% β νμΈνλμ΄ μΈμλ¬Έμμ κ³Όμ ν©) β **μκΈμ¨λ v1(루νΈ) κΆμ₯**, κ΅μ μ¬νμ΅ μ§ν μ€. μ νλ μμΉλ **ν©μ± in-domain κΈ°μ€**(μ€ μΌλ°ν λ―Έμ¦λͺ ). νλ ꡬ쑰(TEDS) κΈ°μ€, **λ³λ νλμΆμΆ(JSON) κΈ°λ₯ μμ**(`extract fields.` = `document parsing.` κ³Ό λμΌ μΆλ ₯). | |
| ## β Korean OCR results / νκ΅μ΄ OCR κ²μ¦ | |
| Rendered Korean documents (ground-truth known) β OCR β compared. Method & images: [`ocr-poc/gate-results`](https://github.com/batiai/batiai-models/tree/main/ocr-poc/gate-results). | |
| | Test / ν μ€νΈ | Difficulty / λμ΄λ | Hangul kept / νκΈλ³΄μ‘΄ | Key recall / ν΅μ¬recall | Table / ν | CER | | |
| |---|---|---|---|---|---| | |
| | Gate 1 (clean) | clean text | **100%** | β | β | **0.0%** | | |
| | Gate 2 (hard) | small font + table + blur | **100%** | **100%** | β `<table>` | β | | |
| Both **Q8_0** and **Q4_K_M** pass with no degradation and no decoding loops. | |
| Q8/Q4 λͺ¨λ νμ§ μ νΒ·λμ½λ© 루ν μμ΄ ν΅κ³Ό. | |
| ## Available files | |
| | File | Size | Use | | |
| |------|-----:|-----| | |
| | `batisee-text-Q8_0.gguf` | 3.0 GB | highest quality / μ΅κ³ νμ§ | | |
| | `batisee-text-Q4_K_M.gguf` | 1.9 GB | **16 GB Mac sweet spot (recommended)** | | |
| | `mmproj-batisee-BF16.gguf` | 826 MB | vision encoder (required) / λΉμ μΈμ½λ(νμ) | | |
| ## How to run (llama.cpp) | |
| > β οΈ This is a **multimodal** model β you always need **both** the text GGUF **and** `mmproj-batisee-BF16.gguf`. | |
| > | |
| > π **On a Mac**: `brew install llama.cpp` (version **β₯ 9430**) provides `llama-mtmd-cli` and loads `batisee` directly β **verified on M4 Max, no source build needed**. | |
| ```bash | |
| hf download batiai/batisee --include "batisee-text-Q4_K_M.gguf" --include "mmproj-batisee-BF16.gguf" --local-dir ./batisee | |
| llama-mtmd-cli \ | |
| -m ./batisee/batisee-text-Q4_K_M.gguf \ | |
| --mmproj ./batisee/mmproj-batisee-BF16.gguf \ | |
| --image your-document.png \ | |
| -p "document parsing." \ | |
| --jinja --temp 0 --repeat-penalty 1.05 -ngl 99 | |
| ``` | |
| ### β Recipe matters (learned the hard way) | |
| | Flag | Why | | |
| |------|-----| | |
| | `-p "document parsing."` | The prompt **must** be this. `"Free OCR."` triggers a buggy reasoning mode that emits meta-commentary instead of the text. | | |
| | `--jinja` | Without it the chat-template step crashes. | | |
| | `--temp 0 --repeat-penalty 1.05` | Without the penalty the decoder can fall into an infinite repeat loop. | | |
| ## Model details | |
| - **Base**: [`baidu/Unlimited-OCR`](https://huggingface.co/baidu/Unlimited-OCR) β **DeepSeek-OCR architecture** | |
| - Text: DeepSeek-3B-MoE (12 layers, 64 routed experts top-6, standard MHA, 32K context) β `deepseek2ocr` | |
| - Vision: DeepEncoder (CLIP-L-14 + SAM-ViT-B, 1024px) + linear projector | |
| - **Conversion**: built directly from original safetensors with `llama.cpp` (DeepSeek-OCR support). Image normalization `mean = std = [0.5, 0.5, 0.5]`. | |
| - **License**: MIT (inherited) | |
| ## BatiAI signing | |
| All GGUFs carry: | |
| - `general.author = BatiAI` | |
| - `general.url = https://flow.bati.ai` | |
| ## Attribution & License | |
| This model is a GGUF distribution of `baidu/Unlimited-OCR` (**MIT**), which is built on the DeepSeek-OCR architecture. Original authors' work and license are retained; BatiAI's contribution is the from-original GGUF conversion, signing, Korean verification, and on-device packaging. | |
| λ³Έ λͺ¨λΈμ `baidu/Unlimited-OCR`(MIT)μ GGUF λ°°ν¬λ³Έμ λλ€. μμ μμ μμ Β·λΌμ΄μ μ€λ₯Ό μ μ§νλ©°, BatiAI κΈ°μ¬λ μλ³Έμμμ μ§μ GGUF λ³νΒ·μλͺ Β·νκ΅μ΄ κ²μ¦Β·μ¨λλ°μ΄μ€ ν¨ν€μ§μ λλ€. | |
| ## Roadmap | |
| - β **v2 shipped** β fixes dense-document looping, ~30 % parse-CER reduction on printed docs. See the v2 section above. | |
| - π§ **In progress β handwriting fine-tune (corrected):** v2 regressed free-handwriting recognition vs v1 (over-anchored on printed docs). Re-doing it with spatial-order labels + anti-forgetting recipe + a word-recall no-regression gate vs v1. | |
| - Next: **real-world camera photos / heavy skew / low-quality scans** β still the frontier; v2's measured gains are on rendered/synthetic docs. | |
| - Ollama support once the `deepseek2ocr` engine merges. | |
| - β **v2 μΆμ** β λ°μ§λ¬Έμ 루ν ν΄κ²° + μΈμλ¬Έμ νμ€ CER μ½ 30%β. π§ **μκΈμ¨λ κ΅μ μ¬νμ΅ μ§ν μ€**(v2κ° v1 λλΉ μκΈμ¨ ν΄ν β 곡κ°μ λ ¬ λΌλ²¨+anti-forgetting+무νκ· κ²μ΄νΈ). μ€ μΉ΄λ©λΌ/μ곑μ λ€μ νλ‘ ν°μ΄. | |
| ## About BatiFlow | |
| [BatiFlow](https://flow.bati.ai) β free, unlimited, on-device AI for Mac. | |
| <!-- BENCH-START --> | |
| ### On-device benchmark β MacBook Pro M4 Max (Q4_K_M) | |
| Measured with `brew` `llama-mtmd-cli` 9430, on the same 4 stress documents as the desktop GPU. | |
| | Metric | Value | | |
| |--------|-------| | |
| | Engine | Homebrew `llama.cpp` (`llama-mtmd-cli`) **9430** β loads `deepseek2ocr` fine, **no source build needed** | | |
| | Page latency (full pipeline) | **~3.0 s/page** cold, ~3 s warm (β desktop GPU's 2.56 s/page) | | |
| | Memory (max RSS) | **2.94 GB** (peak 2.97 GB) | | |
| | Quality | digital docs/tables near-perfect (numbers 100%, occasional single KR-glyph slip); heavy degradation / skew = known limits β v2 roadmap | | |
| > `tokens/sec` and standalone mmproj-encode time are **not emitted by the 9430 Homebrew bottle** (its perf block is suppressed); available via a source build if needed. Page latency + RSS are the user-facing numbers and confirm M4 Max β desktop-GPU class. | |
| <!-- BENCH-END --> | |