# Chandra

> Open-source OCR model from Datalab that converts images and PDFs into structured HTML, Markdown, or JSON while preserving layout.

Chandra is an open OCR model from Datalab that converts images and PDFs into structured HTML, Markdown, or JSON while preserving layout information. The current release, Chandra OCR 2 (v0.2.0, published March 2026), ships with a Python CLI, a Streamlit demo app, and vLLM or HuggingFace inference backends.

## What It Is

Chandra is a document OCR model plus tooling. You give it images or PDFs and it returns Markdown, HTML, and a metadata JSON file with page information and token counts. Extracted images are saved alongside the text. The README lists support for 90+ languages, handwriting, forms including checkboxes, tables, math, and complex layouts, along with image and diagram extraction with captions and structured data.

## How You Run It

Install with pip install chandra-ocr. The base install targets a vLLM backend, and a chandra_vllm command launches a Docker-based vLLM server. A HuggingFace backend (requires torch) is available as an extra. The chandra command processes a single file or a directory, with options for page ranges, max output tokens, parallel workers, batch size, image extraction, and header/footer inclusion. Settings can come from environment variables or a local.env file. The README suggests flash attention for the HuggingFace method.

## Benchmarks and Licensing

Datalab reports its own multilingual benchmark and olmOCR benchmark results, with Chandra 2 scoring 85.8 overall in its published table. These are vendor-reported figures. The code is Apache 2.0. The model weights use a modified OpenRAIL-M license, which Datalab describes as free for research, personal use, and startups under $2M funding or revenue, and not usable competitively with its API. Commercial self-hosting needs a license.

## Relationship to the Datalab Platform

Datalab also offers a managed platform that it says uses an improved Chandra and other models with higher accuracy than the open weights. The platform has processors for convert, extract, segment, and eval, versioned pipelines, and managed cloud, VPC, or air-gapped deployment.

## Features
- Converts images and PDFs to Markdown, HTML, or JSON with layout information
- Support for 90+ languages
- Handwriting recognition
- Form reconstruction including checkboxes
- Table, math, and complex layout handling
- Image and diagram extraction with captions and structured data
- Local (HuggingFace) and remote (vLLM server) inference modes
- CLI and Streamlit demo app
- Page range selection and batch processing options

## Integrations
vLLM, HuggingFace Transformers, Docker, Flash Attention

## Platforms
LINUX, WEB, API, DEVELOPER_SDK, CLI

## Pricing
Open Source, Free tier available

## Version
v0.2.0

## Links
- Website: https://www.datalab.to
- Documentation: https://documentation.datalab.to/
- Repository: https://github.com/datalab-to/chandra
- EveryDev.ai: https://www.everydev.ai/tools/chandra
