<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Luming</title>
    <description>The latest articles on DEV Community by Luming (@luming).</description>
    <link>https://dev.to/luming</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F3939657%2F9bad1460-58d1-42da-b4ea-b89db11c8372.jpg</url>
      <title>DEV Community: Luming</title>
      <link>https://dev.to/luming</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/luming"/>
    <language>en</language>
    <item>
      <title>How to use OXR: From the free API to self-hosting</title>
      <dc:creator>Luming</dc:creator>
      <pubDate>Wed, 21 Oct 2026 15:30:00 +0000</pubDate>
      <link>https://dev.to/luming/how-to-use-oxr-from-the-free-api-to-self-hosting-1kb</link>
      <guid>https://dev.to/luming/how-to-use-oxr-from-the-free-api-to-self-hosting-1kb</guid>
      <description>&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fx086s4pon3zj966cuse5.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fx086s4pon3zj966cuse5.png" alt="how to use OXR" width="800" height="450"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;From your first parsed document to running OXR on your own GPU.&lt;/em&gt;&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;Summary&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Start with the free API:&lt;/strong&gt; parse your own documents with one command. No GPU, signup, or API key needed. Prefer to look first? The online demo shows the result in your browser.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;What you get:&lt;/strong&gt; OXR turns PDFs and document images into Agent-Friendly data in Markdown or JSON, with layout analysis results, using an open-source model with 1.3B parameters.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Easy to integrate:&lt;/strong&gt; OXR's API is compatible with SoMark's, so you can call it with SoMark's official Python and JavaScript SDK and CLI. The same code works with the free API and your own deployment, and switching is a base URL change.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Self-host when you need it:&lt;/strong&gt; keep documents in your own environment, control concurrency, or swap in your own layout model.&lt;/li&gt;
&lt;/ul&gt;
&lt;/blockquote&gt;

&lt;p&gt;Give OXR a PDF or a document image, and you get back structured output your Agent or RAG pipeline can use directly: Markdown or JSON, along with the layout of the page and the order in which it should be read. The first two paths below need no GPU, no account, and no API key. Pick the one that fits:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Path&lt;/th&gt;
&lt;th&gt;Best for&lt;/th&gt;
&lt;th&gt;What you need&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Free API&lt;/td&gt;
&lt;td&gt;Testing OXR on your own documents&lt;/td&gt;
&lt;td&gt;One command, no signup or API key&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Online demo&lt;/td&gt;
&lt;td&gt;Seeing what OXR does before writing any code&lt;/td&gt;
&lt;td&gt;A browser&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Self-hosting&lt;/td&gt;
&lt;td&gt;Keeping data in your environment, controlling throughput, or customizing layout analysis&lt;/td&gt;
&lt;td&gt;A Linux machine with an NVIDIA GPU&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;h2&gt;
  
  
  Start with the free API
&lt;/h2&gt;

&lt;p&gt;OXR provides a free API so you can test parsing on your own documents without registering or requesting an API key. It works with SoMark's official CLI, so it takes two steps.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;1. Install the CLI&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="c"&gt;# using Python&lt;/span&gt;
pip &lt;span class="nb"&gt;install &lt;/span&gt;somark

&lt;span class="c"&gt;# or using JavaScript&lt;/span&gt;
npm &lt;span class="nb"&gt;install&lt;/span&gt; &lt;span class="nt"&gt;-g&lt;/span&gt; somark-js
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;2. Parse your document&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;somark &lt;span class="nt"&gt;--base-url&lt;/span&gt; https://free-oxr.somark.ai/api/v1 &lt;span class="nt"&gt;--api-key&lt;/span&gt; dummy &lt;span class="se"&gt;\&lt;/span&gt;
  parse document.pdf &lt;span class="nt"&gt;--formats&lt;/span&gt; md,json &lt;span class="nt"&gt;--out&lt;/span&gt; ./parsed-output/
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Replace &lt;code&gt;document.pdf&lt;/code&gt; with the path to your file. &lt;code&gt;dummy&lt;/code&gt; is just a placeholder; You don't need a real API key.&lt;/p&gt;

&lt;h3&gt;
  
  
  What you get back
&lt;/h3&gt;

