AllenAI Olmocr Licensing: Apache 2.0 Terms and Compliance Guide
The AllenAI Olmocr project is released under the Apache License, Version 2.0, granting unlimited use, reproduction, and distribution rights provided you retain copyright notices and include the license text.
When integrating open-source OCR tools into production systems, understanding the specific licensing terms protects your organization from legal risk. The allenai/olmocr repository provides a permissive licensing model that allows commercial and private use while requiring attribution. This guide examines the exact licensing details found in the repository’s source files, including your rights and obligations when building upon this codebase.
Core Permissions Under the Apache 2.0 License
The LICENSE file at the root of the repository contains the full Apache License, Version 2.0 text. According to the allenai/olmocr source code, this permissive license grants you four fundamental rights:
- Unlimited use, reproduction, and distribution of the code in source or binary form.
- Permission to create and distribute derivative works, provided you retain the original copyright notice and include a copy of the Apache 2.0 license.
- A patent grant from contributors to the extent their contributions are required for the work.
- No warranty – the software is provided “as is” without any express or implied guarantees.
The license header in the LICENSE file begins with:
Apache License
Version 2.0, January 2004
https://www.apache.org/licenses/
Redistribution Requirements
When redistributing Olmocr or any derived component, you must comply with Sections 4(a–d) of the Apache 2.0 license. These requirements ensure proper attribution and transparency for downstream users.
You must fulfill the following three obligations:
- Include a copy of the Apache 2.0 license in your distribution.
- Preserve the copyright, patent, trademark, and attribution notices found in the original work.
- Clearly mark any modified files with a notice that they have been changed from the original.
Locating License Declarations in Repository Files
Beyond the root LICENSE file, the repository declares its licensing in metadata files. The pyproject.toml file includes the field license = "Apache-2.0", which package managers use to display compliance information. The README.md typically summarizes this information for quick reference, though the LICENSE file remains the authoritative source.
Practical Compliance Examples
Adding License Headers to Python Modules
When creating a new Python module that imports or extends Olmocr, include the standard Apache 2.0 header at the top of your file:
# =============================================================================
# Copyright © 2024 The Allen Institute for AI (AI2)
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
# =============================================================================
import olmocr
# Your code that builds on Olmocr …
Declaring Dependencies in Project Metadata
When publishing a derivative package that depends on Olmocr, declare the license in your pyproject.toml:
[project]
name = "my-olmocr-wrapper"
version = "0.1.0"
license = {text = "Apache-2.0"}
Distributing Docker Images
If you publish a Docker image containing Olmocr, copy the license file into the image to satisfy redistribution requirements:
FROM python:3.11-slim
# Install Olmocr
RUN pip install olmocr
# Copy the Apache 2.0 license into the image for compliance
COPY --from=repo https://github.com/allenai/olmocr/raw/main/LICENSE /usr/share/licenses/olmocr/LICENSE
Summary
- AllenAI Olmocr uses the Apache License, Version 2.0, a permissive open-source license.
- You may use, modify, and distribute the code commercially without opening your proprietary code.
- You must preserve copyright notices, include the license text, and document any modifications when redistributing.
- The authoritative license text resides in the
LICENSEfile, with metadata declarations inpyproject.toml.
Frequently Asked Questions
Is AllenAI Olmocr free for commercial use?
Yes. The Apache 2.0 license permits unrestricted commercial use, including selling products that incorporate the code. You may use Olmocr in proprietary applications without paying royalties or licensing fees, provided you comply with the attribution requirements.
Do I need to open-source my code if I build on top of Olmocr?
No. Apache 2.0 is not a copyleft license. You can create derivative works and keep your source code private. However, you must include the Apache 2.0 license text and preserve the original copyright notices when distributing your application.
Where is the license information stored in the repository?
The complete license terms are located in the LICENSE file at the repository root. Additionally, the pyproject.toml file contains the license = "Apache-2.0" field for package manager visibility, and the README.md typically references the licensing terms.
What are the specific requirements for modifying Olmocr files?
When you modify files from the repository, Section 4(b) of the Apache 2.0 license requires you to add a prominent notice stating that you changed the file. You must also retain the original copyright and patent notices exactly as they appear in the source, and you must include a copy of the full license with your distribution.
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 →