DocPilot: Interactive Agent Orchestration and Training for Long Visual Document Understanding
Paper • 2610.21327 • Published • 1
How to use SetonLiang2/DocPilot with Transformers:
# Use a pipeline as a high-level helper
from transformers import pipeline
pipe = pipeline("image-text-to-text", model="SetonLiang2/DocPilot") # pip install -U transformers accelerate
# Load model directly
from transformers import AutoModel
model = AutoModel.from_pretrained("SetonLiang2/DocPilot", device_map="auto")How to use SetonLiang2/DocPilot with vLLM:
# Install vLLM from pip:
pip install vllm
# Start the vLLM server:
vllm serve "SetonLiang2/DocPilot"
# Call the server using curl (OpenAI-compatible API):
curl -X POST "http://localhost:8000/v1/completions" \
-H "Content-Type: application/json" \
--data '{
"model": "SetonLiang2/DocPilot",
"prompt": "Once upon a time,",
"max_tokens": 512,
"temperature": 0.5
}'docker model run hf.co/SetonLiang2/DocPilot
How to use SetonLiang2/DocPilot with SGLang:
# Install SGLang from pip:
pip install sglang
# Start the SGLang server:
python3 -m sglang.launch_server \
--model-path "SetonLiang2/DocPilot" \
--host 0.0.0.0 \
--port 30000
# Call the server using curl (OpenAI-compatible API):
curl -X POST "http://localhost:30000/v1/completions" \
-H "Content-Type: application/json" \
--data '{
"model": "SetonLiang2/DocPilot",
"prompt": "Once upon a time,",
"max_tokens": 512,
"temperature": 0.5
}'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 "SetonLiang2/DocPilot" \
--host 0.0.0.0 \
--port 30000
# Call the server using curl (OpenAI-compatible API):
curl -X POST "http://localhost:30000/v1/completions" \
-H "Content-Type: application/json" \
--data '{
"model": "SetonLiang2/DocPilot",
"prompt": "Once upon a time,",
"max_tokens": 512,
"temperature": 0.5
}'How to use SetonLiang2/DocPilot with Docker Model Runner:
docker model run hf.co/SetonLiang2/DocPilot
DocPilot-4B is a 4B action-tag model for long visual document understanding.
Weights are in the DocPilot-4B folder.
pip install vllm transformers
from transformers import AutoProcessor, AutoModelForImageTextToText
model = AutoModelForImageTextToText.from_pretrained(
"SetonLiang2/DocPilot",
subfolder="DocPilot-4B",
torch_dtype="auto",
device_map="auto",
)
processor = AutoProcessor.from_pretrained(
"SetonLiang2/DocPilot",
subfolder="DocPilot-4B",
)
vLLM reads a local folder directly. Download the subfolder, then serve it:
huggingface-cli download SetonLiang2/DocPilot --include "DocPilot-4B/*" --local-dir ./DocPilot
vllm serve ./DocPilot/DocPilot-4B --host 0.0.0.0 --port 8088 --dtype bfloat16
Point DocPilot at this server with protocol: vllm_tags:
llm:
provider: openai
protocol: vllm_tags
model: ./DocPilot/DocPilot-4B
base_url: http://127.0.0.1:8088/v1
api_key: EMPTY
@article{liang2026docpilot,
title={DocPilot: Interactive Agent Orchestration and Training for Long Visual Document Understanding},
author={Liang, Zhuowen and Lin, Xiaotian and Luo, Yuyu and Wang, Haixun and Tang, Nan},
journal={arXiv preprint arXiv:2610.21327},
year={2026}
}