&lt;p&gt;We ran the command above on a two-column page from an academic paper, with a figure, body text, and a table. It took about 20 seconds, and &lt;code&gt;parsed-output/&lt;/code&gt; now holds two files:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;parsed-output/
├── document.md      # the page as Markdown, in reading order
└── document.json    # every block with its type, position, and content
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Here is an excerpt of &lt;code&gt;document.json&lt;/code&gt;, with long values shortened and coordinates rounded:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight json"&gt;&lt;code&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"pages"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;[{&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"page_num"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"page_size"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nl"&gt;"w"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mi"&gt;1241&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nl"&gt;"h"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mi"&gt;1654&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;},&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"blocks"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="w"&gt;
      &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nl"&gt;"idx"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mi"&gt;4&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nl"&gt;"type"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"Text"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nl"&gt;"bbox"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;75&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mi"&gt;753&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mi"&gt;606&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mi"&gt;908&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt;&lt;span class="w"&gt;
        &lt;/span&gt;&lt;span class="nl"&gt;"content"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"For a comparison of the relevance of different research themes ... ‘communication in"&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;},&lt;/span&gt;&lt;span class="w"&gt;
      &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nl"&gt;"idx"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mi"&gt;5&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nl"&gt;"type"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"Text"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nl"&gt;"bbox"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;636&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mi"&gt;487&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mi"&gt;1166&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mi"&gt;529&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt;&lt;span class="w"&gt;
        &lt;/span&gt;&lt;span class="nl"&gt;"content"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"marketing' (248.8), 'advertising-psychological aspects' (220.5) and 'pricing' (206.3)."&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;},&lt;/span&gt;&lt;span class="w"&gt;
      &lt;/span&gt;&lt;span class="err"&gt;...&lt;/span&gt;&lt;span class="w"&gt;
      &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nl"&gt;"idx"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mi"&gt;11&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nl"&gt;"type"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"Table"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nl"&gt;"bbox"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;75&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mi"&gt;977&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mi"&gt;1169&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mi"&gt;1398&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt;&lt;span class="w"&gt;
        &lt;/span&gt;&lt;span class="nl"&gt;"content"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"&amp;lt;table&amp;gt;&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;Author&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Papers&amp;lt;/td&amp;gt; ..."&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nl"&gt;"format"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"html"&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="p"&gt;}]&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Block 4 is the bottom of the left column, and block 5 picks up the same sentence at the top of the right column. Blocks come back in reading order, each with its type and position on the page. Tables are returned as HTML, and figures as image links in the Markdown.&lt;/p&gt;

&lt;h3&gt;
  
  
  Addresses and limits
&lt;/h3&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;&lt;/th&gt;
&lt;th&gt;Global&lt;/th&gt;
&lt;th&gt;Mirror&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Base URL&lt;/td&gt;
&lt;td&gt;&lt;a href="https://free-oxr.somark.ai/api/v1" rel="noopener noreferrer"&gt;https://free-oxr.somark.ai/api/v1&lt;/a&gt;&lt;/td&gt;
&lt;td&gt;&lt;a href="https://free-oxr.somark.cn/api/v1" rel="noopener noreferrer"&gt;https://free-oxr.somark.cn/api/v1&lt;/a&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;API documentation&lt;/td&gt;
&lt;td&gt;&lt;a href="https://docs.somark.ai/api-reference" rel="noopener noreferrer"&gt;https://docs.somark.ai/api-reference&lt;/a&gt;&lt;/td&gt;
&lt;td&gt;&lt;a href="https://docs.somark.cn/api-reference" rel="noopener noreferrer"&gt;https://docs.somark.cn/api-reference&lt;/a&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;ul&gt;
&lt;li&gt;somark.cn is a mirror domain of somark.ai. Choose the domain that works best for your region.&lt;/li&gt;
&lt;li&gt;We'll keep the API free until our servers can no longer handle the load.&lt;/li&gt;
&lt;li&gt;⚠️ We do not recommend using the Free OXR API in production. We do not guarantee service stability, and requests are queued, so processing speed may vary slightly. For production, self-host OXR.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Prefer to look first? Try the online demo
&lt;/h3&gt;

&lt;p&gt;Open the &lt;a href="https://free-oxr.somark.ai" rel="noopener noreferrer"&gt;online demo&lt;/a&gt;, upload a PDF or an image, and look at the parsed result next to the original page: the Markdown preview, the layout boxes, and the reading order. It's the fastest way to see how OXR handles a document you know well.&lt;/p&gt;

&lt;h2&gt;
  
  
  Plug OXR into your app
&lt;/h2&gt;

