Instructions to use cloudraker/rakedoc-nano-2 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use cloudraker/rakedoc-nano-2 with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("image-text-to-text", model="cloudraker/rakedoc-nano-2") 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 AutoProcessor, AutoModelForMultimodalLM processor = AutoProcessor.from_pretrained("cloudraker/rakedoc-nano-2") model = AutoModelForMultimodalLM.from_pretrained("cloudraker/rakedoc-nano-2", 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=256) print(processor.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use cloudraker/rakedoc-nano-2 with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "cloudraker/rakedoc-nano-2" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "cloudraker/rakedoc-nano-2", "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/cloudraker/rakedoc-nano-2
- SGLang
How to use cloudraker/rakedoc-nano-2 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 "cloudraker/rakedoc-nano-2" \ --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": "cloudraker/rakedoc-nano-2", "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 "cloudraker/rakedoc-nano-2" \ --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": "cloudraker/rakedoc-nano-2", "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 cloudraker/rakedoc-nano-2 with Docker Model Runner:
docker model run hf.co/cloudraker/rakedoc-nano-2
rakedoc-nano-2
A 1.2B-parameter document parser (Qwen2-VL architecture). It is a fine-tune of KDLAI/KDL-Frontier-Parser-nano-v2 with better chart extraction and text formatting. Weights are merged and stored in bf16, so you do not need to load an adapter.
This model powers the document parsing pipeline of the CloudRaker Paperwork API.
Lineage and license
| Link | Owner | License |
|---|---|---|
| Qwen2-VL | Alibaba | Apache-2.0 |
| KDL-Frontier-Parser-nano-v2 | KoreaDeep | AGPL-3.0 |
| rakedoc-nano-2 | CloudRaker | AGPL-3.0 |
rakedoc-nano-2 inherits AGPL-3.0 from the KDL weights. See LICENSE and NOTICE.
rakedoc-nano-2 is not trained from cloudraker/rakedoc-nano. That model comes from KDL-Frontier-Parser-nano (v1). KDL v2 is not a fine-tune of v1, so we trained again from v2.
ParseBench
Mean of 3 full runs on ParseBench main (commit a5eeca8) with the rakedoc_nano pipeline
(registered as rakedoc_nano_2 for the leaderboard). Single GPU. LLM normalization is off.
| Model | Overall | Tables | Charts | Content Faithfulness | Semantic Formatting | Visual Grounding |
|---|---|---|---|---|---|---|
| rakedoc-nano-2 (mean of 3) | 80.09 | 85.86 | 71.73 | 87.80 | 79.99 | 75.07 |
KDL-Frontier-Parser-nano-v2, same harness, rakedoc_nano pipeline (mean of 2) |
79.74 | 86.01 | 70.26 | 87.59 | 79.60 | 75.22 |
KDL-Frontier-Parser-nano-v2, same harness, kdl_frontier_nano_v2 pipeline (1 run) |
79.06 | 85.96 | 69.46 | 87.62 | 76.94 | 75.34 |
Per-run Overall: 80.15 / 80.02 / 80.11.
The rakedoc_nano pipeline sends the same stage requests as the KDL pipeline. The difference is how it
writes the markdown output: it adds about +0.7 Overall to KDL v2 itself. So the weights add about
+0.35 Overall to KDL v2, and the full change is +1.0 vs the published KDL v2 row (79.07).
Training
rakedoc-nano-2 is a weight average of two fine-tunes of KDL v2: 0.7 ร A + 0.3 ร B.
- A, formatting: GRPO on the text-recognition stage (LoRA on language and vision, 150 steps, LR 3e-5). The reward scores the formatting marks (bold, italic, underline, strikethrough, superscript) against the ground truth, with a penalty for marks that are not in the ground truth and for wrong text. The data is synthetic styled text crops. An NLL anchor on the model's own chart, layout and table answers keeps the other stages stable.
- B, charts: a short SFT warm start on synthetic report charts (new chart kinds), then GRPO on the chart stage (LoRA on language and vision, 100 steps, LR 5e-5). The data is synthetic report charts and ChartQA. An NLL anchor of about 50% layout answers prevents a fault where the layout answer stops early on dense pages. We checked this fault on DocLayNet pages.
Part of our fine-tuning dataset is available at github.com/CloudRaker/cloudraker-synthdocs.
We did not use ParseBench documents for training or for model selection on the training side. We used ParseBench only to pick between finished candidates.
The prompts and output formats are those of KDL-Frontier-Parser-nano-v2:
"\nLayout Detection:\n", "\nText Recognition:\n", "\nTable Recognition:\n" (OTSL output).
Serving
You can use it as a drop-in replacement for KDL-Frontier-Parser-nano-v2:
vllm serve cloudraker/rakedoc-nano-2 --served-model-name rakedoc-nano-2 \
--max-model-len 8192 --gpu-memory-utilization 0.85 --max-num-seqs 24 \
--trust-remote-code --limit-mm-per-prompt '{"image":1}'
With ParseBench:
RAKEDOC_NANO_ENDPOINT_URL=http://localhost:8000/v1 RAKEDOC_NANO_MODEL=rakedoc-nano-2 \
uv run parse-bench run rakedoc_nano
Limitations
- Tables are 0.15 below KDL v2 (85.86 vs 86.01), and visual grounding is 0.15 below (75.07 vs 75.22).
- Highlight (
<mark>) is never emitted. - We evaluated only on ParseBench and on synthetic data. Other domains are not tested.
- Downloads last month
- 23