Who it is forA document parsing provider or domain team whose forms, reports, or exam papers need different region rules than the built-in layout model.
The problemLayout analysis rules differ by business use case, and a generic layout model may group or bound regions wrongly for your documents.
The outcomeOXR runs recognition and reading order on regions produced by your own layout model.
What you need first
- A PDF or document image to parse
- Python 3.12 or Node.js for the SoMark CLI, or Docker for a local service
- For local hosting: Linux, an NVIDIA GPU with BF16 support, and 24GB or more of GPU memory
Steps
- Download the OXR model weights with
hf download SoMarkAI/OXR-1.0 --local-dir ./models/OXR-1.0. - Run your custom layout analysis model as an HTTP service, with its API compatible with the built-in one. The README does not document this interface. (inferred, check the README)
- Start the OXR model service, using the vLLM steps in the README or the Docker image.
- Copy
config.example.yamltoconfig.yamland set the url field underlayout_analyze_modelto your custom service address. oxr serve --config config.yaml --host 127.0.0.1 --port 8000 --workers 1(inferred, check the README)
Prompt for your agent
Using the OXR repo at https://github.com/SoMarkAI/OXR, set the layout_analyze_model url in config.yaml to <custom-layout-service-url> and start the parsing API. Parse <path-to-sample-document.pdf> and verify that the layout bounding boxes in the JSON output come from the custom layout service.
Caveat. The README says any Layout Analysis model can work with OXR but does not document the interface a custom layout service must expose, so this needs to be checked against the code.
Use this in your AI agent
Ask your agent
Using the Deduped MCP, get the setup steps for SoMarkAI/OXR and "Replace OXR's layout model with your own for a niche document type"
Add Deduped to Claude Code once
claude mcp add --transport http deduped https://dedupedai.com/mcp
Every Monday: the 5 hottest repos and exactly how to use them. Free, one email a week, unsubscribe anytime.
Get them freeShare: X LinkedIn Hacker News Email Copy link
Third-party repos we don't own. AI-written use cases can be wrong. Disclaimer