{
 "schema_version": 1,
 "generated": "2026-10-26",
 "id": "somarkai-oxr--swap-in-custom-layout-analysis-model",
 "repo": "SoMarkAI/OXR",
 "repo_url": "https://github.com/SoMarkAI/OXR",
 "repo_slug": "somarkai-oxr",
 "title": "Replace OXR's layout model with your own for a niche document type",
 "page_title": "How to replace OXR's layout model with your own for a niche document type with OXR",
 "summary": "Point the OXR parsing API at a custom layout analysis service while keeping OXR for recognition.",
 "who": "A document parsing provider or domain team whose forms, reports, or exam papers need different region rules than the built-in layout model.",
 "problem": "Layout analysis rules differ by business use case, and a generic layout model may group or bound regions wrongly for your documents.",
 "outcome": "OXR runs recognition and reading order on regions produced by your own layout model.",
 "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.yaml` to `config.yaml` and set the url field under `layout_analyze_model` to your custom service address.",
  "`oxr serve --config config.yaml --host 127.0.0.1 --port 8000 --workers 1` (inferred, check the README)"
 ],
 "agent_prompt": "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.",
 "agents": [
  "any"
 ],
 "difficulty": "Advanced",
 "time": "2 hours",
 "basis": "readme",
 "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.",
 "category": "Software and DevOps",
 "tags": [
  "Software and DevOps"
 ],
 "lang": "python",
 "requirements": [
  "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"
 ],
 "risk": "none",
 "seen_in_the_wild": false,
 "mentioned_publicly": false,
 "risks": [],
 "best": false,
 "score": 0.7,
 "evidence": [],
 "url": "https://dedupedai.com/use-cases/somarkai-oxr/swap-in-custom-layout-analysis-model/",
 "md": "https://dedupedai.com/use-cases/somarkai-oxr/swap-in-custom-layout-analysis-model/index.md",
 "disclaimer": "Deduped lists open-source repositories that belong to other people. We do not own, maintain, audit, or vouch for any of them, and a repo appearing here is not an endorsement or a safety check. The use cases, steps, and prompts are written by AI and may be incomplete, outdated, or just wrong. Where a use case is marked \"Seen in the wild\", we link to public posts where someone described something similar, but we have not verified those posts and the use case itself is still our AI's own write-up. Use all of this at your own risk. Only run code, commands, or agents on systems and accounts you are authorized to use, and read the code and every command before you run it, especially anything that touches credentials, files, or the network. Nothing here is professional, security, legal, or financial advice. All trademarks and project names belong to their respective owners, and their use here does not imply affiliation. Content is provided as is, without warranties of any kind. Found a mistake, a safety problem, or something you want removed? Email hello@dedupedai.com and we will look at it promptly.",
 "api": "https://dedupedai.com/api/v1/usecases/somarkai-oxr--swap-in-custom-layout-analysis-model.json",
 "api_version": "v1"
}
