Image-Text-to-Text
Transformers
Safetensors
English
Hindi
glm_ocr
ocr
document-understanding
on-prem
enterprise
kitefishai
conversational
Eval Results
Instructions to use KiteFishAI/Nano-OCR-1B with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use KiteFishAI/Nano-OCR-1B with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("image-text-to-text", model="KiteFishAI/Nano-OCR-1B") messages = [ { "role": "user", "content": [ {"type": "image", "url": "https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/p-blog/candy.JPG"}, {"type": "text", "text": "What animal is on the candy?"} ] }, ] pipe(text=messages)# pip install -U transformers accelerate # Load model directly from transformers import AutoTokenizer, AutoModelForMultimodalLM tokenizer = AutoTokenizer.from_pretrained("KiteFishAI/Nano-OCR-1B") model = AutoModelForMultimodalLM.from_pretrained("KiteFishAI/Nano-OCR-1B", device_map="auto") messages = [ { "role": "user", "content": [ {"type": "image", "url": "https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/p-blog/candy.JPG"}, {"type": "text", "text": "What animal is on the candy?"} ] }, ] inputs = tokenizer.apply_chat_template( messages, add_generation_prompt=True, tokenize=True, return_dict=True, return_tensors="pt", ).to(model.device) outputs = model.generate(**inputs, max_new_tokens=256) print(tokenizer.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use KiteFishAI/Nano-OCR-1B with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "KiteFishAI/Nano-OCR-1B" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "KiteFishAI/Nano-OCR-1B", "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/KiteFishAI/Nano-OCR-1B
- SGLang
How to use KiteFishAI/Nano-OCR-1B with SGLang:
Install from pip and serve model
# Install SGLang from pip: pip install sglang # Start the SGLang server: python3 -m sglang.launch_server \ --model-path "KiteFishAI/Nano-OCR-1B" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "KiteFishAI/Nano-OCR-1B", "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 images
docker run --gpus all \ --shm-size 32g \ -p 30000:30000 \ -v ~/.cache/huggingface:/root/.cache/huggingface \ --env "HF_TOKEN=<secret>" \ --ipc=host \ lmsysorg/sglang:latest \ python3 -m sglang.launch_server \ --model-path "KiteFishAI/Nano-OCR-1B" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "KiteFishAI/Nano-OCR-1B", "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" } } ] } ] }' - Docker Model Runner
How to use KiteFishAI/Nano-OCR-1B with Docker Model Runner:
docker model run hf.co/KiteFishAI/Nano-OCR-1B
File size: 2,656 Bytes
7b65008 db6d344 7b65008 db6d344 7b65008 a2bc494 7b65008 db6d344 7b65008 db6d344 7b65008 a2bc494 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 | ---
license: mit
base_model: zai-org/GLM-OCR
pipeline_tag: image-text-to-text
tags:
- ocr
- document-understanding
- on-prem
- enterprise
- kitefishai
language:
- en
- hi
library_name: transformers
---
# Minnow-OCR-1B
**Minnow-OCR-1B** is the baseline release in the Minnow OCR series from [KiteFishAI](https://kitefishai.com) — document intelligence models packaged for air-gapped, on-prem deployment in regulated enterprise environments (BFSI, healthcare, legal).
Domain-adapted variants fine-tuned on Indian enterprise documents — multilingual forms, insurance surveyor reports, clinical records, and regulatory filings — will follow in subsequent Minnow-OCR releases.
## Why this exists
Regulated Indian enterprises frequently cannot pull models from external sources at deployment time: air-gapped infrastructure, data-residency mandates, and procurement controls require a vetted, internally distributed model registry. The Minnow-OCR series provides that registry layer — known-good checkpoints, reproducible serving configurations, and a clear upgrade path to domain-adapted versions.
## Model description
The underlying model is a compact (~0.9B parameter) encoder-decoder vision-language model for complex document understanding, built on the GLM-V architecture with a CogViT visual encoder, a lightweight cross-modal connector, and a GLM-0.5B language decoder. It delivers state-of-the-art results for its size class on major document benchmarks, including OmniDocBench and formula/table recognition tasks.
## Usage
```python
from transformers import AutoModelForImageTextToText, AutoProcessor
model_id = "KiteFishAI/Minnow-OCR-1B"
processor = AutoProcessor.from_pretrained(model_id)
model = AutoModelForImageTextToText.from_pretrained(model_id, device_map="auto")
```
For high-throughput serving:
```bash
python -m sglang.launch_server --model KiteFishAI/Minnow-OCR-1B --port 8080
```
## License and attribution
The model weights are released under the **MIT License**, originally developed and released by Z.ai as GLM-OCR. This repository redistributes those weights with attribution, per the license terms. If you use the full OCR pipeline with PP-DocLayoutV3 layout analysis, note that component is licensed under Apache License 2.0; comply with both licenses.
## About KiteFishAI
KiteFishAI builds deployable enterprise intelligence systems for regulated Indian enterprises — full on-prem stacks spanning custom models, fine-tuning on enterprise data, and air-gapped deployment. Learn more at [kitefishai.com](https://kitefishai.com) or [huggingface.co/KiteFishAI](https://huggingface.co/KiteFishAI). |