&lt;p&gt;OXR's document parsing API is compatible with SoMark's official document parsing API. That means you can reuse SoMark's Python and JavaScript SDKs and CLI, and move between the free API and your own deployment by changing one value: the base URL. You don't have to rewrite your calling code.&lt;/p&gt;

&lt;p&gt;SoMark provides a full set of CLI and SDK tools for document parsing in Python and JavaScript. For more information, see &lt;a href="https://docs.somark.ai/en/cli-sdk" rel="noopener noreferrer"&gt;https://docs.somark.ai/en/cli-sdk&lt;/a&gt;. SoMark's ecosystem fully supports deployed OXR services, but OXR does not support some of SoMark's specialized capabilities. You may see a warning that some SoMark-only options (image understanding, inline images, table images) are accepted but ignored. Open-source OXR only implements &lt;code&gt;keep_header_footer&lt;/code&gt;, and the warning is harmless.&lt;/p&gt;

&lt;p&gt;If you'd rather send a parsing request to the HTTP API directly, these are the endpoints, relative to the base URL. Output formats are set per request with the &lt;code&gt;output_formats&lt;/code&gt; field:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Endpoint&lt;/th&gt;
&lt;th&gt;Purpose&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;POST {base URL}/parse/sync&lt;/td&gt;
&lt;td&gt;Upload a file and wait for the result&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;POST {base URL}/parse/async&lt;/td&gt;
&lt;td&gt;Submit a file and get a task_id&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;POST {base URL}/parse/async_check&lt;/td&gt;
&lt;td&gt;Check the async status and result by task_id&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;For example, against the free API:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;curl &lt;span class="nt"&gt;--fail-with-body&lt;/span&gt; https://free-oxr.somark.ai/api/v1/parse/sync &lt;span class="se"&gt;\&lt;/span&gt;
  &lt;span class="nt"&gt;-F&lt;/span&gt; &lt;span class="s1"&gt;'file=@document.pdf'&lt;/span&gt; &lt;span class="se"&gt;\&lt;/span&gt;
  &lt;span class="nt"&gt;-F&lt;/span&gt; &lt;span class="s1"&gt;'api_key=dummy'&lt;/span&gt; &lt;span class="se"&gt;\&lt;/span&gt;
  &lt;span class="nt"&gt;-F&lt;/span&gt; &lt;span class="s1"&gt;'output_formats=markdown'&lt;/span&gt; &lt;span class="se"&gt;\&lt;/span&gt;
  &lt;span class="nt"&gt;-F&lt;/span&gt; &lt;span class="s1"&gt;'output_formats=json'&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;code&gt;document.pdf&lt;/code&gt; can be a local PDF or any document image that OpenCV can decode. To call your own deployment instead, use &lt;code&gt;http://localhost:8000/v1&lt;/code&gt; as the base URL.&lt;/p&gt;

&lt;h2&gt;
  
  
  Self-host when you need it
&lt;/h2&gt;

&lt;p&gt;The free API is enough to evaluate OXR. Run it locally when you need any of these:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Your documents stay in your environment.&lt;/strong&gt; Parsing runs on your own hardware.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;You control concurrency and throughput.&lt;/strong&gt; Tune OXR to your hardware and workload.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;You can swap in your own layout model.&lt;/strong&gt; OXR's layout analysis is a pluggable module, so you can keep OXR's recognition and reading order while using a layout model that matches your business rules.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;What you need:&lt;/strong&gt; a Linux operating system and an NVIDIA GPU with BF16 support, with a driver compatible with CUDA 13.0. 24GB of GPU memory on a single GPU is enough for low-concurrency testing; 48GB or more is recommended for long documents and higher concurrency. Running with Docker also requires Docker and the NVIDIA Container Toolkit.&lt;/p&gt;

&lt;h3&gt;
  
  
  1. Download the code and model weights
&lt;/h3&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Model&lt;/th&gt;
&lt;th&gt;Download links&lt;/th&gt;
&lt;th&gt;Precision&lt;/th&gt;
&lt;th&gt;Includes a lightweight layout analysis model?&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;OXR-1.0&lt;/td&gt;
&lt;td&gt;
&lt;a href="https://huggingface.co/SoMarkAI/OXR-1.0" rel="noopener noreferrer"&gt;🤗 Hugging Face&lt;/a&gt; / &lt;a href="https://modelscope.cn/models/SoMark/OXR-1.0" rel="noopener noreferrer"&gt;🤖 ModelScope&lt;/a&gt;
&lt;/td&gt;
&lt;td&gt;BF16&lt;/td&gt;
&lt;td&gt;Yes, in the layout_analysis folder&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git clone https://github.com/SoMarkAI/OXR.git
&lt;span class="nb"&gt;cd &lt;/span&gt;OXR

