License for OLM‑OCR: Apache 2.0 Terms and Usage Guide
The OLM‑OCR repository is released under the Apache License 2.0, a permissive open-source license that permits commercial use, modification, and distribution provided you include the original copyright notice and license text.
The allenai/olmocr repository provides a modular OCR pipeline framework designed for large-scale scientific document processing. Understanding the license for OLM‑OCR is essential for developers who want to integrate this tool into commercial applications or distribute modified versions. The Apache 2.0 license found in the repository's top-level LICENSE file offers significant flexibility while maintaining clear attribution requirements.
Where to Find the License for OLM‑OCR
The complete license text resides in the LICENSE file at the root of the allenai/olmocr repository. This file contains the full Apache License, Version 2.0 (2024) legal wording, which governs all source code in the project including the pipeline orchestration, training modules, and evaluation benchmarks.
Apache License 2.0 Permissions and Requirements
The Apache License 2.0 is a permissive license that provides broad rights while imposing minimal requirements on users and contributors.
Commercial Use and Modification Rights
Under the terms of the license for OLM‑OCR, you are free to:
- Use the software for any purpose, including commercial applications.
- Modify the source code and create derivative works based on the OCR pipeline components found in
olmocr/pipeline.pyor any other module. - Redistribute the original or modified versions of the codebase.
Attribution Requirements
When distributing OLM‑OCR or derivative works, you must:
- Retain the original copyright notice found in the
LICENSEfile. - Include a copy of the Apache License 2.0 text.
- State any significant changes made to the files.
Licensed Components in the OLM‑OCR Repository
The Apache 2.0 license governs all modules in the repository. The following components are covered under these terms:
| Component | Purpose | Key Files |
|---|---|---|
| Pipeline orchestration | End-to-end flow: loading PDFs → preprocessing → OCR → post-processing | olmocr/pipeline.py |
| Data utilities | Training data preparation and PDF rendering | olmocr/data/prepare_olmocrmix.py, olmocr/data/renderpdf.py |
| Training modules | Model fine-tuning and GRPO training scripts | olmocr/train/train.py, olmocr/train/grpo_train.py |
| Benchmarks | OCR accuracy evaluation and table parsing | olmocr/bench/table_parsing.py, olmocr/bench/report.py |
| Filtering | Post-processing noise reduction and coherency checks | olmocr/filter/filter.py, olmocr/filter/coherency.py |
| S3 utilities | Cloud storage operations for large datasets | olmocr/s3_utils.py |
| Version metadata | Package versioning information | olmocr/version.py |
Practical Examples: Using OLM‑OCR Under Apache 2.0
The following examples demonstrate typical usage patterns that comply with the license for OLM‑OCR. Remember to include the required attribution when using these in your own projects.
Checking the Version
from olmocr.version import __version__
print(f"OLM‑OCR version: {__version__}")
Running the OCR Pipeline
from olmocr.pipeline import run_pipeline
# Process a local PDF through the complete pipeline
result = run_pipeline(pdf_path="sample.pdf", output_dir="out")
print("Extracted text:", result["text"][:200])
Building Training Batches
from olmocr.data.build_openai_batch_from_olmocrmix import build_batch
batch = build_batch(
pdf_dir="data/pdfs",
model="gpt-4o-mini",
max_tokens=2048,
)
print(f"Created batch with {len(batch)} entries")
Evaluating OCR Accuracy
from olmocr.bench.report import generate_report
report = generate_report(
predictions_dir="preds",
ground_truth_dir="gt",
metrics=["rouge", "wer", "bleu"],
)
print(report.summary())
Summary
- The license for OLM‑OCR is the Apache License 2.0, located in the repository's root
LICENSEfile. - This permissive license allows commercial use, modification, and redistribution without imposing copyleft requirements.
- You must retain copyright notices and include the license text when distributing the code or derivative works.
- All components—including
olmocr/pipeline.py, training scripts, and benchmark utilities—are covered under the same Apache 2.0 terms.
Frequently Asked Questions
Can I use OLM‑OCR in a commercial product?
Yes. The Apache License 2.0 explicitly permits commercial use. You can integrate the OCR pipeline into proprietary applications, including those referencing olmocr/pipeline.py, provided you include the required attribution and license notice.
Do I need to open-source my modifications to OLM‑OCR?
No. Unlike copyleft licenses such as GPL, Apache 2.0 does not require you to distribute your modifications. You can keep changes to files like olmocr/train/train.py or olmocr/filter/filter.py private, though you must still include the original license and copyright notices.
Where is the license file located in the repository?
The full license text is in the LICENSE file at the root of the allenai/olmocr repository. This file applies to all source code, including modules in olmocr/data/, olmocr/bench/, and olmocr/train/.
What attribution is required when using OLM‑OCR code?
You must preserve the copyright notice found in the LICENSE file and include a copy of the Apache License 2.0. If you modify files such as olmocr/pipeline.py or olmocr/version.py, you should document the changes you made while maintaining the original attribution.
Have a question about this repo?
These articles cover the highlights, but your codebase questions are specific. Give your agent direct access to the source. Share this with your agent to get started:
curl -s "https://instagit.com/install.md" Maintain an open-source project? Get it listed too →