Needle 2 Model License: Apache-2.0 and MIT Dual-Licensing Explained

The Needle 2 model is dual-licensed under Apache-2.0 (package metadata) and MIT (repository LICENSE file), giving users the flexibility to choose either permissive license.

The cactus-compute/needle repository distributes its Needle 2 model with an unusual licensing setup that has important implications for how you attribute and redistribute the code. Understanding which license applies—and when—ensures compliance whether you're installing via PyPI or forking the source.

How the Dual License Works

The project maintains two distinct license declarations:

  • pyproject.toml (line 7) — declares Apache-2.0 as the package license
  • LICENSE file — contains the full MIT license text

This creates an effective dual-licensing arrangement. The Apache-2.0 declaration governs the Python package metadata and PyPI distribution, while the MIT license text ships with the source code itself.

Retrieving License Information Programmatically

You can verify the declared license directly from installed package metadata:


# Query the license from package metadata (Apache-2.0)

import importlib.metadata as meta

print(meta.metadata("cactus-needle")["License"])

# Output: Apache-2.0

For the MIT license text bundled with the source distribution:


# Locate and display the LICENSE file contents

cat $(python -c "import pkg_resources, pathlib, sys; \
print(pathlib.Path(pkg_resources.resource_filename('needle', '../LICENSE')).resolve())")

# Displays the MIT license full text

Key Files and Their Roles

Understanding each file's purpose clarifies which license terms apply to your use case:

File License Content Purpose
pyproject.toml Apache-2.0 declaration Package metadata for PyPI and pip installations
LICENSE MIT license full text Source distribution and repository copies
README.md Overview only Project documentation; no license terms

Source references: [pyproject.toml](https://github.com/cactus-compute/needle/blob/main/pyproject.toml) · LICENSE · [README.md](https://github.com/cactus-compute/needle/blob/main/README.md)

Which License Should You Use?

Both licenses are permissive open-source licenses with minimal restrictions:

  • Apache-2.0 (recommended for formal projects)

    • Requires preservation of copyright notice and license text
    • Mandates documentation of any changes made
    • Provides express patent grant protection
    • Preferred for enterprise and commercial redistribution
  • MIT (simpler for informal use)

    • Requires only copyright notice preservation
    • Shorter, simpler terms
    • No explicit patent provisions
    • Suitable for academic and research contexts

Compliance Requirements

Regardless of which license you select, you must:

  1. Retain the original copyright notice
  2. Include a copy of your chosen license text in distributions
  3. Document any modifications (Apache-2.0 specific)

For Apache-2.0 compliance, also include the NOTICE file if one exists. For MIT compliance, the single-line copyright notice in the LICENSE file suffices.

Summary

  • The Needle 2 model uses dual licensing: Apache-2.0 in pyproject.toml, MIT in the LICENSE file
  • Apache-2.0 governs PyPI package metadata and is preferred for formal distribution
  • MIT ships with source code and offers simpler attribution requirements
  • Both licenses permit commercial use, modification, and redistribution
  • Use importlib.metadata to programmatically verify the declared license

Frequently Asked Questions

Can I choose either license for my project?

Yes. The dual-licensing structure allows you to comply with either Apache-2.0 or MIT terms. Select based on your project's patent protection needs and attribution complexity preferences.

Why does the repository use two different licenses?

This appears to be an artifact of packaging decisions—Apache-2.0 for PyPI metadata compatibility and MIT for source distribution simplicity—rather than intentional dual-licensing strategy. Both are valid and binding.

Does the Needle 2 model have any usage restrictions?

No. Both Apache-2.0 and MIT are permissive licenses with no field-of-use restrictions. You may use, modify, and redistribute the model for commercial, academic, or personal purposes provided you meet the minimal attribution requirements.

Which license text should I include in my derivative work?

Include the license corresponding to your compliance choice: the full MIT text from the LICENSE file, or the Apache-2.0 text available at apache.org/licenses/LICENSE-2.0. When in doubt, Apache-2.0 provides stronger legal protections.

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:

Share the following with your agent to get started:
curl -s "https://instagit.com/install.md"

Works with
Claude Codex Cursor VS Code OpenClaw Any MCP Client

Maintain an open-source project? Get it listed too →