Skip to main content

amagi-weights

Check an open-weights model's license before you ship it. Give it a Hugging Face model, a local model folder or a .gguf file. It reads the license text and follows the base-model chain, then tells you whether you can use it commercially, what user or revenue caps apply, what you have to credit and how you have to name it, and whether your fine-tune's label matches the license it inherited.

Built for indie devs and small agencies who ship products on Llama, Qwen, Gemma, Mistral and similar models and can't have a lawyer read every model card.

demo

Install

pipx install amagi-weights

Python 3.9 or newer. No dependencies.

Usage

Point it at a model:

amagi-weights meta-llama/Llama-3.1-8B-Instruct
amagi-weights https://huggingface.co/Qwen/Qwen2.5-72B-Instruct
amagi-weights ./my-finetune            # a local folder: README.md front matter, adapter_config.json, LICENSE
amagi-weights ./model-Q4_K_M.gguf      # GGUF metadata (general.license, general.base_model.*)

A fine-tune labelled with the wrong license

examples/my-support-bot is a LoRA adapter on Llama 3.1 8B Instruct whose model card says license: apache-2.0. That label is wrong, because the Llama license stays with derivatives. A real run:

$ amagi-weights examples/my-support-bot
my-support-bot  (local: examples/my-support-bot)
  label:    apache-2.0  (README.md front matter)
  license:  Apache License 2.0  (from label in README.md front matter)
  lineage:
    my-support-bot: Apache License 2.0 [yes]
    +- adapter on meta-llama/Llama-3.1-8B-Instruct: Llama 3.1 Community License [conditional]
       +- fine-tune of meta-llama/Llama-3.1-8B: Llama 3.1 Community License [conditional]

  Commercial use: YES, WITH CONDITIONS
    - Llama 3.1 Community License (meta-llama/Llama-3.1-8B-Instruct, meta-llama/Llama-3.1-8B):
      Commercial use allowed under Meta's terms, with a user cap, branding and naming rules.
  Caps:
    - Over 700 million monthly active users (on the Llama 3.1 release date) you need a separate
      license from Meta.
  You must:
    - Keep the LICENSE and any NOTICE file, and mark files you changed.
    - Prominently display "Built with Llama" on a related website, user interface, blog post,
      about page or product documentation.
    - Notice file text: "Llama 3.1 is licensed under the Llama 3.1 Community License, Copyright
      © Meta Platforms, Inc. All Rights Reserved."
    - Follow the Llama 3.1 Acceptable Use Policy.
    - Ship a copy of the agreement with any copy of the weights or a derivative you distribute.
    - Training another model on Llama 3.1 outputs triggers the "Llama" naming rule if you
      distribute that model.
  Naming:
    - FAIL: the Llama 3.1 Community License needs the name to start with "Llama";
      "my-support-bot" does not.
  Conflicts (1):
    ! This model is labelled Apache License 2.0, but its base meta-llama/Llama-3.1-8B-Instruct
      is under the Llama 3.1 Community License, which stays with derivatives. Relabel it
      `license: llama3.1` and ship that license text.

  Result: NOT CLEARED

Not legal advice. Rules checked against the license texts on 2026-10-24; read the license before you ship.

Exit code 1. Rename it to start with "Llama", relabel it llama3.1, ship the license text, and it clears.

A model you can't use commercially

$ amagi-weights Qwen/Qwen2.5-3B-Instruct
Qwen2.5-3B-Instruct  (Hugging Face: Qwen/Qwen2.5-3B-Instruct)
  label:    other (qwen-research)  (model card)
  license:  Qwen Research License Agreement  (from license text (LICENSE))
  lineage:
    Qwen2.5-3B-Instruct: Qwen Research License Agreement [no]
    +- fine-tune of Qwen/Qwen2.5-3B: Qwen Research License Agreement [no]

  Commercial use: NO
    - Qwen Research License Agreement (this model, Qwen/Qwen2.5-3B): Research and evaluation
      only. Commercial use needs a separate license from Alibaba Cloud.
  ...
  Result: NOT CLEARED

The 7B and 72B models from the same release use other licenses (Apache 2.0, and the Qwen License with a 100 million user cap). This card and the 72B card both say license: other; amagi-weights tells them apart by reading the LICENSE file.

Check your numbers against the caps

$ amagi-weights Qwen/Qwen2.5-72B-Instruct --mau 150000000
  ...
  Commercial use: NO
    - Qwen License Agreement (this model, Qwen/Qwen2.5-72B): Commercial use allowed under
      Alibaba Cloud's terms, with a user cap and a "Built with Qwen" rule for derived models.
    - --mau 150,000,000 is over the 100,000,000 monthly active user cap in the Qwen License
      Agreement: you need a separate license.
  ...
  Result: NOT CLEARED

--revenue does the same for revenue caps, such as the Stability AI Community License's annual revenue limit.

What it checks

  • The real license. It identifies the license from the LICENSE file's text first and the model card's license: label second, and tells you when the two disagree. This catches custom licenses hidden behind license: other and cards whose label doesn't match the file.
  • The base-model chain. It follows base_model from the Hub tags, the model card, adapter_config.json, GGUF metadata and config.json, up to 5 levels. The verdict is the strictest license anywhere in the chain.
  • Commercial use. Yes, yes with conditions, no, or unknown.
  • Caps. Monthly active users and revenue, with --mau and --revenue to check your own numbers.
  • What you must do. Attribution lines, notice text, acceptable use policies, and rules about using outputs to train other models.
  • Naming rules. Llama derivatives must start with "Llama". It checks your model's name.
  • Conflicts. A fine-tune labelled MIT or Apache 2.0 on a Llama, Gemma or Qwen base, a share-alike base relabelled, or a RAIL base whose use restrictions were dropped.

