Overview
Nemotron 3.5 Parse extracts text and document structure from page images. This recipe sends one page through the chat API, then converts the output into Markdown and JSON blocks with the checkpoint’s postprocessing helpers.Installation
Install SGLang on an NVIDIA CUDA system using the installation guide. The BF16 checkpoint has been tested on A100, H100, and B200 GPUs. Install the dependencies for the client and postprocessing examples:Start the server
--trust-remote-code. SGLang loads the Parse chat template automatically. The server uses the checkpoint’s 16,384-token context limit, including image tokens, the task prompt, and generated output.
On A100, you can add --mm-attention-backend sdpa; it avoided two-column omissions on the tested reference pages. Some A100 and H100 outputs can differ in formatting or reading order, or omit a line. No reliable H100 workaround has been confirmed.
Parse a page
Save an RGB page image aspage.png. For a small example, you can create one with Pillow’s built-in font:
skip_special_tokens set to False: those tokens carry the document structure used below. A finish_reason of length means the output hit max_tokens; allow more output tokens if the remaining context permits.
Use the task prompt as written, rather than a general chat instruction such as “describe this image.” To parse a PDF, render its pages as images and send one page per request.
Export Markdown and structured blocks
The postprocessing code runs on the client. Download just those helpers, without downloading the model weights again:page.md contains the rendered document, including HTML tables when needed to preserve merged cells. Each block in page.json includes its class, normalized bounding box, pixel bounding box, and text, in model reading order. For the sample, both the title and sentence should appear in the rendered document.
Supported inputs and limits
- Send one document image per request. PDF rendering and combining results across pages happen on the client.
- The prompt above performs a single full-page parse. See the model card for other task prompts.
- Vision CUDA graphs (
SGLANG_VIT_ENABLE_CUDA_GRAPH=1) are not supported because they do not preserve page boundaries. Default decoder CUDA graphs remain supported. - MTP, DFlash2 speculative decoding, and pipeline parallelism are not supported by this integration.
/generate example.