&lt;span class="c"&gt;# pip install -U huggingface_hub&lt;/span&gt;
hf download SoMarkAI/OXR-1.0 &lt;span class="nt"&gt;--local-dir&lt;/span&gt; ./models/OXR-1.0

&lt;span class="c"&gt;# or using ModelScope&lt;/span&gt;
&lt;span class="c"&gt;# pip install -U modelscope-hub&lt;/span&gt;
modelscope download SoMark/OXR-1.0 &lt;span class="nt"&gt;--local_dir&lt;/span&gt; ./models/OXR-1.0
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  2. Start everything with Docker
&lt;/h3&gt;

&lt;p&gt;We recommend Docker to configure and start all services together.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;docker build &lt;span class="nt"&gt;-f&lt;/span&gt; docker/Dockerfile.allinone &lt;span class="nt"&gt;-t&lt;/span&gt; oxr-1.0 &lt;span class="nb"&gt;.&lt;/span&gt;
docker run &lt;span class="nt"&gt;--rm&lt;/span&gt; &lt;span class="nt"&gt;--gpus&lt;/span&gt; all &lt;span class="nt"&gt;--ipc&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;host &lt;span class="se"&gt;\&lt;/span&gt;
  &lt;span class="nt"&gt;-p&lt;/span&gt; 127.0.0.1:8000:8000 &lt;span class="se"&gt;\&lt;/span&gt;
  &lt;span class="nt"&gt;-v&lt;/span&gt; &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="nv"&gt;$PWD&lt;/span&gt;&lt;span class="s2"&gt;/models/OXR-1.0:/models/oxr-model:ro"&lt;/span&gt; &lt;span class="se"&gt;\&lt;/span&gt;
  oxr-1.0
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Once the startup logs show that the services are ready, open &lt;a href="http://localhost:8000/demo" rel="noopener noreferrer"&gt;http://localhost:8000/demo&lt;/a&gt; or &lt;a href="http://localhost:8000/docs" rel="noopener noreferrer"&gt;http://localhost:8000/docs&lt;/a&gt;. The first startup may take longer. The default startup timeout is 900 seconds.&lt;/p&gt;

&lt;p&gt;Prefer to run the three services (the OXR model, the layout analysis model, and the document parsing API) yourself? Follow "Run from Source" in the &lt;a href="https://github.com/SoMarkAI/OXR#122-run-from-source" rel="noopener noreferrer"&gt;OXR README&lt;/a&gt;. One thing to know there: the official vLLM release does not yet support OXR inference, so we ship an out-of-tree plugin and a loading script in the model weights folder on Hugging Face. No recompilation is needed. You can use the plugin directly with the official vLLM Docker image or CLI.&lt;/p&gt;

&lt;h3&gt;
  
  
  3. Open the visual demo
&lt;/h3&gt;

&lt;p&gt;Open &lt;a href="http://localhost:8000/demo" rel="noopener noreferrer"&gt;http://localhost:8000/demo&lt;/a&gt; and upload a PDF or image. You can view the original file, Markdown preview, Markdown source, layout bounding boxes, and reading order, and download the Markdown.&lt;/p&gt;

&lt;p&gt;The interactive API documentation is at &lt;a href="http://localhost:8000/docs" rel="noopener noreferrer"&gt;http://localhost:8000/docs&lt;/a&gt;. The demo uses a temporary file cache that expires after 1 hour by default and is renewed during processing. Cached results become inaccessible once the cache expires or is cleared, so download your results promptly.&lt;/p&gt;

&lt;p&gt;To call your deployment from code, use the same SDK command as before with your local base URL:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;somark &lt;span class="nt"&gt;--base-url&lt;/span&gt; http://localhost:8000/v1 &lt;span class="nt"&gt;--api-key&lt;/span&gt; dummy &lt;span class="se"&gt;\&lt;/span&gt;
  parse document.pdf &lt;span class="nt"&gt;--formats&lt;/span&gt; md,json &lt;span class="nt"&gt;--out&lt;/span&gt; ./parsed-output/
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  4. Tune for your hardware
&lt;/h3&gt;