amagi-weights --licenses lists the 31 licenses it knows, including Llama 2 through 4, Gemma, Qwen and Qwen Research, Mistral's MNPL and MRL, the Stability AI Community License, FLUX.1 [dev], DeepSeek, Falcon, NVIDIA Open Model, the OpenRAIL family and Creative Commons. Each one shows the date its rule was last checked against the license text.

Options

amagi-weights MODEL [MODEL ...]           # several at once
amagi-weights MODEL --format json         # also: text (default), markdown; --json is short for json
amagi-weights MODEL --mau 50000           # your monthly active users
amagi-weights MODEL --revenue 2000000     # your annual revenue in USD
amagi-weights MODEL --strict              # also fail on conditional licenses and naming misses
amagi-weights MODEL --depth 2             # how far up the base-model chain to go (default 5)
amagi-weights MODEL --no-lineage          # only the model itself
amagi-weights ./folder --offline          # never contact Hugging Face
amagi-weights MODEL --rules mine.json     # add or override license rules

Gated Llama repos serve their LICENSE file without a token. Gemma repos ship no LICENSE file, so Gemma is identified from its license: gemma label. If a lookup says access is denied, set HF_TOKEN in your environment. The token is only sent to huggingface.co (or the host in HF_ENDPOINT).

Use it in CI

Exit codes: 0 means cleared, 1 means not cleared (commercial use no or unknown, a license conflict, or a cap exceeded), 2 means a usage or lookup error. With --strict, conditional licenses and naming misses also exit 1.

amagi-weights ./model --mau 50000 --json > license-report.json

The JSON has one entry per model under results, each with commercial, cleared, lineage, caps, attribution, conditions, naming, conflicts and notes.

Use it from Claude Code

This repo ships a skill at .claude/skills/amagi-weights/SKILL.md. Copy that folder into your own .claude/skills/ and Claude Code can check a model before it suggests it, and tell you what to put in your model card.

Limits

  • It's not legal advice. It reads license texts and applies rules written from them, and it knows nothing about your contracts or how you use the model.
  • The lineage is only as good as the metadata. deepseek-ai/DeepSeek-R1-Distill-Llama-8B is labelled MIT and lists no base model, so it comes back YES. Its model card says it is derived from Llama3.1-8B-Base, which is under the Llama 3.1 license. When a name mentions Llama, Qwen, Gemma, Mistral, Falcon or FLUX and the chain has no such model, it prints a note telling you to read the card.
  • Some GGUF files carry no license. The official Qwen2.5 0.5B GGUF has no general.license key. Run it on the repo you downloaded it from instead.
  • The built-in rules were checked against the license texts on 2026-10-24. Six rarely used ones (the BigCode, BigScience and BLOOM RAIL licenses, generic OpenRAIL, BSD 3-Clause and CC0) show "not re-checked". Licensors change terms, so read the current text before you ship.
  • A license it doesn't recognise, or a tagged base model it can't fetch, makes the verdict unknown, never yes. A base named only in the card text that isn't on Hugging Face (a stale reference) is listed, left out of the verdict, and noted.

If this saved you time

A star helps other people find it.

More from AmagiLabs

  • amagilabs: other small open source dev tools from the same lab.
  • amagi-name-check: check a name for your next package or repo on PyPI, npm, crates.io, Homebrew, GitHub and six domain TLDs in one command.
  • amagi-env-check: compare .env, .env.example and the environment your app runs with on Vercel, Railway or Fly, without printing a value.
  • amagi-legal-review-skills: Claude Code skills for contract and lease review.

License

MIT, see LICENSE. Copyright (c) 2026 Amagisolutionsgroup, Inc. (AmagiLabs)

Metadata

Release files for amagi-weights 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for amagi-weights 0.1.0
File Size Uploaded Provenance Actions
amagi_weights-0.1.0.tar.gz 47.5 kB Without provenance Details for amagi_weights-0.1.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for amagi-weights 0.1.0
File Interpreter ABI Platform Actions
amagi_weights-0.1.0-py3-none-any.whl Python 3 none any Details for amagi_weights-0.1.0-py3-none-any.whl

Total release size: 78.4 kB

Release files / amagi_weights-0.1.0.tar.gz

Download URL amagi_weights-0.1.0.tar.gz
Size 47.5 kB
Tags Source
SHA-256 checksum
How to use checksums
e06a70b946e806900c109446a7e6060172e14335851c1a532ec74d9fbe34600b
BLAKE2b-256 checksum
How to use checksums
f60fde0343116f7ad79298e4eb4d290e210669d3f0cc35b489199c2a35eafd54
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.4

Release files / amagi_weights-0.1.0-py3-none-any.whl

Download URL amagi_weights-0.1.0-py3-none-any.whl
Size 30.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
d2ff1994b3e72d91174cde693d4c7b655b35f2c7d34a36446d78787e8907c915
BLAKE2b-256 checksum
How to use checksums
b359de0e924e7dab3d175f9d9814423bc2dafca052c5e42e9769332aca7547ac
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.4

Security for amagi-weights 0.1.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page