Instructions to use prithivMLmods/chandra-ocr-2-GGUF with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use prithivMLmods/chandra-ocr-2-GGUF with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("image-text-to-text", model="prithivMLmods/chandra-ocr-2-GGUF") 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 AutoModel model = AutoModel.from_pretrained("prithivMLmods/chandra-ocr-2-GGUF", dtype="auto") - llama-cpp-python
How to use prithivMLmods/chandra-ocr-2-GGUF with llama-cpp-python:
# !pip install llama-cpp-python from llama_cpp import Llama llm = Llama.from_pretrained( repo_id="prithivMLmods/chandra-ocr-2-GGUF", filename="chandra-ocr-2.BF16.gguf", )
llm.create_chat_completion( 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" } } ] } ] ) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- llama.cpp
How to use prithivMLmods/chandra-ocr-2-GGUF 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 prithivMLmods/chandra-ocr-2-GGUF:Q4_K_M # Run inference directly in the terminal: llama cli -hf prithivMLmods/chandra-ocr-2-GGUF:Q4_K_M
Install from WinGet (Windows)
winget install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama serve -hf prithivMLmods/chandra-ocr-2-GGUF:Q4_K_M # Run inference directly in the terminal: llama cli -hf prithivMLmods/chandra-ocr-2-GGUF: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 prithivMLmods/chandra-ocr-2-GGUF:Q4_K_M # Run inference directly in the terminal: ./llama-cli -hf prithivMLmods/chandra-ocr-2-GGUF: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 prithivMLmods/chandra-ocr-2-GGUF:Q4_K_M # Run inference directly in the terminal: ./build/bin/llama-cli -hf prithivMLmods/chandra-ocr-2-GGUF:Q4_K_M
Use Docker
docker model run hf.co/prithivMLmods/chandra-ocr-2-GGUF:Q4_K_M
- LM Studio
- Jan
- vLLM
How to use prithivMLmods/chandra-ocr-2-GGUF with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "prithivMLmods/chandra-ocr-2-GGUF" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "prithivMLmods/chandra-ocr-2-GGUF", "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/prithivMLmods/chandra-ocr-2-GGUF:Q4_K_M
- SGLang
How to use prithivMLmods/chandra-ocr-2-GGUF 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 "prithivMLmods/chandra-ocr-2-GGUF" \ --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": "prithivMLmods/chandra-ocr-2-GGUF", "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 "prithivMLmods/chandra-ocr-2-GGUF" \ --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": "prithivMLmods/chandra-ocr-2-GGUF", "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" } } ] } ] }' - Ollama
How to use prithivMLmods/chandra-ocr-2-GGUF with Ollama:
ollama run hf.co/prithivMLmods/chandra-ocr-2-GGUF:Q4_K_M
- Unsloth Studio
How to use prithivMLmods/chandra-ocr-2-GGUF 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 prithivMLmods/chandra-ocr-2-GGUF 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 prithivMLmods/chandra-ocr-2-GGUF to start chatting
Using HuggingFace Spaces for Unsloth
# No setup required # Open https://huggingface.co/spaces/unsloth/studio in your browser # Search for prithivMLmods/chandra-ocr-2-GGUF to start chatting
- Pi
How to use prithivMLmods/chandra-ocr-2-GGUF with Pi:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama serve -hf prithivMLmods/chandra-ocr-2-GGUF:Q4_K_M
Configure the model in Pi
# Install Pi: npm install -g @mariozechner/pi-coding-agent # Add to ~/.pi/agent/models.json: { "providers": { "llama-cpp": { "baseUrl": "http://localhost:8080/v1", "api": "openai-completions", "apiKey": "none", "models": [ { "id": "prithivMLmods/chandra-ocr-2-GGUF:Q4_K_M" } ] } } }Run Pi
# Start Pi in your project directory: pi
- Hermes Agent new
How to use prithivMLmods/chandra-ocr-2-GGUF with Hermes Agent:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama serve -hf prithivMLmods/chandra-ocr-2-GGUF:Q4_K_M
Configure Hermes
# Install Hermes: curl -fsSL https://hermes-agent.nousresearch.com/install.sh | bash hermes setup # Point Hermes at the local server: hermes config set model.provider custom hermes config set model.base_url http://127.0.0.1:8080/v1 hermes config set model.default prithivMLmods/chandra-ocr-2-GGUF:Q4_K_M
Run Hermes
hermes
- Atomic Chat new
- OpenClaw new
How to use prithivMLmods/chandra-ocr-2-GGUF with OpenClaw:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama serve -hf prithivMLmods/chandra-ocr-2-GGUF:Q4_K_M
Configure OpenClaw
# Install OpenClaw: npm install -g openclaw@latest # Register the local server and set it as the default model: openclaw onboard --non-interactive --mode local \ --auth-choice custom-api-key \ --custom-base-url http://127.0.0.1:8080/v1 \ --custom-model-id "prithivMLmods/chandra-ocr-2-GGUF:Q4_K_M" \ --custom-provider-id llama-cpp \ --custom-compatibility openai \ --custom-text-input \ --accept-risk \ --skip-health
Run OpenClaw
openclaw agent --local --agent main --message "Hello from Hugging Face"
- Docker Model Runner
How to use prithivMLmods/chandra-ocr-2-GGUF with Docker Model Runner:
docker model run hf.co/prithivMLmods/chandra-ocr-2-GGUF:Q4_K_M
- Lemonade
How to use prithivMLmods/chandra-ocr-2-GGUF with Lemonade:
Pull the model
# Download Lemonade from https://lemonade-server.ai/ lemonade pull prithivMLmods/chandra-ocr-2-GGUF:Q4_K_M
Run and chat with the model
lemonade run user.chandra-ocr-2-GGUF-Q4_K_M
List all available models
lemonade list
Thank you for the Great model!
Prithiv,
First of all, just wanted to say thanks for bringing this model to GGUF format. It is an amazing model and is dramatically changing my workflow because it's a very detailed model and it's leaps and bounds above a lot of other models right now. I've been using it extensively since the first day you released it.
I have ran into a few problems or quirks, and just wanted to show them to you because maybe I don't understand how to use this model correctly. I'm not a developer by any means, just a medical student that likes to play on the technical side of things. If you have any suggestions, fantastic I will take them to heart. And obviously some of this issues are not from the GGUF version, but the actual model itself.
Summary by my Codex on the issues we've found:
Technical feedback on chandra-ocr-2 GGUF for diagram-heavy lecture-slide OCR
Thanks again for converting this model to GGUF.
I know you made the GGUF release, not the original base model, so I’m trying to keep this question scoped to the parts that are most likely in your lane: quant choice, template/prompting, invocation style, and whether some of the behavior we’re seeing is expected on the local GGUF path.
Use case
We’re using chandra-ocr-2 locally in a hybrid OCR pipeline for medical-school lecture PDFs.
Typical pages include:
- title/objective/outline slides
- dense bullet/prose slides
- pathway and signaling diagrams
- mixed text + diagram slides
- tables and diagram-tables
- transcript-heavy continuation slides
Our goal is extraction-style, study-ready markdown. We care a lot about preserving the semantic content of mechanism diagrams, but we also want conservative behavior on slides that are basically plain text.
What we’re seeing
Some of the recurring behavior may be upstream model behavior rather than GGUF-specific, but I wanted to ask whether any of the following are expected or fixable through better GGUF usage/settings:
- On some pages, the model is still too eager to describe text-heavy slides that should probably just stay plain OCR-only.
- On some real diagram/mechanism pages, the output is too thin and collapses toward a title-level summary even when the raw response appears to contain more useful detail.
- The output surface is not always stable. Depending on the page, we may get:
- layout HTML with bbox metadata
- JSON-like layout blobs
- planner/meta text
- semantic explanation that seems better in a reasoning-style channel than in the main content channel
- Table and diagram-table pages seem to need more headroom and more careful handling than generic pages.
A few concrete examples from our validation runs
Representative failure classes:
- over-triggering on title/objective/outline pages
- diagram pages left effectively text-only
- correctly-routed pages where the final semantic output is just a very thin summary
On one larger microbiology validation pass, even after local fixes on our side, the residual issues still looked like this:
- over-routed text pages:
99 -> 42 - under-described diagram/mechanism pages:
28 -> 17 - thin semantic outputs:
20 -> 6
So the model is definitely usable and the direction is positive, but those three failure classes remain fairly consistent for our workload.
My actual questions
From the GGUF/conversion/local-runtime perspective:
- Do you recommend a specific quant for OCR workloads like this, especially diagram-heavy lecture slides?
- Is there a preferred chat template or prompt style for extraction-style OCR, as opposed to descriptive captioning?
- Are there generation settings you recommend to reduce the chance of getting bbox-heavy HTML, layout JSON, or planner/meta text?
- Is it normal on the GGUF path for the most useful semantic answer to sometimes show up outside the main content channel?
- If you’ve tested this model locally yourself, is there a “known good” invocation pattern for stable markdown-style extraction?
Scope note
If most of what I’m describing sounds like upstream base-model behavior rather than anything related to the GGUF conversion, no worries. In that case, I’d still really appreciate any advice on:
- which quant you trust most
- which prompt/template style works best
- which local invocation pattern gives the cleanest OCR-style outputs
If helpful, I can also post a small representative page set for the three main failure modes instead of dumping a giant wall of examples on you like it’s the extended cut of a very nerdy disaster film.
Thanks again for all that you do!
Bently