&lt;p&gt;The defaults work for most single-GPU setups. If you need to fit OXR into less GPU memory or a specific workload, these are the parameters to adjust:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Parameter&lt;/th&gt;
&lt;th&gt;Default&lt;/th&gt;
&lt;th&gt;Description&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;VLLM_GPU_MEMORY_UTILIZATION&lt;/td&gt;
&lt;td&gt;0.70&lt;/td&gt;
&lt;td&gt;Fraction of GPU memory budgeted for vLLM, greater than 0 and less than 1. Leave GPU memory for the layout analysis service.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;VLLM_MAX_MODEL_LEN&lt;/td&gt;
&lt;td&gt;16384&lt;/td&gt;
&lt;td&gt;Context token limit for a single model request, including the image, prompt, and output.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;OXR_&lt;em&gt;OXR_MODEL&lt;/em&gt;_MAX_TOKENS&lt;/td&gt;
&lt;td&gt;8192&lt;/td&gt;
&lt;td&gt;Maximum output tokens for a single region recognition request. Set it together with the context limit.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;OXR_&lt;em&gt;OXR_MODEL&lt;/em&gt;_MAX_CONCURRENCY&lt;/td&gt;
&lt;td&gt;16&lt;/td&gt;
&lt;td&gt;Concurrency limit for model requests shared within the API process, including region recognition and reading order requests.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;OXR_&lt;em&gt;LAYOUT_ANALYZE_MODEL&lt;/em&gt;_BATCH_SIZE&lt;/td&gt;
&lt;td&gt;8&lt;/td&gt;
&lt;td&gt;Number of pages per layout analysis request.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;OXR_&lt;em&gt;LAYOUT_ANALYZE_MODEL&lt;/em&gt;_MAX_CONCURRENCY&lt;/td&gt;
&lt;td&gt;2&lt;/td&gt;
&lt;td&gt;Concurrency limit for layout analysis requests within a single document parsing job.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;DFINE_CUDA_GRAPH&lt;/td&gt;
&lt;td&gt;1&lt;/td&gt;
&lt;td&gt;CUDA Graph switch for layout analysis. Set it to 0 to turn it off.&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;The number of input tokens plus the maximum output tokens cannot exceed VLLM_MAX_MODEL_LEN. Lowering MAX_TOKENS may truncate long text or tables.&lt;/p&gt;

&lt;p&gt;Example startup with limited concurrency and CUDA Graph turned off:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;docker run &lt;span class="nt"&gt;--rm&lt;/span&gt; &lt;span class="nt"&gt;--gpus&lt;/span&gt; all &lt;span class="nt"&gt;--ipc&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;host &lt;span class="se"&gt;\&lt;/span&gt;
  &lt;span class="nt"&gt;-p&lt;/span&gt; 127.0.0.1:8000:8000 &lt;span class="se"&gt;\&lt;/span&gt;
  &lt;span class="nt"&gt;-v&lt;/span&gt; &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="nv"&gt;$PWD&lt;/span&gt;&lt;span class="s2"&gt;/models/OXR-1.0:/models/oxr-model:ro"&lt;/span&gt; &lt;span class="se"&gt;\&lt;/span&gt;
  &lt;span class="nt"&gt;-e&lt;/span&gt; &lt;span class="nv"&gt;OXR__OXR_MODEL__MAX_CONCURRENCY&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;8 &lt;span class="se"&gt;\&lt;/span&gt;
  &lt;span class="nt"&gt;-e&lt;/span&gt; &lt;span class="nv"&gt;OXR__LAYOUT_ANALYZE_MODEL__BATCH_SIZE&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;4 &lt;span class="se"&gt;\&lt;/span&gt;
  &lt;span class="nt"&gt;-e&lt;/span&gt; &lt;span class="nv"&gt;OXR__LAYOUT_ANALYZE_MODEL__MAX_CONCURRENCY&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;1 &lt;span class="se"&gt;\&lt;/span&gt;
  &lt;span class="nt"&gt;-e&lt;/span&gt; &lt;span class="nv"&gt;DFINE_CUDA_GRAPH&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;0 &lt;span class="se"&gt;\&lt;/span&gt;
  &lt;span class="nt"&gt;-e&lt;/span&gt; &lt;span class="nv"&gt;VLLM_EXTRA_ARGS&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;"--enforce-eager --max-num-batched-tokens 8192"&lt;/span&gt; &lt;span class="se"&gt;\&lt;/span&gt;
  oxr-1.0
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Tools around OXR
&lt;/h2&gt;

