[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"project-2662":3},{"id":4,"name":5,"fullName":6,"owner":7,"repo":5,"description":8,"homepage":9,"htmlUrl":9,"language":10,"languages":9,"totalLinesOfCode":9,"stars":11,"forks":12,"watchers":13,"openIssues":14,"contributorsCount":15,"subscribersCount":15,"size":15,"stars1d":16,"stars7d":17,"stars30d":18,"stars90d":15,"forks30d":15,"starsTrendScore":19,"compositeScore":20,"rankGlobal":9,"rankLanguage":9,"license":21,"archived":22,"fork":22,"defaultBranch":23,"hasWiki":24,"hasPages":22,"topics":25,"createdAt":9,"pushedAt":9,"updatedAt":26,"readmeContent":27,"aiSummary":28,"trendingCount":15,"starSnapshotCount":15,"syncStatus":29,"lastSyncTime":30,"discoverSource":31},2662,"olmocr","allenai\u002Folmocr","allenai","Toolkit for linearizing PDFs for LLM datasets\u002Ftraining",null,"Python",17385,1401,97,55,0,6,14,81,20,44.44,"Apache License 2.0",false,"main",true,[],"2026-06-12 02:00:42","\u003Cdiv align=\"center\">\n  \u003Cimg width=\"350\" alt=\"olmocr-2-full@2x\" src=\"https:\u002F\u002Fgithub.com\u002Fuser-attachments\u002Fassets\u002F24f1b596-4059-46f1-8130-5d72dcc0b02e\" \u002F>\n\u003Chr\u002F>\n\u003C\u002Fdiv>\n\u003Cp align=\"center\">\n  \u003Ca href=\"https:\u002F\u002Fgithub.com\u002Fallenai\u002FOLMo\u002Fblob\u002Fmain\u002FLICENSE\">\n    \u003Cimg alt=\"GitHub License\" src=\"https:\u002F\u002Fimg.shields.io\u002Fgithub\u002Flicense\u002Fallenai\u002FOLMo\">\n  \u003C\u002Fa>\n  \u003Ca href=\"https:\u002F\u002Fgithub.com\u002Fallenai\u002Folmocr\u002Freleases\">\n    \u003Cimg alt=\"GitHub release\" src=\"https:\u002F\u002Fimg.shields.io\u002Fgithub\u002Frelease\u002Fallenai\u002Folmocr.svg\">\n  \u003C\u002Fa>\n  \u003Ca href=\"https:\u002F\u002Farxiv.org\u002Fabs\u002F2502.18443\">\n    \u003Cimg alt=\"Tech Report v1\" src=\"https:\u002F\u002Fimg.shields.io\u002Fbadge\u002FPaper_v1-olmOCR-blue\">\n  \u003C\u002Fa>\n  \u003Ca href=\"https:\u002F\u002Farxiv.org\u002Fabs\u002F2510.19817\">\n    \u003Cimg alt=\"Tech Report v2\" src=\"https:\u002F\u002Fimg.shields.io\u002Fbadge\u002FPaper_v2-olmOCR-blue\">\n  \u003C\u002Fa>\n  \u003Ca href=\"https:\u002F\u002Folmocr.allenai.org\">\n    \u003Cimg alt=\"Demo\" src=\"https:\u002F\u002Fimg.shields.io\u002Fbadge\u002FAi2-Demo-F0529C\">\n  \u003C\u002Fa>\n  \u003Ca href=\"https:\u002F\u002Fdiscord.gg\u002FsZq3jTNVNG\">\n    \u003Cimg alt=\"Discord\" src=\"https:\u002F\u002Fimg.shields.io\u002Fbadge\u002FDiscord%20-%20blue?style=flat&logo=discord&label=Ai2&color=%235B65E9\">\n  \u003C\u002Fa>\n\u003C\u002Fp>\n\nA toolkit for converting PDFs and other image-based document formats into clean, readable, plain text format.\n\nTry the online demo: [https:\u002F\u002Folmocr.allenai.org\u002F](https:\u002F\u002Folmocr.allenai.org\u002F)\n\nFeatures:\n - Convert PDF, PNG, and JPEG based documents into clean Markdown\n - Support for equations, tables, handwriting, and complex formatting\n - Automatically removes headers and footers\n - Convert into text with a natural reading order, even in the presence of\n   figures, multi-column layouts, and insets\n - Efficient, less than $200 USD per million pages converted\n - (Based on a 7B parameter VLM, so it requires a GPU)\n\n### News\n - October 21, 2025 - v0.4.0 - [New model release](https:\u002F\u002Fhuggingface.co\u002Fallenai\u002FolmOCR-2-7B-1025-FP8), boosts olmOCR-bench score by ~4 points using synthetic data and introduces RL training.\n - August 13, 2025 - v0.3.0 - [New model release](https:\u002F\u002Fhuggingface.co\u002Fallenai\u002FolmOCR-7B-0825-FP8), fixes auto-rotation detection, and hallucinations on blank documents.\n - July 24, 2025 - v0.2.1 - [New model release](https:\u002F\u002Fhuggingface.co\u002Fallenai\u002FolmOCR-7B-0725-FP8), scores 3 points higher on [olmOCR-Bench](https:\u002F\u002Fgithub.com\u002Fallenai\u002Folmocr\u002Ftree\u002Fmain\u002Folmocr\u002Fbench), also runs significantly faster because it's default FP8, and needs much fewer retries per document.\n - July 23, 2025 - v0.2.0 - New cleaned up [trainer code](https:\u002F\u002Fgithub.com\u002Fallenai\u002Folmocr\u002Ftree\u002Fmain\u002Folmocr\u002Ftrain), makes it much simpler to train olmOCR models yourself.\n - June 17, 2025 - v0.1.75 - Switch from sglang to vllm based inference pipeline, updated docker image to CUDA 12.8.\n - May 23, 2025 - v0.1.70 - Official docker support and images are now available! [See Docker usage](#using-docker)\n - May 19, 2025 - v0.1.68 - [olmOCR-Bench](https:\u002F\u002Fgithub.com\u002Fallenai\u002Folmocr\u002Ftree\u002Fmain\u002Folmocr\u002Fbench) launch, scoring 77.4. Launch includes 2 point performance boost in olmOCR pipeline due to bug fixes with prompts.\n - Mar 17, 2025 - v0.1.60 - Performance improvements due to better temperature selection in sampling.\n - Feb 25, 2025 - v0.1.58 -  Initial public launch and demo.\n\n### Benchmark\n\n[**olmOCR-Bench**](https:\u002F\u002Fgithub.com\u002Fallenai\u002Folmocr\u002Ftree\u002Fmain\u002Folmocr\u002Fbench):\nWe also ship a comprehensive benchmark suite covering over 7,000 test cases across 1,400 documents to help measure performance of OCR systems. \n\n\u003Ctable>\n    \u003Cthead>\n        \u003Ctr>\n            \u003Cth>\u003C\u002Fth>\n            \u003Cth>ArXiv\u003C\u002Fth>\n            \u003Cth>Old\u003Cbr>scans\u003Cbr>math\u003C\u002Fth>\n            \u003Cth>Tables\u003C\u002Fth>\n            \u003Cth>Old\u003Cbr>scans\u003C\u002Fth>\n            \u003Cth>Headers\u003Cbr>&\u003Cbr>footers\u003C\u002Fth>\n            \u003Cth>Multi\u003Cbr>column\u003C\u002Fth>\n            \u003Cth>Long\u003Cbr>tiny\u003Cbr>text\u003C\u002Fth>\n            \u003Cth>Base\u003C\u002Fth>\n            \u003Cth>Overall\u003C\u002Fth>\n        \u003C\u002Ftr>\n    \u003C\u002Fthead>\n    \u003Ctbody>\n        \u003Ctr>\n            \u003Ctd>Mistral OCR API\u003C\u002Ftd>\n            \u003Ctd>77.2\u003C\u002Ftd>\n            \u003Ctd>67.5\u003C\u002Ftd>\n            \u003Ctd>60.6\u003C\u002Ftd>\n            \u003Ctd>29.3\u003C\u002Ftd>\n            \u003Ctd>93.6\u003C\u002Ftd>\n            \u003Ctd>71.3\u003C\u002Ftd>\n            \u003Ctd>77.1\u003C\u002Ftd>\n            \u003Ctd>99.4\u003C\u002Ftd>\n            \u003Ctd>72.0±1.1\u003C\u002Ftd>\n        \u003C\u002Ftr>\n        \u003Ctr>\n            \u003Ctd>Marker 1.10.1\u003C\u002Ftd>\n            \u003Ctd>83.8\u003C\u002Ftd>\n            \u003Ctd>66.8\u003C\u002Ftd>\n            \u003Ctd>72.9\u003C\u002Ftd>\n            \u003Ctd>33.5\u003C\u002Ftd>\n            \u003Ctd>86.6\u003C\u002Ftd>\n            \u003Ctd>80.0\u003C\u002Ftd>\n            \u003Ctd>85.7\u003C\u002Ftd>\n            \u003Ctd>99.3\u003C\u002Ftd>\n            \u003Ctd>76.1±1.1\u003C\u002Ftd>\n        \u003C\u002Ftr>\n        \u003Ctr>\n            \u003Ctd>MinerU 2.5.4*\u003C\u002Ftd>\n            \u003Ctd>76.6\u003C\u002Ftd>\n            \u003Ctd>54.6\u003C\u002Ftd>\n            \u003Ctd>84.9\u003C\u002Ftd>\n            \u003Ctd>33.7\u003C\u002Ftd>\n            \u003Ctd>96.6\u003C\u002Ftd>\n            \u003Ctd>78.2\u003C\u002Ftd>\n            \u003Ctd>83.5\u003C\u002Ftd>\n            \u003Ctd>93.7\u003C\u002Ftd>\n            \u003Ctd>75.2±1.1\u003C\u002Ftd>\n        \u003C\u002Ftr>\n        \u003Ctr>\n            \u003Ctd>DeepSeek-OCR\u003C\u002Ftd>\n            \u003Ctd>77.2\u003C\u002Ftd>\n            \u003Ctd>73.6\u003C\u002Ftd>\n            \u003Ctd>80.2\u003C\u002Ftd>\n            \u003Ctd>33.3\u003C\u002Ftd>\n            \u003Ctd>96.1\u003C\u002Ftd>\n            \u003Ctd>66.4\u003C\u002Ftd>\n            \u003Ctd>79.4\u003C\u002Ftd>\n            \u003Ctd>99.8\u003C\u002Ftd>\n            \u003Ctd>75.7±1.0\u003C\u002Ftd>\n        \u003C\u002Ftr>\n        \u003Ctr>\n            \u003Ctd>Nanonets-OCR2-3B\u003C\u002Ftd>\n            \u003Ctd>75.4\u003C\u002Ftd>\n            \u003Ctd>46.1\u003C\u002Ftd>\n            \u003Ctd>86.8\u003C\u002Ftd>\n            \u003Ctd>40.9\u003C\u002Ftd>\n            \u003Ctd>32.1\u003C\u002Ftd>\n            \u003Ctd>81.9\u003C\u002Ftd>\n            \u003Ctd>93.0\u003C\u002Ftd>\n            \u003Ctd>99.6\u003C\u002Ftd>\n            \u003Ctd>69.5±1.1\u003C\u002Ftd>\n        \u003C\u002Ftr>\n        \u003Ctr>\n            \u003Ctd>PaddleOCR-VL*\u003C\u002Ftd>\n            \u003Ctd>85.7\u003C\u002Ftd>\n            \u003Ctd>71.0\u003C\u002Ftd>\n            \u003Ctd>84.1\u003C\u002Ftd>\n            \u003Ctd>37.8\u003C\u002Ftd>\n            \u003Ctd>97.0\u003C\u002Ftd>\n            \u003Ctd>79.9\u003C\u002Ftd>\n            \u003Ctd>85.7\u003C\u002Ftd>\n            \u003Ctd>98.5\u003C\u002Ftd>\n            \u003Ctd>80.0±1.0\u003C\u002Ftd>\n        \u003C\u002Ftr>\n        \u003Ctr>\n            \u003Ctd>Infinity-Parser 7B*\u003C\u002Ftd>\n            \u003Ctd>84.4\u003C\u002Ftd>\n            \u003Ctd>83.8\u003C\u002Ftd>\n            \u003Ctd>85.0\u003C\u002Ftd>\n            \u003Ctd>47.9\u003C\u002Ftd>\n            \u003Ctd>88.7\u003C\u002Ftd>\n            \u003Ctd>84.2\u003C\u002Ftd>\n            \u003Ctd>86.4\u003C\u002Ftd>\n            \u003Ctd>99.8\u003C\u002Ftd>\n            \u003Ctd>82.5±?\u003C\u002Ftd>\n        \u003C\u002Ftr>\n        \u003Ctr>\n            \u003Ctd>Chandra OCR 0.1.0*\u003C\u002Ftd>\n            \u003Ctd>82.2\u003C\u002Ftd>\n            \u003Ctd>80.3\u003C\u002Ftd>\n            \u003Ctd>88.0\u003C\u002Ftd>\n            \u003Ctd>50.4\u003C\u002Ftd>\n            \u003Ctd>90.8\u003C\u002Ftd>\n            \u003Ctd>81.2\u003C\u002Ftd>\n            \u003Ctd>92.3\u003C\u002Ftd>\n            \u003Ctd>99.9\u003C\u002Ftd>\n            \u003Ctd>83.1±0.9\u003C\u002Ftd>\n        \u003C\u002Ftr>\n        \u003Ctr>\n            \u003Ctd colspan=\"10\">\u003Chr>\u003C\u002Ftd>\n        \u003C\u002Ftr>\n        \u003Ctr>\n            \u003Ctd>\u003Cstrong>olmOCR v0.4.0\u003C\u002Fstrong>\u003C\u002Ftd>\n            \u003Ctd>83.0\u003C\u002Ftd>\n            \u003Ctd>82.3\u003C\u002Ftd>\n            \u003Ctd>84.9\u003C\u002Ftd>\n            \u003Ctd>47.7\u003C\u002Ftd>\n            \u003Ctd>96.1\u003C\u002Ftd>\n            \u003Ctd>83.7\u003C\u002Ftd>\n            \u003Ctd>81.9\u003C\u002Ftd>\n            \u003Ctd>99.7\u003C\u002Ftd>\n            \u003Ctd>82.4±1.1\u003C\u002Ftd>\n        \u003C\u002Ftr>\n    \u003C\u002Ftbody>\n\u003C\u002Ftable>\n\n\n### Installation\n\n#### System Dependencies\n\nYou will need to install poppler-utils and additional fonts for rendering PDF images.\n\nInstall dependencies (Ubuntu\u002FDebian):\n```bash\nsudo apt-get update\nsudo apt-get install poppler-utils ttf-mscorefonts-installer msttcorefonts fonts-crosextra-caladea fonts-crosextra-carlito gsfonts lcdf-typetools\n```\n\n#### Python Installation\n\nSet up a conda environment and install olmocr. The requirements for running olmOCR\nare difficult to install in an existing python environment, so please do make a clean python environment to install into.\n\n```bash\nconda create -n olmocr python=3.11\nconda activate olmocr\n```\n\nChoose the installation option that matches your use case:\n\n**Option 1: Remote Inference (Lightweight)**\n\nIf you plan to use a remote vLLM server with the `--server` flag, install the base package:\n```bash\npip install olmocr\n```\nThis avoids installing heavy GPU dependencies like PyTorch (~2GB+).\n\n**Option 2: Local GPU Inference**\n\nRequirements:\n - Recent NVIDIA GPU (tested on RTX 4090, L40S, A100, H100) with at least 12 GB of GPU RAM\n - 30GB of free disk space\n\nFor running inference with your own GPU:\n```bash\npip install olmocr[gpu] --extra-index-url https:\u002F\u002Fdownload.pytorch.org\u002Fwhl\u002Fcu128\n\n# Recommended: Install flash infer for faster inference on GPU\npip install https:\u002F\u002Fdownload.pytorch.org\u002Fwhl\u002Fcu128\u002Fflashinfer\u002Fflashinfer_python-0.2.5%2Bcu128torch2.7-cp38-abi3-linux_x86_64.whl\n```\n\n**Option 3: Beaker Cluster Execution**\n\nFor submitting jobs to Beaker clusters with the `--beaker` flag:\n```bash\npip install olmocr[beaker]\n```\n\n**Option 4: Benchmark Suite**\n\nFor running the olmOCR benchmark suite:\n```bash\npip install olmocr[bench]\n```\n\n**Combined Installation**\n\nYou can combine multiple options:\n```bash\n# GPU + Beaker support\npip install olmocr[gpu,beaker] --extra-index-url https:\u002F\u002Fdownload.pytorch.org\u002Fwhl\u002Fcu128\n\n# GPU + Benchmark support\npip install olmocr[gpu,bench] --extra-index-url https:\u002F\u002Fdownload.pytorch.org\u002Fwhl\u002Fcu128\n```\n\n**Troubleshooting**\n\nIf you run into errors about `too many open files`, update your ulimit:\n```bash\nulimit -n 65536\n```\n\n### Usage Examples\n\nFor quick testing, try the [web demo](https:\u002F\u002Folmocr.allen.ai\u002F).\n\n**Convert a Single PDF (Local GPU):**\n```bash\n# Download a sample PDF\ncurl -o olmocr-sample.pdf https:\u002F\u002Folmocr.allenai.org\u002Fpapers\u002Folmocr_3pg_sample.pdf\n\n# Convert it to markdown\nolmocr .\u002Flocalworkspace --markdown --pdfs olmocr-sample.pdf\n```\n\n**Convert an Image file:**\n```bash\nolmocr .\u002Flocalworkspace --markdown --pdfs random_page.png\n```\n\n**Convert Multiple PDFs:**\n```bash\nolmocr .\u002Flocalworkspace --markdown --pdfs tests\u002Fgnarly_pdfs\u002F*.pdf\n```\n\n**Use Remote Inference Server:**\n```bash\nolmocr .\u002Flocalworkspace --server http:\u002F\u002Fremote-server:8000\u002Fv1 --model allenai\u002FolmOCR-2-7B-1025-FP8 --markdown --pdfs *.pdf\n```\n\nWith the `--markdown` flag, results will be stored as markdown files inside of `.\u002Flocalworkspace\u002Fmarkdown\u002F`.\n\n> **Note:** You can also use `python -m olmocr.pipeline` instead of `olmocr` if you prefer. \n\n#### Viewing Results\n\nThe `.\u002Flocalworkspace\u002F` workspace folder will then have both [Dolma](https:\u002F\u002Fgithub.com\u002Fallenai\u002Fdolma) and markdown files (if using `--markdown`).\n\n\n```bash\ncat localworkspace\u002Fmarkdown\u002Folmocr-sample.md \n```\n\n```\nolmOCR: Unlocking Trillions of Tokens in PDFs with Vision Language Models\n...\n```\n\n### Using an Inference Provider or External Server\n\nIf you have a vLLM server already running elsewhere (or any inference platform implementing the OpenAI API), you can point olmOCR to use it instead of spawning a local instance.\n\n**Installation for Remote Inference:**\n```bash\n# Lightweight installation - no GPU dependencies needed\npip install olmocr\n```\n\n**Using an External Server:**\n```bash\n# Use external vLLM server instead of local one\nolmocr .\u002Flocalworkspace --server http:\u002F\u002Fremote-server:8000\u002Fv1 --model allenai\u002FolmOCR-2-7B-1025-FP8 --markdown --pdfs tests\u002Fgnarly_pdfs\u002F*.pdf\n```\n\nThe served model name in vLLM needs to match the value provided in `--model`.\n\n**Example vLLM Server Launch:**\n```bash\nvllm serve allenai\u002FolmOCR-2-7B-1025-FP8 --max-model-len 16384\n```\n\n#### Verified External Providers\n\nWe have tested `olmOCR-2-7B-1025-FP8` on these external model providers and confirmed that they work\n\n|                                                                             | $\u002F1M Input tokens | $\u002F1M Output tokens | Example Command                                                                                                                                                                |\n|-----------------------------------------------------------------------------|-------------------|--------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| [Cirrascale](https:\u002F\u002Fai2endpoints.cirrascale.ai\u002Fmodels\u002Foverview)            | $0.07             | $0.15              | `olmocr .\u002Fworkspace --server https:\u002F\u002Fai2endpoints.cirrascale.ai\u002Fapi --api_key sk-XXXXXXX --workers 1 --max_concurrent_requests 20 --model olmOCR-2-7B-1025 --pdfs tests\u002Fgnarly_pdfs\u002F*.pdf`     |\n| [DeepInfra](https:\u002F\u002Fdeepinfra.com\u002F)                                         | $0.09             | $0.19              | `olmocr .\u002Fworkspace --server https:\u002F\u002Fapi.deepinfra.com\u002Fv1\u002Fopenai --api_key DfXXXXXXX --workers 1 --max_concurrent_requests 20 --model allenai\u002FolmOCR-2-7B-1025 --pdfs tests\u002Fgnarly_pdfs\u002F*.pdf` |\n| [Parasail](https:\u002F\u002Fwww.saas.parasail.io\u002Fserverless?name=olmocr-7b-1025-fp8) | $0.10             | $0.20              | `olmocr .\u002Fworkspace --server https:\u002F\u002Fapi.parasail.io\u002Fv1 --api_key psk-XXXXX --workers 1 --max_concurrent_requests 20 --model allenai\u002FolmOCR-2-7B-1025 --pdfs tests\u002Fgnarly_pdfs\u002F*.pdf`          |\n\n\nNotes on arguments\n- `--server`: Defines the OpenAI-compatible endpoint: ex `https:\u002F\u002Fapi.deepinfra.com\u002Fv1\u002Fopenai`\n- `--api_key`: Your API key, bassed in via Authorization Bearer HTTP header\n- `--max_concurrent_requests`: Max concurrent requests that will be in-flight to the inference provider at one time\n- `--workers`: Max number of page groups that will be processed at once. You may want to set this to `1` so that you finish one group of stuff before moving on.\n- `--pages_per_group`: You may want a smaller number of pages per group as many external provides have lower concurrent request limits\n- `--model`: The model identifier, ex. `allenai\u002FolmOCR-2-7B-1025`, different providers have different names, and if you run locally, you can use `olmocr`\n- Other arguments work the same as with local inference\n\n\n### Multi-node \u002F Cluster Usage\n\nIf you want to convert millions of PDFs using multiple nodes running in parallel, olmOCR supports\nreading PDFs from AWS S3 and coordinating work using an AWS S3 output bucket.\n\n**Start the first worker node:**\n```bash\nolmocr s3:\u002F\u002Fmy_s3_bucket\u002Fpdfworkspaces\u002Fexampleworkspace --pdfs s3:\u002F\u002Fmy_s3_bucket\u002Fjakep\u002Fgnarly_pdfs\u002F*.pdf\n```\n\nThis sets up a simple work queue in your AWS bucket and starts converting PDFs.\n\n**On subsequent worker nodes:**\n```bash\nolmocr s3:\u002F\u002Fmy_s3_bucket\u002Fpdfworkspaces\u002Fexampleworkspace\n```\n\nThey will automatically start grabbing items from the same workspace queue.\n\n#### Using Beaker for Cluster Execution\n\nIf you are at Ai2 and want to linearize millions of PDFs efficiently using [beaker](https:\u002F\u002Fwww.beaker.org), install with Beaker support:\n\n```bash\npip install olmocr[gpu,beaker] --extra-index-url https:\u002F\u002Fdownload.pytorch.org\u002Fwhl\u002Fcu128\n```\n\nThen use the `--beaker` flag to prepare the workspace locally and launch N GPU workers in the cluster:\n\n```bash\nolmocr s3:\u002F\u002Fmy_s3_bucket\u002Fpdfworkspaces\u002Fexampleworkspace --pdfs s3:\u002F\u002Fmy_s3_bucket\u002Fjakep\u002Fgnarly_pdfs\u002F*.pdf --beaker --beaker_gpus 4\n```\n\n\n### Using Docker\n\nPull the Docker image (large, includes the model, ~30GB):\n```bash\ndocker pull alleninstituteforai\u002Folmocr:latest-with-model\n```\n\nFor advanced users who want to manage their own model downloads, we also provide a base image without the model:\n```bash\ndocker pull alleninstituteforai\u002Folmocr:latest\n```\n\n#### Quick Start - Process PDFs\n\nProcess a single PDF in your current directory:\n```bash\ndocker run --gpus all \\\n  -v $(pwd):\u002Fworkspace \\\n  alleninstituteforai\u002Folmocr:latest-with-model \\\n  -c \"olmocr \u002Fworkspace\u002Foutput --markdown --pdfs \u002Fworkspace\u002Fsample.pdf\"\n```\n\nProcess multiple PDFs:\n```bash\ndocker run --gpus all \\\n  -v \u002Fpath\u002Fto\u002Fpdfs:\u002Finput \\\n  -v \u002Fpath\u002Fto\u002Foutput:\u002Foutput \\\n  alleninstituteforai\u002Folmocr:latest-with-model \\\n  -c \"olmocr \u002Foutput --markdown --pdfs \u002Finput\u002F*.pdf\"\n```\n\n#### Interactive Mode\n\nRun the container interactively for exploration and debugging:\n```bash\ndocker run -it --gpus all alleninstituteforai\u002Folmocr:latest-with-model\n```\n\n> Visit our Docker repository on [Docker Hub](https:\u002F\u002Fhub.docker.com\u002Fr\u002Falleninstituteforai\u002Folmocr) for more information.\n\n### Full Documentation\n\nTo see all available options:\n```bash\nolmocr --help\nusage: pipeline.py [-h] [--pdfs [PDFS ...]] [--model MODEL] [--workspace_profile WORKSPACE_PROFILE] [--pdf_profile PDF_PROFILE] [--pages_per_group PAGES_PER_GROUP] [--max_page_retries MAX_PAGE_RETRIES] [--max_page_error_rate MAX_PAGE_ERROR_RATE] [--workers WORKERS]\n                   [--apply_filter] [--stats] [--markdown] [--target_longest_image_dim TARGET_LONGEST_IMAGE_DIM] [--target_anchor_text_len TARGET_ANCHOR_TEXT_LEN] [--guided_decoding] [--gpu-memory-utilization GPU_MEMORY_UTILIZATION] [--max_model_len MAX_MODEL_LEN]\n                   [--tensor-parallel-size TENSOR_PARALLEL_SIZE] [--data-parallel-size DATA_PARALLEL_SIZE] [--port PORT] [--server SERVER] [--beaker] [--beaker_workspace BEAKER_WORKSPACE] [--beaker_cluster BEAKER_CLUSTER] [--beaker_gpus BEAKER_GPUS] [--beaker_priority BEAKER_PRIORITY]\n                   workspace\n\nManager for running millions of PDFs through a batch inference pipeline\n\npositional arguments:\n  workspace             The filesystem path where work will be stored, can be a local folder, or an s3 path if coordinating work with many workers, s3:\u002F\u002Fbucket\u002Fprefix\u002F\n\noptions:\n  -h, --help            show this help message and exit\n  --pdfs [PDFS ...]     Path to add pdfs stored in s3 to the workspace, can be a glob path s3:\u002F\u002Fbucket\u002Fprefix\u002F*.pdf or path to file containing list of pdf paths\n  --model MODEL         Path where the model is located, allenai\u002FolmOCR-7B-0725-FP8 is the default, can be local, s3, or hugging face.\n  --workspace_profile WORKSPACE_PROFILE\n                        S3 configuration profile for accessing the workspace\n  --pdf_profile PDF_PROFILE\n                        S3 configuration profile for accessing the raw pdf documents\n  --pages_per_group PAGES_PER_GROUP\n                        Aiming for this many pdf pages per work item group\n  --max_page_retries MAX_PAGE_RETRIES\n                        Max number of times we will retry rendering a page\n  --max_page_error_rate MAX_PAGE_ERROR_RATE\n                        Rate of allowable failed pages in a document, 1\u002F250 by default\n  --workers WORKERS     Number of workers to run at a time\n  --apply_filter        Apply basic filtering to English pdfs which are not forms, and not likely seo spam\n  --stats               Instead of running any job, reports some statistics about the current workspace\n  --markdown            Also write natural text to markdown files preserving the folder structure of the input pdfs\n  --target_longest_image_dim TARGET_LONGEST_IMAGE_DIM\n                        Dimension on longest side to use for rendering the pdf pages\n  --target_anchor_text_len TARGET_ANCHOR_TEXT_LEN\n                        Maximum amount of anchor text to use (characters), not used for new models\n  --guided_decoding     Enable guided decoding for model YAML type outputs\n\nVLLM arguments:\n  --gpu-memory-utilization GPU_MEMORY_UTILIZATION\n                        Fraction of VRAM vLLM may pre-allocate for KV-cache (passed through to vllm serve).\n  --max_model_len MAX_MODEL_LEN\n                        Upper bound (tokens) vLLM will allocate KV-cache for, lower if VLLM won't start\n  --tensor-parallel-size TENSOR_PARALLEL_SIZE, -tp TENSOR_PARALLEL_SIZE\n                        Tensor parallel size for vLLM\n  --data-parallel-size DATA_PARALLEL_SIZE, -dp DATA_PARALLEL_SIZE\n                        Data parallel size for vLLM\n  --port PORT           Port to use for the VLLM server\n  --server SERVER       URL of external vLLM (or other compatible provider)\n                        server (e.g., http:\u002F\u002Fhostname:port). If provided,\n                        skips spawning local vLLM instance\n\nbeaker\u002Fcluster execution:\n  --beaker              Submit this job to beaker instead of running locally\n  --beaker_workspace BEAKER_WORKSPACE\n                        Beaker workspace to submit to\n  --beaker_cluster BEAKER_CLUSTER\n                        Beaker clusters you want to run on\n  --beaker_gpus BEAKER_GPUS\n                        Number of gpu replicas to run\n  --beaker_priority BEAKER_PRIORITY\n                        Beaker priority level for the job\n```\n\n## Code overview\n\nThere are some nice reusable pieces of the code that may be useful for your own projects:\n - A prompting strategy to get really good natural text parsing using ChatGPT 4o - [buildsilver.py](https:\u002F\u002Fgithub.com\u002Fallenai\u002Folmocr\u002Fblob\u002Fmain\u002Folmocr\u002Fdata\u002Fbuildsilver.py)\n - Basic filtering by language and SEO spam removal - [filter.py](https:\u002F\u002Fgithub.com\u002Fallenai\u002Folmocr\u002Fblob\u002Fmain\u002Folmocr\u002Ffilter\u002Ffilter.py)\n - SFT Finetuning code for Qwen2.5-VL - [train.py](https:\u002F\u002Fgithub.com\u002Fallenai\u002Folmocr\u002Fblob\u002Fmain\u002Folmocr\u002Ftrain\u002Ftrain.py)\n - GRPO RL Trainer - [grpo_train.py](https:\u002F\u002Fgithub.com\u002Fallenai\u002Folmocr\u002Fblob\u002Fmain\u002Folmocr\u002Ftrain\u002Fgrpo_train.py)\n - Synthetic data generation - [mine_html_templates.py](https:\u002F\u002Fgithub.com\u002Fallenai\u002Folmocr\u002Fblob\u002Fmain\u002Folmocr\u002Fsynth\u002Fmine_html_templates.py)\n - Processing millions of PDFs through a finetuned model using VLLM - [pipeline.py](https:\u002F\u002Fgithub.com\u002Fallenai\u002Folmocr\u002Fblob\u002Fmain\u002Folmocr\u002Fpipeline.py)\n - Viewing [Dolma docs](https:\u002F\u002Fgithub.com\u002Fallenai\u002Fdolma) created from PDFs - [dolmaviewer.py](https:\u002F\u002Fgithub.com\u002Fallenai\u002Folmocr\u002Fblob\u002Fmain\u002Folmocr\u002Fviewer\u002Fdolmaviewer.py)\n\n\n\n## Team\n\n\u003C!-- start team -->\n\n**olmOCR** is developed and maintained by the AllenNLP team, backed by [the Allen Institute for Artificial Intelligence (AI2)](https:\u002F\u002Fallenai.org\u002F).\nAI2 is a non-profit institute with the mission to contribute to humanity through high-impact AI research and engineering.\nTo learn more about who specifically contributed to this codebase, see [our contributors](https:\u002F\u002Fgithub.com\u002Fallenai\u002Folmocr\u002Fgraphs\u002Fcontributors) page.\n\n\u003C!-- end team -->\n\n## License\n\n\u003C!-- start license -->\n\n**olmOCR** is licensed under [Apache 2.0](https:\u002F\u002Fwww.apache.org\u002Flicenses\u002FLICENSE-2.0).\nA full copy of the license can be found [on GitHub](https:\u002F\u002Fgithub.com\u002Fallenai\u002Folmocr\u002Fblob\u002Fmain\u002FLICENSE).\n\n\u003C!-- end license -->\n\n## Citing\n\nFor olmOCR v1 and OlmOCR-bench:\n```bibtex\n@misc{olmocrbench,\n      title={{olmOCR: Unlocking Trillions of Tokens in PDFs with Vision Language Models}},\n      author={Jake Poznanski and Jon Borchardt and Jason Dunkelberger and Regan Huff and Daniel Lin and Aman Rangapur and Christopher Wilhelm and Kyle Lo and Luca Soldaini},\n      year={2025},\n      eprint={2502.18443},\n      archivePrefix={arXiv},\n      primaryClass={cs.CL},\n      url={https:\u002F\u002Farxiv.org\u002Fabs\u002F2502.18443},\n}\n```\n\nFor olmOCR v2 Unit Testing Rewards with RL:\n```bibtex\n@misc{olmocr2,\n      title={olmOCR 2: Unit Test Rewards for Document OCR}, \n      author={Jake Poznanski and Luca Soldaini and Kyle Lo},\n      year={2025},\n      eprint={2510.19817},\n      archivePrefix={arXiv},\n      primaryClass={cs.CV},\n      url={https:\u002F\u002Farxiv.org\u002Fabs\u002F2510.19817}, \n}\n```\n","olmocr是一个用于将PDF和其他基于图像的文档格式转换为干净、易读的纯文本格式的工具包。其核心功能包括支持PDF、PNG和JPEG文档转Markdown，能够处理公式、表格、手写体及复杂排版，并自动移除页眉页脚，确保即使在存在图表、多列布局和插图的情况下也能保持自然阅读顺序。技术上，它基于7B参数的视觉语言模型，需GPU支持，转换成本低于每百万页200美元。适用于需要高效准确地从扫描文档或PDF中提取文本信息的场景，如学术研究、企业文档管理和数字化图书馆建设等。",2,"2026-06-11 02:50:38","top_language"]