Image-Text-to-Text
Transformers
Safetensors
Portuguese
qwen2_5_vl
ocr
document-understanding
structured-extraction
specialized-small-language-model
brazilian-portuguese
conversational
text-generation-inference
compressed-tensors
Instructions to use Dharma-AI/Dharma-OCR-LITE with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use Dharma-AI/Dharma-OCR-LITE with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("image-text-to-text", model="Dharma-AI/Dharma-OCR-LITE") 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)# Load model directly from transformers import AutoProcessor, AutoModelForMultimodalLM processor = AutoProcessor.from_pretrained("Dharma-AI/Dharma-OCR-LITE") model = AutoModelForMultimodalLM.from_pretrained("Dharma-AI/Dharma-OCR-LITE", 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 = processor.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=40) print(processor.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use Dharma-AI/Dharma-OCR-LITE with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "Dharma-AI/Dharma-OCR-LITE" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "Dharma-AI/Dharma-OCR-LITE", "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/Dharma-AI/Dharma-OCR-LITE
- SGLang
How to use Dharma-AI/Dharma-OCR-LITE 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 "Dharma-AI/Dharma-OCR-LITE" \ --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": "Dharma-AI/Dharma-OCR-LITE", "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 "Dharma-AI/Dharma-OCR-LITE" \ --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": "Dharma-AI/Dharma-OCR-LITE", "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 Dharma-AI/Dharma-OCR-LITE with Docker Model Runner:
docker model run hf.co/Dharma-AI/Dharma-OCR-LITE
| DHARMA-AI NOTICE | |
| Project: DharmaOCR Lite | |
| Copyright (c) 2026 DHARMA-AI S.A. | |
| 1. Model artifacts | |
| Model weights, checkpoints, tokenizer files, configuration files, adapters, model cards, | |
| and related model artifacts are licensed under: | |
| DharmaOCR Lite Noncommercial License 2026 | |
| SPDX-License-Identifier: LicenseRef-DharmaOCR-Lite-NC-2026 | |
| 2. Attribution | |
| Where attribution is required for the Model, the following form is sufficient: | |
| "Powered by DharmaOCR Lite by DHARMA-AI S.A., licensed under the | |
| DharmaOCR Lite Noncommercial License 2026." | |
| 3. Important restrictions for the Model | |
| The Model is made available only for restricted noncommercial use. | |
| Government use is expressly excluded unless separately licensed in writing by DHARMA-AI S.A. | |
| Commercial use, hosted/API use, OEM/embedded use, enterprise use, and other institutional | |
| use require a separate written license. | |
| 4. Privacy notice summary | |
| According to the release statement adopted for this repository, the released training corpus | |
| did not use personal information as part of the released training corpus, and any independent | |
| use of the software, weights, or artifacts must comply with applicable local data protection law. | |
| The mere licensing or distribution of the Model does not make DHARMA-AI S.A. a controller, | |
| processor, operator, joint controller, or equivalent with respect to downstream uses by licensees. | |
| 5. Contact | |
| Commercial, enterprise, government, OEM/embedded, and hosted/API licensing: | |
| commercial@dharma-ai.com.br | |
| https://dharma-ai.com.br/ | |