&lt;p&gt;The SoMark team has developed a range of tools for document parsing. If you find them helpful, please give them a ⭐ Star.&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Tool&lt;/th&gt;
&lt;th&gt;Description&lt;/th&gt;
&lt;th&gt;Project URL&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;SoMarkDown&lt;/td&gt;
&lt;td&gt;The official Markdown parsing and rendering library for SoMark and OXR&lt;/td&gt;
&lt;td&gt;&lt;a href="https://github.com/SoMarkAI/SoMarkDown" rel="noopener noreferrer"&gt;https://github.com/SoMarkAI/SoMarkDown&lt;/a&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;SoMarkDownViewer&lt;/td&gt;
&lt;td&gt;A live editing application for SoMarkDown&lt;/td&gt;
&lt;td&gt;&lt;a href="https://github.com/SoMarkAI/SoMarkDownViewer" rel="noopener noreferrer"&gt;https://github.com/SoMarkAI/SoMarkDownViewer&lt;/a&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;SoPDF&lt;/td&gt;
&lt;td&gt;A high-performance PDF processing library with a permissive open-source license&lt;/td&gt;
&lt;td&gt;&lt;a href="https://github.com/SoMarkAI/SoPDF" rel="noopener noreferrer"&gt;https://github.com/SoMarkAI/SoPDF&lt;/a&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Docision&lt;/td&gt;
&lt;td&gt;MultiModal Jev for Document.&lt;/td&gt;
&lt;td&gt;&lt;a href="https://github.com/SoMarkAI/docision" rel="noopener noreferrer"&gt;https://github.com/SoMarkAI/docision&lt;/a&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;somark-py&lt;/td&gt;
&lt;td&gt;The official Python SDK &amp;amp; CLI for SoMark and OXR&lt;/td&gt;
&lt;td&gt;&lt;a href="https://github.com/SoMarkAI/somark-py" rel="noopener noreferrer"&gt;https://github.com/SoMarkAI/somark-py&lt;/a&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;somark-js&lt;/td&gt;
&lt;td&gt;The official JS / TS SDK &amp;amp; CLI for SoMark and OXR&lt;/td&gt;
&lt;td&gt;&lt;a href="https://github.com/SoMarkAI/somark-js" rel="noopener noreferrer"&gt;https://github.com/SoMarkAI/somark-js&lt;/a&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;h2&gt;
  
  
  What's next
&lt;/h2&gt;

&lt;p&gt;From parsing your first document to integrating OXR into your own application, you can start small and go deeper step by step. Bring real-world documents from your daily work and see how OXR handles text, tables, and complex layouts.&lt;/p&gt;

&lt;p&gt;If something doesn't parse the way you expect, please share it through our &lt;a href="https://free-oxr.somark.ai/feedback" rel="noopener noreferrer"&gt;feedback form&lt;/a&gt;. You can also bring feedback and new use cases to &lt;a href="https://github.com/SoMarkAI/OXR" rel="noopener noreferrer"&gt;GitHub&lt;/a&gt;. We'd like OXR to become a practical, easy-to-use document parsing tool in more real-world scenarios, and your documents are how we get there.&lt;/p&gt;




&lt;h2&gt;
  
  
  About OXR and SoMark
&lt;/h2&gt;

&lt;p&gt;OXR is a 1.3B open-source document parsing model from the team behind SoMark. It ranks #1 on olmOCR-Bench, OmniDocBench, and DocParsingBench and delivers SOTA parsing speed. The model uses a recursive self-improvement (RSI) loop during post-training.&lt;/p&gt;

&lt;p&gt;SoMark is a production-grade document parsing engine for agents, powered by an independent model. It supports more file formats, finer-grained recognition of document elements, and faster processing. It also offers extensive post-processing features, custom development, and model training services for different business needs.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;If OXR saves you time, give it a ⭐ on GitHub: &lt;a href="https://github.com/SoMarkAI/OXR" rel="noopener noreferrer"&gt;https://github.com/SoMarkAI/OXR&lt;/a&gt;&lt;/strong&gt;&lt;/p&gt;

</description>
      <category>ai</category>
      <category>tutorial</category>
      <category>opensource</category>
      <category>ocr</category>
    </item>
  </channel>
</rss>
