Instructions to use bharatgenai/Patram1.5-7B with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use bharatgenai/Patram1.5-7B with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("image-text-to-text", model="bharatgenai/Patram1.5-7B", trust_remote_code=True) 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 AutoModelForImageTextToText model = AutoModelForImageTextToText.from_pretrained("bharatgenai/Patram1.5-7B", trust_remote_code=True, device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use bharatgenai/Patram1.5-7B with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "bharatgenai/Patram1.5-7B" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "bharatgenai/Patram1.5-7B", "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/bharatgenai/Patram1.5-7B
- SGLang
How to use bharatgenai/Patram1.5-7B 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 "bharatgenai/Patram1.5-7B" \ --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": "bharatgenai/Patram1.5-7B", "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 "bharatgenai/Patram1.5-7B" \ --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": "bharatgenai/Patram1.5-7B", "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 bharatgenai/Patram1.5-7B with Docker Model Runner:
docker model run hf.co/bharatgenai/Patram1.5-7B
Get access to Patram 1.5
Free under Apache 2.0. Access is granted straight away.
BharatGen receives your Hugging Face username and email address, and your answers below, to understand who uses our models and to contact you about them. We don't sell them. How we handle them: https://bharatgen.com/privacy-policy/#downloads
Log in or Sign Up to review the conditions and access this model content.
Patram 1.5
Patram 1.5 7B from BharatGen is a multi-task vision foundation model, built in India. It reads documents as images, including scans, forms, tables, charts and pages with text in more than one language, and works from the page itself rather than from a separate OCR step. It parses pages, answers questions about them, extracts key-value data and transcribes on request, and it can decline to answer when a page does not contain the answer.
News
- [2026-11-26] Released Patram 1.5, with two new capabilities: OCR 3.0 and abstention (see Capabilities).
Index
Capabilities
Patram 1.5 covers six capabilities, from reading a page to reasoning over it. OCR 3.0 and abstention are new in this release.
| Capability | What it does |
|---|---|
| Doc parsing | Converts a page to plain text, Markdown, HTML or JSON, including handwritten, scene-text and code-mixed text. |
| Element parsing | Parses elements within a page: tables (including nested and complex tables), charts, formulas and diagrams. |
| Ask anything | Answers questions about a document, including multi-image and multi-step questions. |
| Key-value extraction | Extracts fields as JSON, either with a schema you provide or as printed, with normalised units. |
| OCR 3.0 | OCR that the prompt controls: which part of the page (by position or by meaning), which format, which details (text, structure, style, layout, image quality), whose labels, and what to leave out. |
| Abstention | Says "I donโt know", or marks what is unclear, when the document does not contain the answer, the text cannot be read as asked, the question is ambiguous or the evidence conflicts. |
Benchmarks
Patram 1.5 was evaluated on PatramBench, BharatGen's own benchmark (15 tasks), and on 34 public benchmarks, against 27 other models: 20 vision-language models and 7 OCR and parsing systems. Every score is from our own run with the same settings. The overall score is the mean of the PatramBench and public results, weighted equally. Public benchmarks use English test items only.
Overall score, 21 vision-language models. Models with the same score share a place.
Patram 1.5 sets the Pareto front in accuracy versus model size.
For every benchmark and the full results, refer to the blog.
Technical details
| Property | Details |
|---|---|
| Vision encoder | google/siglip2-so400m-patch14-384 |
| Language decoder | allenai/Olmo-3-7B-Instruct |
| Parameters | 7.8B |
| Context length | 32,768 tokens |
| Languages | English and code-mixed pages |
| License | Apache 2.0 |
Inference
Environment
pip install torch==2.10.0 torchvision transformers==4.57.6 accelerate einops pillow huggingface_hub
# the repository is gated: accept the access conditions on the model page, then
export HF_TOKEN=hf_........
Tested with torch 2.10.0 and transformers 4.57.6. Models load with trust_remote_code=True.
Hugging Face
Load the model with Hugging Face, then run the sample questions with one call to run_examples. The sample files (examples/assets/ in this repository) are downloaded from the Hub, each question is printed with the model's answer, and the answer to expect is in the comment under each question in examples/hf_examples.py. Use greedy decoding (do_sample=False).
import os
import torch
from transformers import AutoModelForImageTextToText, AutoProcessor
MODEL_ID = os.environ.get("PATRAM_MODEL", "bharatgenai/Patram1.5-7B") # a Hub id or a local folder
HF_TOKEN = os.environ.get("HF_TOKEN") # needed only while the repository is gated
DEVICE = "cuda:0" if torch.cuda.is_available() else "cpu"
processor = AutoProcessor.from_pretrained(MODEL_ID, trust_remote_code=True, token=HF_TOKEN)
model = AutoModelForImageTextToText.from_pretrained(
MODEL_ID, trust_remote_code=True, torch_dtype=torch.bfloat16, device_map=DEVICE, token=HF_TOKEN
).eval()
# Run the sample questions (run this from the repository folder)
from examples.hf_examples import run_examples
run_examples(model, processor, MODEL_ID, HF_TOKEN)
Note: If you're trying this on an Apple Silicon (M1/M2/M3/M4/...) chip, please follow the official documentation by PyTorch and Hugging Face for installing dependencies:
vLLM
Quick start:
export HF_TOKEN=<your token>
# 1. Download (~16 GB, includes the vLLM patch and examples)
hf download bharatgenai/Patram1.5-7B --local-dir ./Patram1.5-7B --token $HF_TOKEN
# 2. Start the server: bash launch_vllm.sh <gpu_id> <port> <model_dir>
bash ./Patram1.5-7B/vllm_patch/launch_vllm.sh 0 8000 ./Patram1.5-7B
docker logs -f patram15-vllm-gpu0-$USER # wait for "Application startup complete" (~2-3 min)
# 3. Test it
curl http://localhost:8000/v1/models # should list "patram"
pip install requests
python ./Patram1.5-7B/examples/vllm_examples.py --url http://localhost:8000 --assets ./Patram1.5-7B/examples/assets
# 4. Stop
docker rm -f patram15-vllm-gpu0-$USER
If docker's bridge network is broken (veth... Device does not exist), put HOST_NET=1 in front of the bash command in step 2.
Try Patram 1.5 now in the playground.
To get API access, join the API waitlist.
Citation
@misc{bharatgen_patram1_5_2026,
title = {Introducing Patram 1.5},
author = {{BharatGen Team}},
year = {2026},
howpublished = {\url{https://bharatgen.com/blogs/introducing-patram-1-5}},
note = {Accessed: 26/11/2026}
}
Contact
- Contact Form
- Hugging Face Community Tab
License
- Downloads last month
- 189